Syntalos::WorkerContext

Syntalos::WorkerContext

Syntalos::WorkerContext

Thread-safe link from a worker to the module it belongs to. More…

#include <moduleworker.h>

Public Functions

Name
WorkerContext() =default
boolrunning() const
True for as long as the current run is supposed to continue.
voidwaitForStart() const
Block until the run is started.
voidraiseError(const QString & message) const
voidraiseError(const std::string & message) const
voidraiseError(const char * message) const
voidsetStatusMessage(const QString & message) const
voidsetStatusMessage(const std::string & message) const
voidsetStatusMessage(const char * message) const
voidsetStateDormant() const
Mark the module as having nothing to do in this run.
voidsetStateReady() const
Mark the module as ready to start, without waiting for the start.
QStringmoduleName() const
The name of the module, as it was when the worker was created.

Public Attributes

Name
QuillLogger *log
The logger of the module.
std::shared_ptr< SyncTimer >timer
The master timer of the current run.

Friends

Name
classAbstractModule
classMLinkModule

Detailed Description

class Syntalos::WorkerContext;

Thread-safe link from a worker to the module it belongs to.

Every worker struct has one as member named “mod” of type WorkerContext. It is bound to the module when the worker is passed to AbstractModule::setWorker(). Everything in here can be used by any thread.

Public Functions Documentation

function WorkerContext

WorkerContext() =default

function running

inline bool running() const

True for as long as the current run is supposed to continue.

function waitForStart

void waitForStart() const

Block until the run is started.

This flags the module as READY and parks the thread until all modules are started together. It must be called by run() once its setup is complete.

function raiseError

void raiseError(
    const QString & message
) const

function raiseError

void raiseError(
    const std::string & message
) const

function raiseError

void raiseError(
    const char * message
) const

function setStatusMessage

void setStatusMessage(
    const QString & message
) const

function setStatusMessage

void setStatusMessage(
    const std::string & message
) const

function setStatusMessage

void setStatusMessage(
    const char * message
) const

function setStateDormant

void setStateDormant() const

Mark the module as having nothing to do in this run.

function setStateReady

void setStateReady() const

Mark the module as ready to start, without waiting for the start.

Calling this explicitly is usually not necessary, waitForStart() does it.

function moduleName

inline QString moduleName() const

The name of the module, as it was when the worker was created.

Public Attributes Documentation

variable log

QuillLogger * log = nullptr;

The logger of the module.

variable timer

std::shared_ptr< SyncTimer > timer;

The master timer of the current run.

Friends

friend AbstractModule

friend class AbstractModule(
    AbstractModule 
);

friend MLinkModule

friend class MLinkModule(
    MLinkModule 
);

Updated on 2026-11-26 at 18:54:14 +0000