Syntalos::SyntalosLink
Syntalos::SyntalosLink
Connection to a Syntalos instance.
#include <syntaloslink.h>
Public Functions
| Name | |
|---|---|
| ~SyntalosLink() | |
| SyntalosLink(const SyntalosLink & ) =delete | |
| SyntalosLink & | operator=(const SyntalosLink & ) =delete |
| std::string | instanceId() const |
| void | raiseError(const std::string & message) |
| void | raiseError(const std::string & title, const std::string & message) |
| void | setLoadScriptCallback(LoadScriptFn callback) |
| void | setSaveSettingsCallback(SaveSettingsFn callback) |
| void | setLoadSettingsCallback(LoadSettingsFn callback) |
| void | setPrepareRunCallback(PrepareRunFn callback) |
| void | setStartCallback(StartFn callback) |
| void | setStopCallback(StopFn callback) |
| void | setShutdownCallback(ShutdownFn callback) |
| void | setShowSettingsCallback(ShowSettingsFn callback) |
| void | setShowDisplayCallback(ShowDisplayFn callback) |
| std::shared_ptr< SyncTimer > | timer() const |
| const TestSubjectInfo & | testSubject() const |
| const RunInfo & | runInfo() const |
| auto | reserveEdlGroup(const std::shared_ptr< EDLGroup > & parent, const std::string & name) Reserve a sub-group under the given parent in the master’s canonical EDL tree, then mirror the reservation into the local worker tree. |
| auto | reserveEdlDataset(const std::shared_ptr< EDLGroup > & parent, const std::string & name) Reserve a dataset under the given parent in the master’s canonical EDL tree, then mirror the reservation into the local worker tree. |
| auto | createDefaultDataset(const std::string & preferredName ={}) Create (or return cached) the default dataset for this module. |
| auto | createStorageGroup(const std::string & name) Create (or open) a sub-group under this module’s assigned root. |
| bool | allowAsyncStart() const |
| void | setAllowAsyncStart(bool allow) |
| void | awaitData(int timeoutUsec =-1, const std::function< void()> & eventFn =nullptr) |
| void | awaitDataForever(const std::function< void()> & eventFn =nullptr, int intervalUsec =125 *1000) |
| ModuleState | state() const |
| void | setState(ModuleState state) |
| bool | isShutdownPending() const Returns true if a shutdown (via IPC or SIGTERM/SIGINT) has been requested. |
| void | setShutdownPending(bool pending) |
| void | setStatusMessage(const std::string & message) |
| int | maxRealtimePriority() const |
| std::vector< std::shared_ptr< InputPortInfo > > | inputPorts() const |
| std::vector< std::shared_ptr< OutputPortInfo > > | outputPorts() const |
| auto | registerInputPort(const std::string & id, const std::string & title, BaseDataType::TypeId typeId) |
| auto | registerOutputPort(const std::string & id, const std::string & title, BaseDataType::TypeId typeId, const MetaStringMap & metadata ={}) |
| void | updateInputPort(const std::shared_ptr< InputPortInfo > & iport) |
| void | updateOutputPort(const std::shared_ptr< OutputPortInfo > & oport) |
| void | removeInputPort(const std::shared_ptr< InputPortInfo > & iport) |
| void | removeOutputPort(const std::shared_ptr< OutputPortInfo > & oport) |
| void | resetPorts() Drop all registered ports. |
| bool | submitOutput(const std::shared_ptr< OutputPortInfo > & oport, const BaseDataType & data) |
| std::unique_ptr< FreqCounterSynchronizer > | initCounterSynchronizer(double frequencyHz, const std::string & id ={}) Create a synchronizer for a monotonic counter at the given frequency. |
| std::unique_ptr< SecondaryClockSynchronizer > | initClockSynchronizer(double expectedFrequencyHz =0, const std::string & id ={}) Create a synchronizer for an external steady monotonic clock. |
Friends
| Name | |
|---|---|
| std::unique_ptr< SyntalosLink > | initSyntalosModuleLink(const ModuleInitOptions & optn) |
Public Functions Documentation
function ~SyntalosLink
~SyntalosLink()function SyntalosLink
SyntalosLink(
const SyntalosLink &
) =deletefunction operator=
SyntalosLink & operator=(
const SyntalosLink &
) =deletefunction instanceId
std::string instanceId() constfunction raiseError
void raiseError(
const std::string & message
)function raiseError
void raiseError(
const std::string & title,
const std::string & message
)function setLoadScriptCallback
void setLoadScriptCallback(
LoadScriptFn callback
)function setSaveSettingsCallback
void setSaveSettingsCallback(
SaveSettingsFn callback
)function setLoadSettingsCallback
void setLoadSettingsCallback(
LoadSettingsFn callback
)function setPrepareRunCallback
void setPrepareRunCallback(
PrepareRunFn callback
)function setStartCallback
void setStartCallback(
StartFn callback
)function setStopCallback
void setStopCallback(
StopFn callback
)function setShutdownCallback
void setShutdownCallback(
ShutdownFn callback
)function setShowSettingsCallback
void setShowSettingsCallback(
ShowSettingsFn callback
)function setShowDisplayCallback
void setShowDisplayCallback(
ShowDisplayFn callback
)function timer
std::shared_ptr< SyncTimer > timer() constfunction testSubject
const TestSubjectInfo & testSubject() constfunction runInfo
const RunInfo & runInfo() constfunction reserveEdlGroup
auto reserveEdlGroup(
const std::shared_ptr< EDLGroup > & parent,
const std::string & name
)Reserve a sub-group under the given parent in the master’s canonical EDL tree, then mirror the reservation into the local worker tree.
Parameters:
- parent Group to create the new group under (must be reachable from runInfo().rootGroup).
- name Name for the new sub-group.
CREATE_OR_OPEN semantics: if the group already exists (in the master or locally) it is returned as-is. Returns the local EDLGroup on success; an error string on failure.
function reserveEdlDataset
auto reserveEdlDataset(
const std::shared_ptr< EDLGroup > & parent,
const std::string & name
)Reserve a dataset under the given parent in the master’s canonical EDL tree, then mirror the reservation into the local worker tree.
Parameters:
- parent Group to create the dataset in (must be reachable from runInfo().rootGroup).
- name Name for the new dataset.
MUST_CREATE semantics: fails if a dataset with the same name already exists in the group (catches cross-process duplicates via the master’s single source of truth). Returns the local EDLDataset on success; an error string on failure.
function createDefaultDataset
auto createDefaultDataset(
const std::string & preferredName ={}
)Create (or return cached) the default dataset for this module.
Uses MUST_CREATE semantics; fails if the name is already taken.
function createStorageGroup
auto createStorageGroup(
const std::string & name
)Create (or open) a sub-group under this module’s assigned root.
Convenience shorthand for reserveEdlGroup(runInfo().rootGroup, name).
function allowAsyncStart
bool allowAsyncStart() constOn startup, Syntalos can request start() on all external modules in parallel. This is the async-start method, and it results in start times of modules being much closer aligned. However, some modules have circular dependencies on metadata from other modules and may modify it in start(). Those may want to disable async-start for themselves, so they run exclusively and the engine waits for their start() call to complete.
function setAllowAsyncStart
void setAllowAsyncStart(
bool allow
)function awaitData
void awaitData(
int timeoutUsec =-1,
const std::function< void()> & eventFn =nullptr
)Parameters:
- timeoutUsec Timeout after which we return, or -1 to loop forever.
- eventFn Callback to an external even processing function to be called occasionally.
Wait for incoming messages for the given amount of microseconds, then return.
When messages arrive, the respective callbacks are called.
function awaitDataForever
void awaitDataForever(
const std::function< void()> & eventFn =nullptr,
int intervalUsec =125 *1000
)Parameters:
- eventFn The event processing function to call.
- intervalUsec The interval at which the function should be called.
Wait for incoming messages forever, calling callbacks in the current thread when they arrive.
If an event function is provided, it is called at the respective interval while we loop.
function state
ModuleState state() constfunction setState
void setState(
ModuleState state
)function isShutdownPending
bool isShutdownPending() constReturns true if a shutdown (via IPC or SIGTERM/SIGINT) has been requested.
Callers with their own spin loops should check this flag and exit promptly.
function setShutdownPending
void setShutdownPending(
bool pending
)function setStatusMessage
void setStatusMessage(
const std::string & message
)function maxRealtimePriority
int maxRealtimePriority() constfunction inputPorts
std::vector< std::shared_ptr< InputPortInfo > > inputPorts() constfunction outputPorts
std::vector< std::shared_ptr< OutputPortInfo > > outputPorts() constfunction registerInputPort
auto registerInputPort(
const std::string & id,
const std::string & title,
BaseDataType::TypeId typeId
)Parameters:
- id Unique port identifier string.
- title Human-readable port title shown in the flow graph.
- typeId Data type ID (e.g. DataType.Frame, DataType.TableRow).
Return: InputPortInfo handle.
Declare a new input port for this module.
Must be called at initialization time to tell Syntalos the port topology for this module. Will return an error if an invalid type is passed or communication with Syntalos failed. If called for an existing port with the same ID and data type, it will be updated and returned instead. Trying to change the data type on an existing port is an error.
function registerOutputPort
auto registerOutputPort(
const std::string & id,
const std::string & title,
BaseDataType::TypeId typeId,
const MetaStringMap & metadata ={}
)Parameters:
- id Unique port identifier string.
- title Human-readable port title shown in the flow graph.
- typeId Data type ID (e.g. DataType.Frame, DataType.TableRow).
- metadata Metadata associated with this port.
Return: OutputPortInfo handle.
Declare a new output port for this module.
Must be called at initialization time to tell Syntalos the port topology for this module. Will return an error if an invalid type is passed or communication with Syntalos failed. If called for an existing port with the same ID and data type, it will be updated and returned instead. Trying to change the data type on an existing port is an error.
function updateInputPort
void updateInputPort(
const std::shared_ptr< InputPortInfo > & iport
)function updateOutputPort
void updateOutputPort(
const std::shared_ptr< OutputPortInfo > & oport
)function removeInputPort
void removeInputPort(
const std::shared_ptr< InputPortInfo > & iport
)function removeOutputPort
void removeOutputPort(
const std::shared_ptr< OutputPortInfo > & oport
)function resetPorts
void resetPorts()Drop all registered ports.
This tears down every IPC publisher/subscriber and clears the port lists, so the next round of registerInputPort() / registerOutputPort() calls starts from a clean slate.
function submitOutput
bool submitOutput(
const std::shared_ptr< OutputPortInfo > & oport,
const BaseDataType & data
)function initCounterSynchronizer
std::unique_ptr< FreqCounterSynchronizer > initCounterSynchronizer(
double frequencyHz,
const std::string & id ={}
)Create a synchronizer for a monotonic counter at the given frequency.
Parameters:
- frequencyHz The expected sampling frequency of the counter.
- id Optional synchronizer id; if empty, the module instance id is used.
Must be called while the module is in PREPARING, READY or RUNNING state, and is only valid for the current run..
function initClockSynchronizer
std::unique_ptr< SecondaryClockSynchronizer > initClockSynchronizer(
double expectedFrequencyHz =0,
const std::string & id ={}
)Create a synchronizer for an external steady monotonic clock.
Parameters:
- expectedFrequencyHz Optional expected acquisition frequency in Hz; if > 0 it auto-tunes calibration point count and tolerance.
- id Optional synchronizer id; if empty, the module instance id is used.
Must be called while the module is in PREPARING, READY or RUNNING state, and is only valid for the current run.
Friends
friend initSyntalosModuleLink
friend std::unique_ptr< SyntalosLink > initSyntalosModuleLink(
const ModuleInitOptions & optn
);Updated on 2026-05-24 at 18:43:38 +0000