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 | |
| bool | running() const True for as long as the current run is supposed to continue. |
| void | waitForStart() const Block until the run is started. |
| void | raiseError(const QString & message) const |
| void | raiseError(const std::string & message) const |
| void | raiseError(const char * message) const |
| void | setStatusMessage(const QString & message) const |
| void | setStatusMessage(const std::string & message) const |
| void | setStatusMessage(const char * message) const |
| void | setStateDormant() const Mark the module as having nothing to do in this run. |
| void | setStateReady() const Mark the module as ready to start, without waiting for the start. |
| QString | moduleName() 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 | |
|---|---|
| class | AbstractModule |
| class | MLinkModule |
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() =defaultfunction running
inline bool running() constTrue for as long as the current run is supposed to continue.
function waitForStart
void waitForStart() constBlock 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
) constfunction raiseError
void raiseError(
const std::string & message
) constfunction raiseError
void raiseError(
const char * message
) constfunction setStatusMessage
void setStatusMessage(
const QString & message
) constfunction setStatusMessage
void setStatusMessage(
const std::string & message
) constfunction setStatusMessage
void setStatusMessage(
const char * message
) constfunction setStateDormant
void setStateDormant() constMark the module as having nothing to do in this run.
function setStateReady
void setStateReady() constMark 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() constThe 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