Syntalos::SyntalosLink

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::stringinstanceId() const
voidraiseError(const std::string & message)
voidraiseError(const std::string & title, const std::string & message)
voidsetLoadScriptCallback(LoadScriptFn callback)
voidsetSaveSettingsCallback(SaveSettingsFn callback)
voidsetLoadSettingsCallback(LoadSettingsFn callback)
voidsetPrepareRunCallback(PrepareRunFn callback)
voidsetStartCallback(StartFn callback)
voidsetStopCallback(StopFn callback)
voidsetShutdownCallback(ShutdownFn callback)
voidsetShowSettingsCallback(ShowSettingsFn callback)
voidsetShowDisplayCallback(ShowDisplayFn callback)
SyncTimer *timer() const
const TestSubjectInfo &testSubject() const
boolallowAsyncStart() const
voidsetAllowAsyncStart(bool allow)
voidawaitData(int timeoutUsec =-1, const std::function< void()> & eventFn =nullptr)
voidawaitDataForever(const std::function< void()> & eventFn =nullptr, int intervalUsec =125 *1000)
ModuleStatestate() const
voidsetState(ModuleState state)
boolisShutdownPending() const
Returns true if a shutdown (via IPC or SIGTERM/SIGINT) has been requested.
voidsetStatusMessage(const std::string & message)
intmaxRealtimePriority() const
std::vector< std::shared_ptr< InputPortInfo > >inputPorts() const
std::vector< std::shared_ptr< OutputPortInfo > >outputPorts() const
autoregisterInputPort(const std::string & id, const std::string & title, BaseDataType::TypeId typeId)
autoregisterOutputPort(const std::string & id, const std::string & title, BaseDataType::TypeId typeId, const MetaStringMap & metadata ={})
voidupdateInputPort(const std::shared_ptr< InputPortInfo > & iport)
voidupdateOutputPort(const std::shared_ptr< OutputPortInfo > & oport)
voidremoveInputPort(const std::shared_ptr< InputPortInfo > & iport)
voidremoveOutputPort(const std::shared_ptr< OutputPortInfo > & oport)
voidresetPorts()
Drop all registered ports.
boolsubmitOutput(const std::shared_ptr< OutputPortInfo > & oport, const BaseDataType & data)

Friends

Name
std::unique_ptr< SyntalosLink >initSyntalosModuleLink(const ModuleInitOptions & optn)

Public Functions Documentation

function ~SyntalosLink

~SyntalosLink()

function SyntalosLink

SyntalosLink(
    const SyntalosLink & 
) =delete

function operator=

SyntalosLink & operator=(
    const SyntalosLink & 
) =delete

function instanceId

std::string instanceId() const

function 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

SyncTimer * timer() const

function testSubject

const TestSubjectInfo & testSubject() const

function allowAsyncStart

bool allowAsyncStart() const

On 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() const

function setState

void setState(
    ModuleState state
)

function isShutdownPending

bool isShutdownPending() const

Returns 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 setStatusMessage

void setStatusMessage(
    const std::string & message
)

function maxRealtimePriority

int maxRealtimePriority() const

function inputPorts

std::vector< std::shared_ptr< InputPortInfo > > inputPorts() const

function outputPorts

std::vector< std::shared_ptr< OutputPortInfo > > outputPorts() const

function 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.

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.

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
)

Friends

friend initSyntalosModuleLink

friend std::unique_ptr< SyntalosLink > initSyntalosModuleLink(
    const ModuleInitOptions & optn
);

Updated on 2026-04-24 at 23:36:58 +0000