Syntalos::SyntalosLinkModule
Syntalos::SyntalosLinkModule
Convenience interface to write an OOP Syntalos module.
#include <syntaloslinkmodule.h>
Inherits from QObject
Public Functions
Name | |
---|---|
SyntalosLinkModule(SyntalosLink * slink) | |
~SyntalosLinkModule() | |
void | raiseError(const QString & message) |
void | raiseError(const QString & title, const QString & message) |
void | awaitData(int timeoutUsec =-1) |
ModuleState | state() const |
void | setState(ModuleState state) |
void | setStatusMessage(const QString & message) |
virtual bool | prepare(const QByteArray & settings) |
virtual void | start() |
virtual void | stop() |
Protected Functions
Name | |
---|---|
SyncTimer * | timer() const |
template <typename T > requires std::is_base_of_v< BaseDataType, T > std::shared_ptr< OutputPortLink< T > > | registerOutputPort(const QString & id, const QString & title =QString(), const QVariantHash & metadata =QVariantHash()) Register an output port for this module. |
template <typename T ,typename U > requires std::is_base_of_v< BaseDataType, T > std::shared_ptr< InputPortInfo > | registerInputPort(const QString & id, const QString & title, U * instance, void(U::*)(const T &data) fn) Register an input port for this module. |
Protected Attributes
Name | |
---|---|
bool | m_running |
Public Functions Documentation
function SyntalosLinkModule
explicit SyntalosLinkModule(
SyntalosLink * slink
)
function ~SyntalosLinkModule
~SyntalosLinkModule()
function raiseError
void raiseError(
const QString & message
)
function raiseError
void raiseError(
const QString & title,
const QString & message
)
function awaitData
void awaitData(
int timeoutUsec =-1
)
function state
ModuleState state() const
function setState
void setState(
ModuleState state
)
function setStatusMessage
void setStatusMessage(
const QString & message
)
function prepare
virtual bool prepare(
const QByteArray & settings
)
function start
virtual void start()
function stop
virtual void stop()
Protected Functions Documentation
function timer
SyncTimer * timer() const
function registerOutputPort
template <typename T >
inline requires std::is_base_of_v< BaseDataType, T > std::shared_ptr< OutputPortLink< T > > registerOutputPort(
const QString & id,
const QString & title =QString(),
const QVariantHash & metadata =QVariantHash()
)
Register an output port for this module.
Return: A reference to the output port, which can be used to submit new data
This function should be called in the module’s constructor to publish the intent to produce an output stream of type T. Other modules may subscribe to this stream.
function registerInputPort
template <typename T ,
typename U >
inline requires std::is_base_of_v< BaseDataType, T > std::shared_ptr< InputPortInfo > registerInputPort(
const QString & id,
const QString & title,
U * instance,
void(U::*)(const T &data) fn
)
Register an input port for this module.
This function should be called in the module’s constructor to publish the intent to accept input stream subscriptions of type T. The user may subscribe this module to other modules which produce the data it accepts.
In order to receive data, a callback function to be called when new data is available must also be provided.
Protected Attributes Documentation
variable m_running
bool m_running;
Updated on 2024-11-06 at 17:10:29 +0000