Syntalos
Syntalos
Namespaces
| Name |
|---|
| Syntalos::edl |
| Syntalos::datactl |
| Syntalos::ipc |
| Syntalos::detail |
Classes
| Name | |
|---|---|
| struct | Syntalos::supports_buffer_reuse |
| struct | Syntalos::supports_buffer_reuse< Frame > |
| struct | Syntalos::BaseDataType Base interface for all data types. |
| struct | Syntalos::ControlCommand A control command to a module. |
| struct | Syntalos::TableRow A new row for a table. |
| struct | Syntalos::LineCommand Command issued to a hardware signal line / channel / pin. |
| struct | Syntalos::LineReading Scalar reading from a hardware signal line at a moment in time. |
| struct | Syntalos::SignalBlockI16 A block of 16-bit signed integer signal data with timestamps. |
| struct | Syntalos::SignalBlockU16 A block of 16-bit unsigned integer signal data with timestamps. |
| struct | Syntalos::SignalBlockI32 A block of 32-bit signed integer signal data with timestamps. |
| struct | Syntalos::SignalBlockF32 A block of 32-bit floating-point timestamped signal data. |
| struct | Syntalos::Frame A single frame of a video stream. |
| class | Syntalos::EDLAuthor |
| class | Syntalos::EDLDataPart |
| class | Syntalos::EDLDataFile |
| class | Syntalos::EDLUnit Base class for all EDL entities. |
| class | Syntalos::EDLDataset An EDL dataset. |
| class | Syntalos::EDLGroup A grouping of groups or datasets. |
| class | Syntalos::EDLCollection A collection of groups and datasets. |
| struct | Syntalos::MetaSize Represents the dimensions of a two-dimensional object with width and height. |
| struct | Syntalos::MetaArray Array of values used for stream metadata. |
| struct | Syntalos::MetaStringMap Mapping of values used for stream metadata. |
| struct | Syntalos::MetaValue Data type that can be used as stream metadata. |
| struct | Syntalos::Uuid A 16-byte UUID (Universally Unique Identifier). |
| struct | Syntalos::symaster_clock Syntalos Master Clock. |
| class | Syntalos::SyncTimer |
| class | Syntalos::FreqCounterSynchronizer Synchronizer for a monotonic counter, given a frequency. |
| class | Syntalos::SecondaryClockSynchronizer Synchronizer for an external steady monotonic clock. |
| class | Syntalos::TimeSyncFileWriter Write a timestamp synchronization file. |
| class | Syntalos::TimeSyncFileReader Read a time-sync (.tsync) file. |
| class | Syntalos::DataTypeSelector Combo box for selecting a single stream data type. |
| class | Syntalos::BinaryStreamWriter Writer for Syntalos data entity serialization. |
| class | Syntalos::BinaryStreamReader Reader for Syntalos data entity deserialization. |
| class | Syntalos::Flags Type-safe bitfield wrapper for scoped enums. |
| class | Syntalos::SimpleTerminal A simple integrated terminal emulator. |
| class | Syntalos::SysInfo |
| class | Syntalos::GlobalConfig |
| class | Syntalos::IoxLogger |
| class | Syntalos::MLinkControlSink Receiver of the control messages a worker process sends to us. |
| class | Syntalos::MLinkControlChannel The IPC endpoints on which we receive control messages from a worker process. |
| struct | Syntalos::MLinkOutPortSub Forwards the data of one output port from the worker process into our data stream. |
| struct | Syntalos::MLinkOutStreamInfo An output stream of the module, as the thread needs to know it during a run. |
| struct | Syntalos::MLinkRunWorker Relays data and control messages of the worker process while a run is active. |
| class | Syntalos::MLinkWorkerControlSink Acts on control messages in the module’s thread, while a run is active. |
| class | Syntalos::MLinkModule Master link for out-of-process modules. |
| struct | Syntalos::IpcServiceTopology IPC service topology limits. |
| struct | Syntalos::InputPortChangeRequest Information about an input port change. |
| struct | Syntalos::OutputPortChangeRequest Information about an output port change. |
| struct | Syntalos::UpdateInputPortMetadataRequest request to update the metadata of an input port |
| struct | Syntalos::DoneResponse |
| struct | Syntalos::ErrorEvent |
| struct | Syntalos::StateChangeEvent |
| struct | Syntalos::StatusMessageEvent |
| struct | Syntalos::SyncDetailsEvent |
| struct | Syntalos::SyncOffsetEvent |
| struct | Syntalos::ApiVersionRequest |
| struct | Syntalos::ApiVersionResponse |
| struct | Syntalos::SetNicenessRequest |
| struct | Syntalos::SetMaxRealtimePriority |
| struct | Syntalos::SetCPUAffinityRequest |
| struct | Syntalos::DeletePortRequest |
| struct | Syntalos::ConnectInputRequest |
| struct | Syntalos::LoadScriptRequest |
| struct | Syntalos::SetPortsPresetRequest |
| struct | Syntalos::SaveSettingsRequest |
| struct | Syntalos::SaveSettingsResponse |
| struct | Syntalos::LoadSettingsRequest |
| struct | Syntalos::SetModuleNameRequest |
| struct | Syntalos::PrepareRunRequest |
| struct | Syntalos::StartRequest |
| struct | Syntalos::StopRequest |
| struct | Syntalos::ShutdownRequest |
| struct | Syntalos::ShowSettingsRequest |
| struct | Syntalos::ShowDisplayRequest |
| struct | Syntalos::EdlReserveRequest |
| struct | Syntalos::EdlReserveReply |
| class | Syntalos::ModuleInfo Static information about a module. |
| struct | Syntalos::TestSubject The TestSubject struct Data about a test subject. |
| struct | Syntalos::RunInfo Details of a single, prepared experiment run. |
| class | Syntalos::AbstractStreamPort |
| class | Syntalos::VarStreamInputPort |
| class | Syntalos::StreamInputPort |
| class | Syntalos::StreamOutputPort |
| class | Syntalos::AbstractModule Abstract base class for all modules. |
| class | Syntalos::LiveValue A value that the main thread can change while a worker is running. |
| class | Syntalos::Guarded A mutex-protected value that is handed over between the main thread and a worker. |
| class | Syntalos::MainCallback A callback that a worker can invoke from its thread, to run code on the main thread. |
| class | Syntalos::WorkerContext Thread-safe link from a worker to the module it belongs to. |
| class | Syntalos::WorkerTimer A one-shot timer of an event-driven worker. |
| class | Syntalos::WorkerEvents Event registrations of an event-driven worker. |
| class | Syntalos::OptionalWaitCondition The OptionalWaitCondition class. |
| struct | Syntalos::ModuleRunStats Statistics for a single module that took part in a run. |
| struct | Syntalos::EventThreadRunStats Statistics for a shared event thread. |
| struct | Syntalos::ConnectionRunStats Statistics for a single connection (stream subscription) between two ports. |
| struct | Syntalos::RunStatistics Statistics collected by the engine over one experiment run. |
| struct | Syntalos::ExportedStreamInfo |
| class | Syntalos::StreamExporter Exporter for streaming data from modules. |
| struct | Syntalos::MemInfo |
| struct | Syntalos::MemPressure Memory pressure stall information as reported by the kernel (PSI). |
| struct | Syntalos::DiskSpaceInfo Information about the storage a path is located on. |
| struct | Syntalos::ThreadUsageStats Resource usage of a single OS thread (or a whole process). |
| struct | Syntalos::ProcessSchedInfo Strongest scheduling priority found among all threads of a process. |
| class | Syntalos::ResourceTrend Estimate how fast a resource is being used up. |
| class | Syntalos::InputPortInfo Reference for an input port. |
| class | Syntalos::OutputPortInfo Reference for an output port. |
| struct | Syntalos::TestSubjectInfo Information about the current test subject. |
| struct | Syntalos::LinkRunInfo Information about the current run and its data storage location. |
| class | Syntalos::SyntalosLink Connection to a Syntalos instance. |
| struct | Syntalos::ModuleInitOptions |
| class | Syntalos::SubscriptionNotifier Notifies about new data on a stream subscription in a Qt event loop. |
| class | Syntalos::TermSignalWatcher Delivers SIGINT and SIGTERM as a Qt signal on the thread that created the watcher. |
| class | Syntalos::OutputPortLink Reference for an output port to emit new data. |
| class | Syntalos::SyntalosLinkModule Convenience interface to write an OOP Syntalos module. |
Types
| Name | |
|---|---|
| enum class uint8_t | ModuleState { UNKNOWN, INITIALIZING, IDLE, PREPARING, DORMANT, READY, RUNNING, ERROR} The ModuleState enum. |
| enum class | ControlCommandKind { UNKNOWN, START, PAUSE, STOP, STEP, CUSTOM} The ControlCommandKind enum. |
| enum class | LineCommandKind { UNKNOWN, SET_MODE, WRITE_DIGITAL, WRITE_ANALOG, WRITE_DIGITAL_PULSE, WRITE_ANALOG_PULSE, CUSTOM} The LineCommandKind enum. |
| enum class uint32_t | LineModeFlag { NONE = 0, IS_INPUT = 1u « 0, IS_OUTPUT = 1u « 1, PULL_UP = 1u « 2, PULL_DOWN = 1u « 3, ANALOG = 1u « 4} Individual mode bits for LineCommandKind::SetMode. |
| enum class | SignalDataType { Amplifier, AuxInput, SupplyVoltage, BoardAdc, BoardDigIn, BoardDigOut} Type of a signal from a signal source. |
| enum class | EDLUnitKind { UNKNOWN, COLLECTION, GROUP, DATASET} |
| enum class | EDLCreateFlag { OPEN_ONLY, CREATE_OR_OPEN, MUST_CREATE} |
| enum class | TimeSyncStrategy { NONE = 0, SHIFT_TIMESTAMPS_FWD = 1 « 0, SHIFT_TIMESTAMPS_BWD = 1 « 1, ADJUST_CLOCK = 1 « 2, WRITE_TSYNCFILE = 1 « 3} The time synchronization strategy. |
| enum class | TSyncFileMode { CONTINUOUS = 0, SYNCPOINTS = 1} Timepoint storage of a TSync file. |
| enum class | TSyncFileTimeUnit { INDEX = 0, NANOSECONDS = 1, MICROSECONDS = 2, MILLISECONDS = 3, SECONDS = 4} Unit types for time representation in a TSync file. |
| enum class | TSyncFileDataType { INVALID = 0, INT16 = 2, INT32 = 3, INT64 = 4, UINT16 = 6, UINT32 = 7, UINT64 = 8} Data types use for storing time values in the data file. |
| enum class uint8_t | MetaTypeTag { Null = 0, BoolFalse = 1, BoolTrue = 2, Int64 = 3, Double = 4, String = 5, Size = 6, Array = 7, Object = 8} Type tag used in MetaValue binary serialization. |
| enum class | SysInfoCheckResult { UNKNOWN, OK, SUSPICIOUS, ISSUE} |
| enum class | ColorMode { SYSTEM, BRIGHT, DARK} |
| enum class | SoundCue { RunStarted, RunFinishedSuccess, RunFinishedFailure, ResourceWarning, ModuleFailed} Sound cues that can be played to alert the experimenter. |
| enum class | ModuleWorkerMode { PERSISTENT, TRANSIENT} Worker mode for out-of-process modules. |
| enum class uint8_t | PortAction { UNKNOWN, ADD, REMOVE, CHANGE} Action performed to modify a module port. |
| enum class | ConnectionHeatLevel { NONE, LOW, MEDIUM, HIGH} Connection heat level. |
| enum class | ModuleFeature { NONE = 0, SHOW_SETTINGS = 1 « 0, SHOW_DISPLAY = 1 « 1, REALTIME = 1 « 2, CALL_UI_EVENTS = 1 « 3, REQUEST_CPU_AFFINITY = 1 « 4, PROHIBIT_CPU_AFFINITY = 1 |
| « 5} The ModuleFeature flags List of basic features this module may or may not support, or may request from the engine to be available. | |
| enum class | ModuleDriverKind { NONE, THREAD_DEDICATED, EVENTS_DEDICATED, EVENTS_SHARED} The ModuleDriverKind enum. |
| enum class | UsbHotplugEventKind { NONE, DEVICE_ARRIVED, DEVICE_LEFT, DEVICES_CHANGE} The UsbHotplugEventKind enum. |
| enum class uint32_t | ModuleCategory { NONE = 0, SYNTALOS_DEV = 1 « 0, EXAMPLES = 1 « 1, DEVICES = 1 « 2, GENERATORS = 1 « 3, SCRIPTING = 1 « 4, DISPLAY = 1 « 5, WRITERS = 1 « 6, PROCESSING = 1 « 7} Categorization for modules. |
| enum class | ModuleModifier { NONE = 0, ENABLED = 1 « 0, STOP_ON_FAILURE = 1 « 1} The ModuleModifier flags Flags set by Syntalos or the user to modify the behavior of the module in the wider context of the running experiment. |
| enum class | PortDirection { NONE, INPUT, OUTPUT} Enum specifying directionality of a port (in or out). |
| enum class | PyVirtualEnvStatus { VALID, MISSING, REQUIREMENTS_CHANGED, INTERPRETER_MISSING} |
| using Flags< LineModeFlag > | LineModeFlags |
| using std::tuple< SignalBlockI16, SignalBlockU16, SignalBlockI32, SignalBlockF32 > | SignalBlockTypeList Compile-time list of all SignalBlock* types. |
| using decltype(std::tuple_cat( std::declval< std::tuple< ControlCommand, TableRow, Frame, LineCommand, LineReading > >(), std::declval< SignalBlockTypeList >())) | StreamTypeList Compile-time list of all stream data types. |
| template <SignalBlockType T> using typename std::remove_cvref_t< decltype(std::declval< T >().data)>::Scalar | signal_block_scalar_t Scalar element type of a SignalBlock* type. |
| typedef std::chrono::zoned_time< std::chrono::system_clock::duration > | EdlDateTime |
| using std::chrono::time_point< symaster_clock > | symaster_timepoint A timepoint on the master clock. |
| using std::chrono::seconds | seconds_t Shorthand for seconds. |
| using std::chrono::milliseconds | milliseconds_t Shorthand for milliseconds. |
| using std::chrono::duration< int64_t, std::micro > | microseconds_t Shorthand for microseconds. |
| using std::chrono::duration< int64_t, std::nano > | nanoseconds_t Shorthand for nanoseconds. |
| typedef Eigen::Matrix< int32_t, Eigen::Dynamic, 1 > | VectorXi32 |
| typedef Eigen::Matrix< int64_t, Eigen::Dynamic, 1 > | VectorXi64 |
| typedef Eigen::Matrix< int16_t, Eigen::Dynamic, 1 > | VectorXi16 |
| typedef Eigen::Matrix< uint16_t, Eigen::Dynamic, 1 > | VectorXu16 |
| typedef Eigen::Matrix< uint64_t, Eigen::Dynamic, 1 > | VectorXu64 |
| typedef Eigen::Matrix< float, Eigen::Dynamic, 1 > | VectorXf |
| typedef Eigen::Matrix< double, Eigen::Dynamic, 1 > | VectorXd |
| typedef Eigen::Matrix< int32_t, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > | MatrixXi32 |
| typedef Eigen::Matrix< int16_t, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > | MatrixXi16 |
| typedef Eigen::Matrix< uint16_t, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > | MatrixXu16 |
| typedef Eigen::Matrix< float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > | MatrixXf |
| typedef Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > | MatrixXd |
| using Flags< TimeSyncStrategy > | TimeSyncStrategies |
| using std::function< void(const std::string &id, const TimeSyncStrategies &strategies, const microseconds_t &tolerance)> | SyncDetailsChangeNotifyFn Function to call when synchronizer details have changed. |
| using std::function< void(const std::string &id, const microseconds_t ¤tOffset)> | OffsetChangeNotifyFn Function to call to notify about an offset change. |
| using std::pmr::vector< std::byte > | ByteVector ByteVector is a vector of bytes using the polymorphic allocator. |
| using quill::Logger | QuillLogger |
| using std::function< void(int &)> | WorkerTimedEventFn Callable type for timed worker events, the argument is the interval in milliseconds. |
| using std::function< void()> | WorkerDataEventFn Callable type for worker events that fire when a subscription has new data. |
| using std::function< void(const std::string &script, const fs::path &wdir)> | LoadScriptFn |
| using std::function< bool(ByteVector &settings, const fs::path &baseDir)> | SaveSettingsFn |
| using std::function< bool(const ByteVector &settings, const fs::path &baseDir)> | LoadSettingsFn |
| using std::function< bool()> | PrepareRunFn |
| using std::function< void()> | StartFn |
| using std::function< void()> | StopFn |
| using std::function< void()> | ShutdownFn |
| using std::function< void(const void *data, size_t size)> | NewDataRawFn |
| using std::function< void(BaseDataType &data)> | NewDataFn |
| using std::function< void(void)> | ShowSettingsFn |
| using std::function< void(void)> | ShowDisplayFn |
| using std::function< void(const std::string &name)> | ModuleNameChangedFn |
Functions
| Name | |
|---|---|
| std::string | toString(ModuleState state) |
| void | registerStreamMetaTypes() Helper function to register all meta types for stream data. |
| std::vector< std::pair< std::string, int > > | streamTypeIdIndex() Get a mapping of type names to their IDs. |
| template <typename T > int | syDataTypeId() Helper function to get the type ID of a data type. |
| template <typename T > T | deserializeFromMemory(const void * memory, size_t size) Convenience function to deserialize a data type from memory. |
| template <typename List ,typename Fn > bool | forEachTypeIn(Fn && fn) Call fn(std::type_identity<T>{}) for every T in the type list List. |
| template <typename Fn > bool | forEachStreamType(Fn && fn) Call fn(std::type_identity<T>{}) for every T in StreamTypeList. |
| template <typename Fn > bool | forEachSignalBlockType(Fn && fn) Call fn(std::type_identity<T>{}) for every T in SignalBlockTypeList. |
| template <typename List ,typename Fn > bool | withTypeIn(int typeId, Fn && fn) Call fn(std::type_identity<T>{}) for the type in List with the given ID. |
| template <typename List ,typename Fn > bool | visitDataIn(BaseDataType & data, Fn && fn) Call fn(static_cast<T &>(data)) with the concrete type of data, if it is in List. |
| template <typename Fn > bool | withSignalBlockType(int typeId, Fn && fn) Call fn(std::type_identity<T>{}) for the signal block type with the given ID. |
| template <typename Fn > bool | visitSignalBlock(BaseDataType & data, Fn && fn) Call fn(static_cast<T &>(data)) if data is a signal block, with T its concrete type. |
| template <typename Scalar > std::string | scalarTypeName(bool abbreviated =false) Human-readable name of an arithmetic scalar type, e.g. “Int16”, “UInt16”, “Float32”. |
| template <typename T > std::string | numToString(T x) Convert a numeric value to a string using Syntalos’ default notation. |
| void | matEnsureExclusive(cv::Mat & mat, int rows, int cols, int type) Make mat an exclusively owned matrix of the given shape. |
| EdlDateTime | edlCurrentDateTime() |
| std::string | makeAnimalMoniker() |
| std::string | makeAnimalMonikerForString(const std::string & source) |
| std::string | makeMonikerForUuid(const Uuid & uuid) |
| std::string | makeMonikerForString(const std::string & source) |
| std::ostream & | operator«(std::ostream & os, const MetaSize & sz) |
| std::ostream & | operator«(std::ostream & os, const MetaArray & arr) |
| std::ostream & | operator«(std::ostream & os, const MetaValue & v) |
| std::ostream & | operator«(std::ostream & os, const MetaStringMap & map) |
| void | writeJson(std::ostream & os, const MetaValue & val) Write a MetaValue as JSON to the given stream (RFC-8259, compact). |
| void | writeJsonObject(std::ostream & os, const std::map< std::string, MetaValue > & obj) Write a MetaValue map as a JSON object to the given stream. |
| std::string | toJsonString(const MetaValue & v) |
| std::string | toJsonObjectString(const MetaStringMap & m) |
| std::expected< MetaStringMap, std::string > | stringMapFromJson(const std::string & json) |
| std::string | makeAnimalMonikerFromRng(std::mt19937_64 & rng) |
| std::string | makeMonikerFromSeed(uint64_t seed) |
| Uuid | newUuid7() Generate a Version 7 UUID (UUIDv7) based on a timestamp and random data. |
| void | writeJsonString(std::ostream & os, const std::string & s) |
| auto | usecToMsec(const microseconds_t & usec) Convert microseconds to milliseconds. |
| auto | msecToUsec(const milliseconds_t & msec) Convert milliseconds microseconds. |
| auto | nsecToUsec(const nanoseconds_t & msec) Convert nanoseconds microseconds. |
| auto | timeDiffSec(const symaster_timepoint & timePoint1, const symaster_timepoint & timePoint2) |
| auto | timeDiffMsec(const symaster_timepoint & timePoint1, const symaster_timepoint & timePoint2) |
| auto | timeDiffUsec(const symaster_timepoint & timePoint1, const symaster_timepoint & timePoint2) |
| auto | timeDiffToNowMsec(const std::chrono::time_point< symaster_clock > & timePoint) |
| auto | timeDiffToNowUsec(const std::chrono::time_point< symaster_clock > & timePoint) |
| symaster_timepoint | currentTimePoint() |
| template <typename T > double | vectorMedian(const Eigen::Matrix< T, Eigen::Dynamic, 1 > & vec) |
| template <typename T > double | vectorMedianInplace(Eigen::Matrix< T, Eigen::Dynamic, 1 > & vec) |
| template <typename T > double | vectorVariance(const Eigen::Matrix< T, Eigen::Dynamic, 1 > & vec, const double & mean, bool unbiased =true) |
| template <typename T > double | vectorVariance(const Eigen::Matrix< T, Eigen::Dynamic, 1 > & vec, bool unbiased =true) |
| template <typename EigenType > void | serializeEigen(BinaryStreamWriter & stream, const EigenType & matrix) |
| template <typename EigenType > ssize_t | serializedEigenSize(const EigenType & matrix) |
| template <typename TsType ,typename DataType > bool | writeEigenPairToMemory(void * memory, ssize_t size, const TsType & timestamps, const DataType & data) |
| template <typename EigenType > EigenType | deserializeEigen(BinaryStreamReader & stream) |
| const std::string | timeSyncStrategyToHString(const TimeSyncStrategy & strategy) |
| const std::string | timeSyncStrategiesToHString(const TimeSyncStrategies & strategies) |
| template <typename T > void | safeStopSynchronizer(const T & synchronizerSmartPtr) |
| template <typename T > void | safeStopSynchronizer(const T & synchronizer, const microseconds_t & lastValidMasterTimestamp) |
| std::string | tsyncFileTimeUnitToString(const TSyncFileTimeUnit & tsftunit) |
| std::string | tsyncFileDataTypeToString(const TSyncFileDataType & dtype) |
| std::string | tsyncFileModeToString(const TSyncFileMode & mode) |
| std::optional< QImage > | cvMatToQImage(const cv::Mat & mat) Converts an OpenCV Mat to a QImage. |
| std::optional< QPixmap > | cvMatToQPixmap(const cv::Mat & mat) |
| cv::Rect | qRectToCvRect(const QRect & r) |
| template <typename E ,typename =std::enable_if_t<std::is_scoped_enum_v Flags< E > | **[operator |
| QString | shellQuote(const QString & str) Shell-escape a string. |
| QString | findHostExecutable(const QString & exe) Find executable on the host system (if running in a sandbox). |
| int | runHostExecutable(const QString & exe, const QStringList & args, bool waitForFinished) Run command on the host. |
| QString | findToolExecutable(const QString & buildTreeRelPath, const QString & installedPath) Find one of Syntalos’ own helper executables. |
| int | runInTerminal(const QString & cmd, const QStringList & args, const QString & wdir, const QString & title) |
| bool | launchProgramNC3Fallback(const QString & exePath, int * pidfd_out) |
| bool | launchProgramPidFd(const QString & exePath, int * pidfd_out) Launch a program in a new process, and return the PID of the new process as pidfd. |
| bool | isProcessRunning(int pidfd) Check if a process is still running using a pidfd. |
| quill::Logger * | getLogger(const std::string & name) |
| quill::Logger * | getLogger(const QString & name) |
| quill::Logger * | getLogger(const char * name) |
| quill::Logger * | logModTmp(const char * name) |
| quill::Logger * | getDefaultLogger() |
| void | removeLogger(quill::Logger * logger) |
| void | initializeSyLogSystem(quill::LogLevel consoleLogLevel =quill::LogLevel::Info, const QString & logDir =QString(), const QString & logName =QStringLiteral(“syntalos”)) |
| QString | currentLogFilePath() |
| QString | currentLogDir() |
| void | shutdownSyLogSystem() |
| const QString & | qstr(const QString & s) |
| QString | qstr(QStringView s) |
| QString | qstr(const char * s) |
| QString | qstr(std::string_view s) |
| QString | qstr(const std::string & s) |
| QString | createRandomString(int len) Create a random alphanumeric string with the given length. |
| QString | simplifyStrForModuleName(const QString & s) Simplify a string for use as a module name. |
| QString | simplifyStrForFileBasename(const QString & s, bool lowerCase =true, uint maxLen =60) Simplify a string for use in file basenames. |
| std::string | simplifyStrForFileBasename(const std::string & s, bool lowerCase =true, uint maxLen =60) |
| QStringList | qStringSplitLimit(const QString & str, const QChar & sep, int maxSplit, Qt::CaseSensitivity cs =Qt::CaseSensitive) Split a string, limiting the amount of splits made. |
| QString | syntalosVersionFull() Return the complete current Syntalos version number. |
| QString | syntalosVersion() Return just the project version (without VCS information). |
| bool | isInFlatpakSandbox() Check if Syntalos is running in a Flatpak sandbox. |
| QString | appDataRootDir() Get the root directory for Syntalos user data (modules, venv, cache, logs). |
| QString | tempDirRoot() Get path to the OSes default temporary directory. |
| QString | tempDirLargeRoot() Get path to a temporary directory that can hold large files. |
| bool | isTemporaryPath(const QString & path) Check whether a path is located in a temporary or cache directory. |
| QString | findHostFile(const QString & path) Find file on the host system (if running in a sandbox). |
| bool | hostUdevRuleExists(const QString & ruleFilename) Check if a udev rule exists. |
| bool | isBinaryInPath(const QString & binaryName) Check if a binary is in the current environment PATH. |
| void | delay(int waitMsec) Delay execution by approximately the given time, not blocking the main event loop. |
| QByteArray | blake3HashForData(const QByteArray & data) Calculate the BLAKE3 hash for the given data. |
| std::expected< QByteArray, QString > | blake3HashForFile(const QString & filename) Calculate the BLAKE3 hash for the given file. |
| QString | formatByteSize(qint64 bytes) |
| QString | formatApproxDuration(double seconds) |
| QString | colorModeToString(ColorMode mode) |
| ColorMode | colorModeFromString(const QString & str) |
| QString | soundCueId(SoundCue cue) Stable identifier of a sound cue, used as settings key and sound file name. |
| QString | soundCueDisplayName(SoundCue cue) Human-readable name of a sound cue. |
| void | findSyntalosLibraryPaths(QString & pkgConfigPath, QString & ldLibraryPath, QString & includePath) |
| QStringList | findSyntalosMlinkPyModulePaths() |
| void | datactlLogHandler(const datactl::LogMessage & m) |
| void | qtLogHandler(QtMsgType type, const QMessageLogContext & ctx, const QString & msg) |
| GLogWriterOutput | glibLogWriter(GLogLevelFlags log_level, const GLogField * fields, gsize n_fields, gpointer ) |
| void | setupLogFileSink(const QString & logDir, const QString & logName) |
| IpcServiceTopology | makeIpcServiceTopology(uint senderCount, uint receiverCount) |
| QString | connectionHeatToHumanString(ConnectionHeatLevel heat) |
| QString | driverKindToString(ModuleDriverKind kind) |
| QString | toString(ModuleCategory category) |
| ModuleCategory | moduleCategoryFromString(const QString & categoryStr) |
| ModuleCategories | moduleCategoriesFromVariant(const QVariant & value) |
| uint | qHash(ModuleModifier key, uint seed) |
| VariantDataStream * | newStreamForType(int typeId) Create a new DataStream for the type identified by the given ID. |
| VarStreamInputPort * | newInputPortForType(int typeId, AbstractModule * mod, const QString & id, const QString & title) Create a new Input Port for the type identified by the given ID. |
| QString | pythonVEnvDirForName(const QString & venvName) |
| bool | pythonVirtualEnvExists(const QString & venvName) |
| QString | requirementsHashMetadataPath(const QString & venvDir) |
| bool | writeRequirementsHashMetadata(const QString & venvDir, const QByteArray & requirementsHash) |
| bool | readRequirementsHashMetadata(const QString & venvDir, QString & requirementsHashOut) |
| QString | interpreterPathFromCfg(const QString & venvDir) |
| PyVirtualEnvStatus | pythonVirtualEnvStatus(const QString & venvName, const QString & requirementsFile) |
| void | injectSyntalosMlinkIntoVenv(const QString & venvDir) |
| std::expected< QString, QString > | createPythonVirtualEnv(const QString & venvName, const QString & requirementsFile, bool recreate) |
| MemInfo | readMemInfo() |
| MemPressure | readMemPressure() |
| DiskSpaceInfo | diskSpaceInfo(const QString & path) Query the free space of the filesystem that path is located on. |
| qint64 | directoryTotalSize(const QString & path) |
| std::optional< ThreadUsageStats > | captureCurrentThreadUsage() Capture the resource usage of the calling thread. |
| std::optional< ThreadUsageStats > | captureProcessUsage() Capture the resource usage of the whole current process. |
| std::optional< ThreadUsageStats > | readProcessUsage(qint64 pid) Read the accumulated resource usage of another process (and its descendants) from procfs. |
| qint64 | readProcessTreeRssKiB(qint64 pid) Current resident memory of a process and all of its descendants, in KiB. |
| std::expected< std::pair< uint64_t, uint64_t >, std::string > | raiseFdLimit() Raise the soft limit for file descriptors of this process to its hard limit. |
| qint64 | readProcessTreePssKiB(qint64 pid) Proportional memory of a process and all of its descendants, in KiB. |
| std::optional< ProcessSchedInfo > | readProcessSchedInfo(qint64 pid) Read the scheduling priority of another process (and its descendants) from procfs. |
| template <typename T > T | streamDataFromRawMemory(const void * data, size_t size) Convert raw received bytes into their data type. |
| std::unique_ptr< SyntalosLink > | initSyntalosModuleLink(const ModuleInitOptions & optn ={}) |
| std::expected< fs::path, std::string > | moduleCacheDir(bool create =true) Get the persistent cache directory for a module. |
| std::expected< fs::path, std::string > | moduleDataDir() Get the directory the module is installed in / run from. |
| void | termSignalHandler(int signum) |
| bool | installHandler(int signum) |
| bool | isFileOnTmpfs(const QString & fname) |
| QString | canonicalPathLenient(const QString & path) |
| long long | get_entry(const char * name, const char * buf) |
| long long | get_entry_fatal(const char * name, const char * buf) |
| long long | available_guesstimate(const char * buf) |
| double | timevalToSec(const struct timeval & tv) |
| ThreadUsageStats | usageFromRusage(const struct rusage & ru, int64_t id) |
| QList< QByteArray > | readProcStatFields(const QString & path) |
| QStringList | readProcessTaskIds(qint64 pid) |
| std::optional< ThreadUsageStats > | readSingleProcessUsage(qint64 pid) |
| QList< qint64 > | readChildProcesses(qint64 pid) |
| QList< qint64 > | readProcessTree(qint64 pid) |
| qint64 | readProcessRssKiB(qint64 pid) |
| qint64 | readProcessPssKiB(qint64 pid) |
| SY_DEFINE_LOG_CATEGORY(logSyLink , “sylink” ) | |
| template <typename Sub > std::remove_cvref_t< decltype(sub.receive().value())> | safeReceive(Sub & sub) |
| std::string | getenvSafe(const char * name) |
| void | resolveTypedNewDataCallback(InputPortInfo * iport) |
| SY_DEFINE_LOG_CATEGORY(logIpc , “ipc” ) | |
| void | ipcLogMessageDispatch(datactl::LogSeverity severity, const std::string & msg) |
| std::string | edlRelPath(const EDLGroup & root, const EDLGroup & target) |
| SY_DEFINE_LOG_CATEGORY(logLinkMod , “sylm” ) | |
| KTextEditor::Editor * | kTextEditorInstance() Obtain the global KTextEditor instance. |
Attributes
Types Documentation
enum ModuleState
| Enumerator | Value | Description |
|---|---|---|
| UNKNOWN | ||
| INITIALIZING | Module is in an unknown state. | |
| IDLE | Module is initializing after being added. | |
| PREPARING | Module is inactive and not started. | |
| DORMANT | Module is preparing a run. | |
| READY | The module is inactive for this run, as it has no work to do. | |
| RUNNING | Everything is prepared, we are ready to start. | |
| ERROR | Module is running. Module failed to run / is in an error state |
The ModuleState enum.
Describes the state a module can be in. The state is usually displayed to the user via a module indicator widget.
enum ControlCommandKind
| Enumerator | Value | Description |
|---|---|---|
| UNKNOWN | ||
| START | ||
| PAUSE | Start an operation. | |
| STOP | Pause an operation, can be resumed with START. | |
| STEP | Stop an operation. | |
| CUSTOM | Advance operation by one step. |
The ControlCommandKind enum.
Basic operations to control a module from another module.
enum LineCommandKind
| Enumerator | Value | Description |
|---|---|---|
| UNKNOWN | ||
| SET_MODE | ||
| WRITE_DIGITAL | Configure line direction / mode. | |
| WRITE_ANALOG | Set a digital line to a value (0/1). | |
| WRITE_DIGITAL_PULSE | Set an analog line to a value. | |
| WRITE_ANALOG_PULSE | Pulse a digital line for duration (value = level during pulse). | |
| CUSTOM | Drive an analog line at value for duration (for stim devices). Arbitrary device-defined payload carried in extra |
The LineCommandKind enum.
Type of operation requested on a hardware signal line / channel / pin.
enum LineModeFlag
| Enumerator | Value | Description |
|---|---|---|
| NONE | 0 | |
| IS_INPUT | 1u « 0 | |
| IS_OUTPUT | 1u « 1 | Line is an input. |
| PULL_UP | 1u « 2 | Line is an output. |
| PULL_DOWN | 1u « 3 | Input pull-up enabled (inputs only). |
| ANALOG | 1u « 4 | Input pull-down enabled (inputs only). |
Individual mode bits for LineCommandKind::SetMode.
Composable bit flags describing how a line should be configured. Only meaningful for SetMode; ignored for other command kinds.
enum SignalDataType
| Enumerator | Value | Description |
|---|---|---|
| Amplifier | ||
| AuxInput | ||
| SupplyVoltage | ||
| BoardAdc | ||
| BoardDigIn | ||
| BoardDigOut |
Type of a signal from a signal source.
This is usually set in the metadata of a data stream.
enum EDLUnitKind
| Enumerator | Value | Description |
|---|---|---|
| UNKNOWN | ||
| COLLECTION | ||
| GROUP | ||
| DATASET |
Type of an EDL unit.
enum EDLCreateFlag
| Enumerator | Value | Description |
|---|---|---|
| OPEN_ONLY | ||
| CREATE_OR_OPEN | Unit will only be opened, never created. | |
| MUST_CREATE | Unit will be opened if it exists, and created otherwise. Unit must be created, it is an error if it already exists |
Flag to influence how EDL units are loaded.
enum TimeSyncStrategy
| Enumerator | Value | Description |
|---|---|---|
| NONE | 0 | |
| SHIFT_TIMESTAMPS_FWD | 1 « 0 | |
| SHIFT_TIMESTAMPS_BWD | 1 « 1 | Move timestamps forward to match the master clock. |
| ADJUST_CLOCK | 1 « 2 | Move timestamps backward to match the master clock. |
| WRITE_TSYNCFILE | 1 « 3 | Do not change timestamps by adjust the secondary clocks to match the master clock. |
The time synchronization strategy.
enum TSyncFileMode
| Enumerator | Value | Description |
|---|---|---|
| CONTINUOUS | 0 | |
| SYNCPOINTS | 1 | Continuous time-point mapping with no gaps. |
Timepoint storage of a TSync file.
enum TSyncFileTimeUnit
| Enumerator | Value | Description |
|---|---|---|
| INDEX | 0 | |
| NANOSECONDS | 1 | monotonically increasing counter without dimension |
| MICROSECONDS | 2 | |
| MILLISECONDS | 3 | |
| SECONDS | 4 |
Unit types for time representation in a TSync file.
enum TSyncFileDataType
| Enumerator | Value | Description |
|---|---|---|
| INVALID | 0 | |
| INT16 | 2 | |
| INT32 | 3 | |
| INT64 | 4 | |
| UINT16 | 6 | |
| UINT32 | 7 | |
| UINT64 | 8 |
Data types use for storing time values in the data file.
enum MetaTypeTag
| Enumerator | Value | Description |
|---|---|---|
| Null | 0 | |
| BoolFalse | 1 | |
| BoolTrue | 2 | |
| Int64 | 3 | |
| Double | 4 | |
| String | 5 | |
| Size | 6 | |
| Array | 7 | |
| Object | 8 |
Type tag used in MetaValue binary serialization.
enum SysInfoCheckResult
| Enumerator | Value | Description |
|---|---|---|
| UNKNOWN | ||
| OK | We don’t know. | |
| SUSPICIOUS | We’re good. | |
| ISSUE | Something might be off and is not ideal for some experiments. Something is really wrong and should be fixed. |
enum ColorMode
| Enumerator | Value | Description |
|---|---|---|
| SYSTEM | ||
| BRIGHT | ||
| DARK |
enum SoundCue
| Enumerator | Value | Description |
|---|---|---|
| RunStarted | ||
| RunFinishedSuccess | ||
| RunFinishedFailure | ||
| ResourceWarning | ||
| ModuleFailed |
Sound cues that can be played to alert the experimenter.
enum ModuleWorkerMode
| Enumerator | Value | Description |
|---|---|---|
| PERSISTENT | ||
| TRANSIENT | Worker is started once, and runs while the module is present on the board. Worker run only for the duration of the experiment, and terminated afterwards |
Worker mode for out-of-process modules.
enum PortAction
| Enumerator | Value | Description |
|---|---|---|
| UNKNOWN | ||
| ADD | Undefined action. | |
| REMOVE | Add a new port. | |
| CHANGE | Remove an existing port. Change an existing port |
Action performed to modify a module port.
enum ConnectionHeatLevel
| Enumerator | Value | Description |
|---|---|---|
| NONE | ||
| LOW | ||
| MEDIUM | ||
| HIGH |
Connection heat level.
Warning level dependent on how full the buffer that is represented by a connection is. A high heat means lots of pending stuff and potentially a slow receiving module or not enough system resources. This state is managed internally by Syntalos.
enum ModuleFeature
| Enumerator | Value | Description |
|---|---|---|
| NONE | 0 | |
| SHOW_SETTINGS | 1 « 0 | |
| SHOW_DISPLAY | 1 « 1 | Module can display a settings window. |
| REALTIME | 1 « 2 | Module has one or more display window(s) to show. |
| CALL_UI_EVENTS | 1 « 3 | Enable realtime scheduling for the module’s thread. |
| REQUEST_CPU_AFFINITY | 1 « 4 | Call direct UI events processing method. |
| PROHIBIT_CPU_AFFINITY | 1 | |
| « 5 | Pin the module’s thread to a separate CPU core, if possible (even if the user disabled this) |
The ModuleFeature flags List of basic features this module may or may not support, or may request from the engine to be available.
enum ModuleDriverKind
| Enumerator | Value | Description |
|---|---|---|
| NONE | ||
| THREAD_DEDICATED | Module will be run in the main (GUI) thread. | |
| EVENTS_DEDICATED | The module’s worker runs in a dedicated thread. | |
| EVENTS_SHARED | The module’s worker shares a thread(pool) with other modules of its kind, via an event loop. The module’s worker shares a thread(pool) with arbitrary other modules, via an event loop |
The ModuleDriverKind enum.
enum UsbHotplugEventKind
| Enumerator | Value | Description |
|---|---|---|
| NONE | ||
| DEVICE_ARRIVED | No USB hotplug event. | |
| DEVICE_LEFT | A new device appeared. | |
| DEVICES_CHANGE | A device has left. Devices have appeared and left |
The UsbHotplugEventKind enum.
enum ModuleCategory
| Enumerator | Value | Description |
|---|---|---|
| NONE | 0 | |
| SYNTALOS_DEV | 1 « 0 | Not categorized. |
| EXAMPLES | 1 « 1 | A development/test tool for Syntalos itself. |
| DEVICES | 1 « 2 | An example / template module. |
| GENERATORS | 1 « 3 | Modules which communicate with hardware devices. |
| SCRIPTING | 1 « 4 | (Test)data generators |
| DISPLAY | 1 « 5 | Scripting & customization. |
| WRITERS | 1 « 6 | Display modules. |
| PROCESSING | 1 « 7 | Modules which write data to disk. |
Categorization for modules.
enum ModuleModifier
| Enumerator | Value | Description |
|---|---|---|
| NONE | 0 | |
| ENABLED | 1 « 0 | |
| STOP_ON_FAILURE | 1 « 1 | The module is enabled. |
The ModuleModifier flags Flags set by Syntalos or the user to modify the behavior of the module in the wider context of the running experiment.
enum PortDirection
| Enumerator | Value | Description |
|---|---|---|
| NONE | ||
| INPUT | ||
| OUTPUT |
Enum specifying directionality of a port (in or out).
enum PyVirtualEnvStatus
| Enumerator | Value | Description |
|---|---|---|
| VALID | ||
| MISSING | ||
| REQUIREMENTS_CHANGED | ||
| INTERPRETER_MISSING |
using LineModeFlags
using Syntalos::LineModeFlags = Flags<LineModeFlag>;using SignalBlockTypeList
using Syntalos::SignalBlockTypeList = std::tuple<SignalBlockI16, SignalBlockU16, SignalBlockI32, SignalBlockF32>;Compile-time list of all SignalBlock* types.
Append a new signal block type here when adding it to the TypeId enum. Code that works on signal blocks generically (writers, filters, type selectors) iterates this list, so it needs no per-type changes.
using StreamTypeList
using Syntalos::StreamTypeList = decltype(std::tuple_cat(
std::declval<std::tuple<ControlCommand, TableRow, Frame, LineCommand, LineReading>>(),
std::declval<SignalBlockTypeList>()));Compile-time list of all stream data types.
Append a new (non-signal-block) type here when adding it to the TypeId enum. Note that this list contains Frame, which is only forward-declared in this header: code instantiating templates over the full list must also include [datactl/frametype.h].
using signal_block_scalar_t
template <SignalBlockType T>
using Syntalos::signal_block_scalar_t = typename std::remove_cvref_t<decltype(std::declval<T>().data)>::Scalar;Scalar element type of a SignalBlock* type.
typedef EdlDateTime
typedef std::chrono::zoned_time< std::chrono::system_clock::duration > Syntalos::EdlDateTime = std::chrono::zoned_time<std::chrono::system_clock::duration>;using symaster_timepoint
using Syntalos::symaster_timepoint = std::chrono::time_point<symaster_clock>;A timepoint on the master clock.
using seconds_t
using Syntalos::seconds_t = std::chrono::seconds;Shorthand for seconds.
using milliseconds_t
using Syntalos::milliseconds_t = std::chrono::milliseconds;Shorthand for milliseconds.
using microseconds_t
using Syntalos::microseconds_t = std::chrono::duration<int64_t, std::micro>;Shorthand for microseconds.
using nanoseconds_t
using Syntalos::nanoseconds_t = std::chrono::duration<int64_t, std::nano>;Shorthand for nanoseconds.
typedef VectorXi32
typedef Eigen::Matrix<int32_t, Eigen::Dynamic, 1> Syntalos::VectorXi32;typedef VectorXi64
typedef Eigen::Matrix<int64_t, Eigen::Dynamic, 1> Syntalos::VectorXi64;typedef VectorXi16
typedef Eigen::Matrix<int16_t, Eigen::Dynamic, 1> Syntalos::VectorXi16;typedef VectorXu16
typedef Eigen::Matrix<uint16_t, Eigen::Dynamic, 1> Syntalos::VectorXu16;typedef VectorXu64
typedef Eigen::Matrix<uint64_t, Eigen::Dynamic, 1> Syntalos::VectorXu64;typedef VectorXf
typedef Eigen::Matrix<float, Eigen::Dynamic, 1> Syntalos::VectorXf;typedef VectorXd
typedef Eigen::Matrix<double, Eigen::Dynamic, 1> Syntalos::VectorXd;typedef MatrixXi32
typedef Eigen::Matrix<int32_t, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> Syntalos::MatrixXi32;typedef MatrixXi16
typedef Eigen::Matrix<int16_t, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> Syntalos::MatrixXi16;typedef MatrixXu16
typedef Eigen::Matrix<uint16_t, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> Syntalos::MatrixXu16;typedef MatrixXf
typedef Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> Syntalos::MatrixXf;typedef MatrixXd
typedef Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> Syntalos::MatrixXd;using TimeSyncStrategies
using Syntalos::TimeSyncStrategies = Flags<TimeSyncStrategy>;using SyncDetailsChangeNotifyFn
using Syntalos::SyncDetailsChangeNotifyFn = std::function<
void(const std::string &id, const TimeSyncStrategies &strategies, const microseconds_t &tolerance)>;Function to call when synchronizer details have changed.
using OffsetChangeNotifyFn
using Syntalos::OffsetChangeNotifyFn = std::function<void(const std::string &id, const microseconds_t ¤tOffset)>;Function to call to notify about an offset change.
using ByteVector
using Syntalos::ByteVector = std::pmr::vector<std::byte>;ByteVector is a vector of bytes using the polymorphic allocator.
In Syntalos’ heavily threaded environment, where in the worst case a ton of these vectors may be created and destroyed in quick succession, the default glibc allocator is less than optimal. Mimalloc has shown to perform a lot better for this burst-like, threaded activity, therefore we prefer it. Please try to reuse buffers whenever possible though - while mimalloc is a significant improvement, reusing memory segments is even better.
We do use the C++ polymorphic allocator since datactl is used in places where swapping the allocator is undesirable, e.g. in mlink that may be linked into non-Syntalos processes. These processes may use the default allocator instead of Syntalos’ mimalloc-based one.
using QuillLogger
using Syntalos::QuillLogger = quill::Logger;using WorkerTimedEventFn
using Syntalos::WorkerTimedEventFn = std::function<void(int &)>;Callable type for timed worker events, the argument is the interval in milliseconds.
using WorkerDataEventFn
using Syntalos::WorkerDataEventFn = std::function<void()>;Callable type for worker events that fire when a subscription has new data.
using LoadScriptFn
using Syntalos::LoadScriptFn = std::function<void(const std::string &script, const fs::path &wdir)>;using SaveSettingsFn
using Syntalos::SaveSettingsFn = std::function<bool(ByteVector &settings, const fs::path &baseDir)>;using LoadSettingsFn
using Syntalos::LoadSettingsFn = std::function<bool(const ByteVector &settings, const fs::path &baseDir)>;using PrepareRunFn
using Syntalos::PrepareRunFn = std::function<bool()>;using StartFn
using Syntalos::StartFn = std::function<void()>;using StopFn
using Syntalos::StopFn = std::function<void()>;using ShutdownFn
using Syntalos::ShutdownFn = std::function<void()>;using NewDataRawFn
using Syntalos::NewDataRawFn = std::function<void(const void *data, size_t size)>;using NewDataFn
using Syntalos::NewDataFn = std::function<void(BaseDataType &data)>;using ShowSettingsFn
using Syntalos::ShowSettingsFn = std::function<void(void)>;using ShowDisplayFn
using Syntalos::ShowDisplayFn = std::function<void(void)>;using ModuleNameChangedFn
using Syntalos::ModuleNameChangedFn = std::function<void(const std::string &name)>;Functions Documentation
function toString
std::string toString(
ModuleState state
)function registerStreamMetaTypes
void registerStreamMetaTypes()Helper function to register all meta types for stream data.
This function registers all types with the meta object system and also creates a global map of all available stream types.
function streamTypeIdIndex
std::vector< std::pair< std::string, int > > streamTypeIdIndex()Get a mapping of type names to their IDs.
function syDataTypeId
template <typename T >
int syDataTypeId()Helper function to get the type ID of a data type.
function deserializeFromMemory
template <typename T >
T deserializeFromMemory(
const void * memory,
size_t size
)Convenience function to deserialize a data type from memory.
function forEachTypeIn
template <typename List ,
typename Fn >
bool forEachTypeIn(
Fn && fn
)Call fn(std::type_identity<T>{}) for every T in the type list List.
The lambda must return bool: true to stop iterating (typically “I found
what I was looking for”), false to keep going.
function forEachStreamType
template <typename Fn >
bool forEachStreamType(
Fn && fn
)Call fn(std::type_identity<T>{}) for every T in StreamTypeList.
function forEachSignalBlockType
template <typename Fn >
bool forEachSignalBlockType(
Fn && fn
)Call fn(std::type_identity<T>{}) for every T in SignalBlockTypeList.
function withTypeIn
template <typename List ,
typename Fn >
bool withTypeIn(
int typeId,
Fn && fn
)Call fn(std::type_identity<T>{}) for the type in List with the given ID.
Return: True if a type with this ID exists in the list (and fn was called), false otherwise.
function visitDataIn
template <typename List ,
typename Fn >
bool visitDataIn(
BaseDataType & data,
Fn && fn
)Call fn(static_cast<T &>(data)) with the concrete type of data, if it is in List.
Return: True if the type was found in the list (and fn was called), false otherwise.
This lets code that only holds a BaseDataType reference (e.g. obtained via VariantStreamSubscription::callIfNextVar) dispatch to a generic lambda.
function withSignalBlockType
template <typename Fn >
bool withSignalBlockType(
int typeId,
Fn && fn
)Call fn(std::type_identity<T>{}) for the signal block type with the given ID.
function visitSignalBlock
template <typename Fn >
bool visitSignalBlock(
BaseDataType & data,
Fn && fn
)Call fn(static_cast<T &>(data)) if data is a signal block, with T its concrete type.
Return: True if data was a signal block (and fn was called), false otherwise.
function scalarTypeName
template <typename Scalar >
inline std::string scalarTypeName(
bool abbreviated =false
)Human-readable name of an arithmetic scalar type, e.g. “Int16”, “UInt16”, “Float32”.
With abbreviated set, a short lowercase form is returned instead (“i16”, “u16”, “f32”), which is suitable for port IDs and similar identifiers.
function numToString
template <typename T >
inline std::string numToString(
T x
)Convert a numeric value to a string using Syntalos’ default notation.
This function converts arithmetic types to strings in a locale-independent way. For floating-point types, it uses the “general” format (shortest representation). Special values (NaN, infinity) are handled consistently across all types.
function matEnsureExclusive
inline void matEnsureExclusive(
cv::Mat & mat,
int rows,
int cols,
int type
)Make mat an exclusively owned matrix of the given shape.
Reuses the existing pixel buffer if it already has the requested dimensions and type and we are its sole owner, otherwise a fresh buffer is allocated. This keeps a steady-state producer from allocating once per frame, while staying safe when a consumer lags behind: if the refcount is greater than one, subscriber queues still hold shallow copies of the previously published frame, and overwriting the buffer in place would corrupt them. Assigning a new matrix drops our reference instead, so those queued copies stay valid until their owners are done with them.
Any producer that wants to recycle its output buffer must go through this. cv::Mat::create() alone is NOT sufficient: it keeps an existing buffer whenever the requested dimensions and type already match, no matter how many other references to it exist.
function edlCurrentDateTime
EdlDateTime edlCurrentDateTime()function makeAnimalMoniker
std::string makeAnimalMoniker()function makeAnimalMonikerForString
std::string makeAnimalMonikerForString(
const std::string & source
)function makeMonikerForUuid
std::string makeMonikerForUuid(
const Uuid & uuid
)function makeMonikerForString
std::string makeMonikerForString(
const std::string & source
)function operator«
inline std::ostream & operator<<(
std::ostream & os,
const MetaSize & sz
)function operator«
inline std::ostream & operator<<(
std::ostream & os,
const MetaArray & arr
)function operator«
inline std::ostream & operator<<(
std::ostream & os,
const MetaValue & v
)function operator«
inline std::ostream & operator<<(
std::ostream & os,
const MetaStringMap & map
)function writeJson
void writeJson(
std::ostream & os,
const MetaValue & val
)Write a MetaValue as JSON to the given stream (RFC-8259, compact).
function writeJsonObject
void writeJsonObject(
std::ostream & os,
const std::map< std::string, MetaValue > & obj
)Write a MetaValue map as a JSON object to the given stream.
function toJsonString
std::string toJsonString(
const MetaValue & v
)function toJsonObjectString
std::string toJsonObjectString(
const MetaStringMap & m
)function stringMapFromJson
std::expected< MetaStringMap, std::string > stringMapFromJson(
const std::string & json
)Rudimentary JSON object parser: handles {“key”: “str”} and {“key”: 123}
function makeAnimalMonikerFromRng
static std::string makeAnimalMonikerFromRng(
std::mt19937_64 & rng
)function makeMonikerFromSeed
static std::string makeMonikerFromSeed(
uint64_t seed
)function newUuid7
Uuid newUuid7()Generate a Version 7 UUID (UUIDv7) based on a timestamp and random data.
Return: A new UUIDv7.
The function generates a UUID conforming to Version 7 of the UUID format.
function writeJsonString
static void writeJsonString(
std::ostream & os,
const std::string & s
)function usecToMsec
inline auto usecToMsec(
const microseconds_t & usec
)Convert microseconds to milliseconds.
Shorthand for duration-case to increase code readability.
function msecToUsec
inline auto msecToUsec(
const milliseconds_t & msec
)Convert milliseconds microseconds.
Shorthand for duration-case to increase code readability.
function nsecToUsec
inline auto nsecToUsec(
const nanoseconds_t & msec
)Convert nanoseconds microseconds.
Shorthand for duration-case to increase code readability.
function timeDiffSec
inline auto timeDiffSec(
const symaster_timepoint & timePoint1,
const symaster_timepoint & timePoint2
)function timeDiffMsec
inline auto timeDiffMsec(
const symaster_timepoint & timePoint1,
const symaster_timepoint & timePoint2
)function timeDiffUsec
inline auto timeDiffUsec(
const symaster_timepoint & timePoint1,
const symaster_timepoint & timePoint2
)function timeDiffToNowMsec
inline auto timeDiffToNowMsec(
const std::chrono::time_point< symaster_clock > & timePoint
)function timeDiffToNowUsec
inline auto timeDiffToNowUsec(
const std::chrono::time_point< symaster_clock > & timePoint
)function currentTimePoint
inline symaster_timepoint currentTimePoint()function vectorMedian
template <typename T >
double vectorMedian(
const Eigen::Matrix< T, Eigen::Dynamic, 1 > & vec
)function vectorMedianInplace
template <typename T >
double vectorMedianInplace(
Eigen::Matrix< T, Eigen::Dynamic, 1 > & vec
)function vectorVariance
template <typename T >
double vectorVariance(
const Eigen::Matrix< T, Eigen::Dynamic, 1 > & vec,
const double & mean,
bool unbiased =true
)function vectorVariance
template <typename T >
double vectorVariance(
const Eigen::Matrix< T, Eigen::Dynamic, 1 > & vec,
bool unbiased =true
)function serializeEigen
template <typename EigenType >
void serializeEigen(
BinaryStreamWriter & stream,
const EigenType & matrix
)function serializedEigenSize
template <typename EigenType >
inline ssize_t serializedEigenSize(
const EigenType & matrix
)Exact number of bytes serializeEigen() writes for matrix: a uint64 row and col count, followed by row*col scalars. Used to size buffers in advance.
function writeEigenPairToMemory
template <typename TsType ,
typename DataType >
inline bool writeEigenPairToMemory(
void * memory,
ssize_t size,
const TsType & timestamps,
const DataType & data
)Serialize a (timestamps, data) matrix pair straight into a caller-provided memory block, using the identical wire format as serializeEigen(). When size is < 0 it is derived from the matrices. Returns true on success.
function deserializeEigen
template <typename EigenType >
EigenType deserializeEigen(
BinaryStreamReader & stream
)function timeSyncStrategyToHString
const std::string timeSyncStrategyToHString(
const TimeSyncStrategy & strategy
)function timeSyncStrategiesToHString
const std::string timeSyncStrategiesToHString(
const TimeSyncStrategies & strategies
)function safeStopSynchronizer
template <typename T >
void safeStopSynchronizer(
const T & synchronizerSmartPtr
)function safeStopSynchronizer
template <typename T >
void safeStopSynchronizer(
const T & synchronizer,
const microseconds_t & lastValidMasterTimestamp
)function tsyncFileTimeUnitToString
std::string tsyncFileTimeUnitToString(
const TSyncFileTimeUnit & tsftunit
)function tsyncFileDataTypeToString
std::string tsyncFileDataTypeToString(
const TSyncFileDataType & dtype
)function tsyncFileModeToString
std::string tsyncFileModeToString(
const TSyncFileMode & mode
)function cvMatToQImage
std::optional< QImage > cvMatToQImage(
const cv::Mat & mat
)Converts an OpenCV Mat to a QImage.
Parameters:
- mat The OpenCV Mat to convert.
Return: An optional containing the converted QImage, or std::nullopt if conversion fails.
This function attempts to convert the given OpenCV Mat to a QImage. It supports grayscale (1 channel), RGB (3 channels), and RGBA (4 channels) images. If the conversion is successful, it returns a QImage wrapped in std::optional. If the conversion fails (e.g., unsupported number of channels), it returns std::nullopt.
function cvMatToQPixmap
std::optional< QPixmap > cvMatToQPixmap(
const cv::Mat & mat
)function qRectToCvRect
inline cv::Rect qRectToCvRect(
const QRect & r
)Helper to convert a QRect into a cv::Rect
For a cv::Rect, right and bottom edges are exclusive, while they are inclusive for a QRect. This helper just ensures we don’t accidentally make any conversion mistakes.
function operator|
template <typename E ,
typename =std::enable_if_t<std::is_scoped_enum_v<E>>>
Flags< E > operator|(
E lhs,
E rhs
)Allow E | E to produce Flags<E> for any scoped enum.
Restricted to scoped enums so we don’t shadow the built-in int-returning operator| that plain (unscoped) enums rely on - most notably Eigen’s internal storage-option enums, which are evaluated inside Syntalos namespace scope when Eigen templates are instantiated against our types.
function shellQuote
QString shellQuote(
const QString & str
)Shell-escape a string.
function findHostExecutable
QString findHostExecutable(
const QString & exe
)Find executable on the host system (if running in a sandbox).
Parameters:
- exe Name of the executable to look for
Return: Executable name, or empty string if not found
function runHostExecutable
int runHostExecutable(
const QString & exe,
const QStringList & args,
bool waitForFinished
)Run command on the host.
Parameters:
- exe The program to run
- args Program arguments
- waitForFinished Wait for the command to finish
Return: Exit status of the program (if waiting for finished)
function findToolExecutable
QString findToolExecutable(
const QString & buildTreeRelPath,
const QString & installedPath
)Find one of Syntalos’ own helper executables.
Return: The absolute path of the executable, or an empty string if it is not available.
When Syntalos runs from its build tree, the tool is looked up relative to the build directory (e.g. “tools/crashreport/syntalos-crashreport”), otherwise at its installed location.
function runInTerminal
int runInTerminal(
const QString & cmd,
const QStringList & args,
const QString & wdir,
const QString & title
)function launchProgramNC3Fallback
static bool launchProgramNC3Fallback(
const QString & exePath,
int * pidfd_out
)Fallback for launchProgram() if the clone3() syscall was not available or is blocked by seccomp filters.
function launchProgramPidFd
bool launchProgramPidFd(
const QString & exePath,
int * pidfd_out
)Launch a program in a new process, and return the PID of the new process as pidfd.
Parameters:
- exePath The path to the executable to launch.
- pidfd_out A pointer to an integer, which will be set to the PID of the new process.
Return: true if the program was successfully launched, false otherwise.
This function is used to launch a new program in a new process, and return the PID as pidfd.
function isProcessRunning
bool isProcessRunning(
int pidfd
)Check if a process is still running using a pidfd.
Parameters:
- pidfd The PIDFD of the process to check.
Return: true if the process is still running, false otherwise.
This function checks if a process is still running, by checking if the process has exited or not.
function getLogger
quill::Logger * getLogger(
const std::string & name
)function getLogger
quill::Logger * getLogger(
const QString & name
)function getLogger
quill::Logger * getLogger(
const char * name
)function logModTmp
quill::Logger * logModTmp(
const char * name
)Parameters:
- name A custom-defined module name.
Return: A logger for the module ID.
Get a temporary logger for an arbitrary module name. This is not for high-volume logging and mostly for compatibility with older code, think twice before using it in any new code.
Usually there is a better solution.
function getDefaultLogger
inline quill::Logger * getDefaultLogger()Retrieve the default (“root”) logger.
function removeLogger
void removeLogger(
quill::Logger * logger
)Remove a logger explicitly. Should usually not be needed.
function initializeSyLogSystem
void initializeSyLogSystem(
quill::LogLevel consoleLogLevel =quill::LogLevel::Info,
const QString & logDir =QString(),
const QString & logName =QStringLiteral("syntalos")
)Parameters:
- consoleLogLevel Minimum log level for all loggers (and thereby the console).
- logDir If not empty, log output is also written to
<logDir>/<logName>.log. Logs of previous sessions are kept as rotated files (<logName>.1.log, …). - logName Base name of the log file, without extension.
Initialize Syntalos logging. Must only ever be called once, at program startup. Purely internal API.
function currentLogFilePath
QString currentLogFilePath()Absolute path to the log file of the current session, or an empty string if logging to a file is disabled.
function currentLogDir
QString currentLogDir()Directory containing the current and rotated log files, or an empty string if logging to a file is disabled.
function shutdownSyLogSystem
void shutdownSyLogSystem()Shut the logging system down and flush all pending messages. Must be called last in a program, as logging is not possible afterwards.
function qstr
inline const QString & qstr(
const QString & s
)function qstr
inline QString qstr(
QStringView s
)function qstr
inline QString qstr(
const char * s
)function qstr
inline QString qstr(
std::string_view s
)function qstr
inline QString qstr(
const std::string & s
)function createRandomString
QString createRandomString(
int len
)Create a random alphanumeric string with the given length.
function simplifyStrForModuleName
QString simplifyStrForModuleName(
const QString & s
)Simplify a string for use as a module name.
function simplifyStrForFileBasename
QString simplifyStrForFileBasename(
const QString & s,
bool lowerCase =true,
uint maxLen =60
)Simplify a string for use in file basenames.
function simplifyStrForFileBasename
std::string simplifyStrForFileBasename(
const std::string & s,
bool lowerCase =true,
uint maxLen =60
)function qStringSplitLimit
QStringList qStringSplitLimit(
const QString & str,
const QChar & sep,
int maxSplit,
Qt::CaseSensitivity cs =Qt::CaseSensitive
)Split a string, limiting the amount of splits made.
function syntalosVersionFull
QString syntalosVersionFull()Return the complete current Syntalos version number.
Retrieve the full Syntalos version, including any VCS information.
function syntalosVersion
QString syntalosVersion()Return just the project version (without VCS information).
function isInFlatpakSandbox
bool isInFlatpakSandbox()Check if Syntalos is running in a Flatpak sandbox.
function appDataRootDir
QString appDataRootDir()Get the root directory for Syntalos user data (modules, venv, cache, logs).
This is safe to call before a GlobalConfig instance exists, and yields the same directory for Syntalos itself and any of its helper applications.
function tempDirRoot
QString tempDirRoot()Get path to the OSes default temporary directory.
Return: An absolute path to temp dir.
function tempDirLargeRoot
QString tempDirLargeRoot()Get path to a temporary directory that can hold large files.
Return: An absolute path to temp dir.
function isTemporaryPath
bool isTemporaryPath(
const QString & path
)Check whether a path is located in a temporary or cache directory.
function findHostFile
QString findHostFile(
const QString & path
)Find file on the host system (if running in a sandbox).
Parameters:
- path Path of the file to check for
Return: The absolute path to the requested file, or an empty string if not found.
function hostUdevRuleExists
bool hostUdevRuleExists(
const QString & ruleFilename
)Check if a udev rule exists.
Parameters:
- ruleFilename Name of the udev rule file
Return: true if the rule existed, false otherwise.
function isBinaryInPath
bool isBinaryInPath(
const QString & binaryName
)Check if a binary is in the current environment PATH.
Parameters:
- binaryName Name of the binary to check for
Return: true if the binary is in the PATH, false otherwise.
function delay
void delay(
int waitMsec
)Delay execution by approximately the given time, not blocking the main event loop.
Parameters:
- waitMsec Time to wait.
function blake3HashForData
QByteArray blake3HashForData(
const QByteArray & data
)Calculate the BLAKE3 hash for the given data.
function blake3HashForFile
std::expected< QByteArray, QString > blake3HashForFile(
const QString & filename
)Calculate the BLAKE3 hash for the given file.
function formatByteSize
QString formatByteSize(
qint64 bytes
)Format a byte count for display to humans.
function formatApproxDuration
QString formatApproxDuration(
double seconds
)Format a duration in seconds as a rough, human-readable time span.
function colorModeToString
QString colorModeToString(
ColorMode mode
)function colorModeFromString
ColorMode colorModeFromString(
const QString & str
)function soundCueId
QString soundCueId(
SoundCue cue
)Stable identifier of a sound cue, used as settings key and sound file name.
function soundCueDisplayName
QString soundCueDisplayName(
SoundCue cue
)Human-readable name of a sound cue.
function findSyntalosLibraryPaths
void findSyntalosLibraryPaths(
QString & pkgConfigPath,
QString & ldLibraryPath,
QString & includePath
)function findSyntalosMlinkPyModulePaths
QStringList findSyntalosMlinkPyModulePaths()Build an ordered list of directories that can contain syntalos_mlink. Dev/build paths are preferred over installed paths.
function datactlLogHandler
static void datactlLogHandler(
const datactl::LogMessage & m
)function qtLogHandler
static void qtLogHandler(
QtMsgType type,
const QMessageLogContext & ctx,
const QString & msg
)function glibLogWriter
static GLogWriterOutput glibLogWriter(
GLogLevelFlags log_level,
const GLogField * fields,
gsize n_fields,
gpointer
)function setupLogFileSink
static void setupLogFileSink(
const QString & logDir,
const QString & logName
)function makeIpcServiceTopology
inline IpcServiceTopology makeIpcServiceTopology(
uint senderCount,
uint receiverCount
)Helper to create a Syntalos IPC service topology, for setting limits on IOX connections.
function connectionHeatToHumanString
QString connectionHeatToHumanString(
ConnectionHeatLevel heat
)function driverKindToString
QString driverKindToString(
ModuleDriverKind kind
)function toString
QString toString(
ModuleCategory category
)function moduleCategoryFromString
ModuleCategory moduleCategoryFromString(
const QString & categoryStr
)function moduleCategoriesFromVariant
ModuleCategories moduleCategoriesFromVariant(
const QVariant & value
)function qHash
inline uint qHash(
ModuleModifier key,
uint seed
)function newStreamForType
VariantDataStream * newStreamForType(
int typeId
)Create a new DataStream for the type identified by the given ID.
function newInputPortForType
VarStreamInputPort * newInputPortForType(
int typeId,
AbstractModule * mod,
const QString & id,
const QString & title
)Create a new Input Port for the type identified by the given ID.
function pythonVEnvDirForName
QString pythonVEnvDirForName(
const QString & venvName
)Get the absolute directory path of a virtual environment with the given name.
function pythonVirtualEnvExists
static bool pythonVirtualEnvExists(
const QString & venvName
)function requirementsHashMetadataPath
static QString requirementsHashMetadataPath(
const QString & venvDir
)function writeRequirementsHashMetadata
static bool writeRequirementsHashMetadata(
const QString & venvDir,
const QByteArray & requirementsHash
)function readRequirementsHashMetadata
static bool readRequirementsHashMetadata(
const QString & venvDir,
QString & requirementsHashOut
)function interpreterPathFromCfg
static QString interpreterPathFromCfg(
const QString & venvDir
)function pythonVirtualEnvStatus
PyVirtualEnvStatus pythonVirtualEnvStatus(
const QString & venvName,
const QString & requirementsFile
)function injectSyntalosMlinkIntoVenv
static void injectSyntalosMlinkIntoVenv(
const QString & venvDir
)function createPythonVirtualEnv
std::expected< QString, QString > createPythonVirtualEnv(
const QString & venvName,
const QString & requirementsFile,
bool recreate
)function readMemInfo
MemInfo readMemInfo()Read some data from meminfo that is relevant to Syntalos.
function readMemPressure
MemPressure readMemPressure()Read memory pressure stall information from the kernel. This is unavailable on kernels without PSI support (or with psi=0), in which case the returned structure is flagged as unavailable.
function diskSpaceInfo
DiskSpaceInfo diskSpaceInfo(
const QString & path
)Query the free space of the filesystem that path is located on.
If path does not exist, the closest existing parent directory is used, so the check also works for files that are yet to be created.
function directoryTotalSize
qint64 directoryTotalSize(
const QString & path
)Determine the total size of all regular files below the given directory.
function captureCurrentThreadUsage
std::optional< ThreadUsageStats > captureCurrentThreadUsage()Capture the resource usage of the calling thread.
Return: Nothing if the kernel refused to provide the data.
function captureProcessUsage
std::optional< ThreadUsageStats > captureProcessUsage()Capture the resource usage of the whole current process.
Return: Nothing if the kernel refused to provide the data.
function readProcessUsage
std::optional< ThreadUsageStats > readProcessUsage(
qint64 pid
)Read the accumulated resource usage of another process (and its descendants) from procfs.
Return: Nothing if the process does not exist (anymore).
function readProcessTreeRssKiB
qint64 readProcessTreeRssKiB(
qint64 pid
)Current resident memory of a process and all of its descendants, in KiB.
function raiseFdLimit
std::expected< std::pair< uint64_t, uint64_t >, std::string > raiseFdLimit()Raise the soft limit for file descriptors of this process to its hard limit.
Return: The previous and the new soft limit, or an error message.
With a lot of IPC, Syntalos or its worker processes can easily exhaust the maximum fd limit of 1024. That’s why we raise the limit (and hope nobody uses select() in a dependency).
function readProcessTreePssKiB
qint64 readProcessTreePssKiB(
qint64 pid
)Proportional memory of a process and all of its descendants, in KiB.
Shared memory is split between the processes using it, so the sum is what the tree really costs. Reading it walks all memory mappings, which takes milliseconds for large processes. Falls back to the resident size where the kernel does not provide it.
function readProcessSchedInfo
std::optional< ProcessSchedInfo > readProcessSchedInfo(
qint64 pid
)Read the scheduling priority of another process (and its descendants) from procfs.
Return: Nothing if the process does not exist (anymore).
function streamDataFromRawMemory
template <typename T >
T streamDataFromRawMemory(
const void * data,
size_t size
)Convert raw received bytes into their data type.
function initSyntalosModuleLink
std::unique_ptr< SyntalosLink > initSyntalosModuleLink(
const ModuleInitOptions & optn ={}
)function moduleCacheDir
std::expected< fs::path, std::string > moduleCacheDir(
bool create =true
)Get the persistent cache directory for a module.
Parameters:
- create If true, the directory is created if it does not exist yet.
Return: The absolute path, or an error message if the module type ID is missing or invalid, or the directory could not be created.
Resolves to <Syntalos data root>/cache/modules/<module-type-id>. The directory is shared between all instances of the module and is intended for data that can be regenerated or re-downloaded.
The module type ID is provided by Syntalos when it launches the module, so this function will fail for modules that were not launched by Syntalos.
function moduleDataDir
std::expected< fs::path, std::string > moduleDataDir()Get the directory the module is installed in / run from.
Return: The absolute, canonical path, or an error message if the directory could not be determined or does not exist.
This is the directory containing the module’s module.toml, and can be used to locate data files that are shipped with the module. Depending on how Syntalos was run, it may be located in the build tree, a system location or a Flatpak bundle.
The location is provided by Syntalos when it launches the module. If it is not set, the directory containing the running executable is used instead.
function termSignalHandler
static void termSignalHandler(
int signum
)function installHandler
static bool installHandler(
int signum
)function isFileOnTmpfs
static bool isFileOnTmpfs(
const QString & fname
)function canonicalPathLenient
static QString canonicalPathLenient(
const QString & path
)Resolve symlinks as far as the path exists, so paths that do not exist yet can still be compared against canonical directory locations.
function get_entry
static long long get_entry(
const char * name,
const char * buf
)function get_entry_fatal
static long long get_entry_fatal(
const char * name,
const char * buf
)function available_guesstimate
static long long available_guesstimate(
const char * buf
)function timevalToSec
static double timevalToSec(
const struct timeval & tv
)function usageFromRusage
static ThreadUsageStats usageFromRusage(
const struct rusage & ru,
int64_t id
)function readProcStatFields
static QList< QByteArray > readProcStatFields(
const QString & path
)Read a procfs “stat” file (of a process or a task) and return its fields after the executable name, so the first entry is field 3 (state) in proc(5) numbering.
function readProcessTaskIds
static QStringList readProcessTaskIds(
qint64 pid
)function readSingleProcessUsage
static std::optional< ThreadUsageStats > readSingleProcessUsage(
qint64 pid
)Read the usage of a single process from procfs.
function readChildProcesses
static QList< qint64 > readChildProcesses(
qint64 pid
)Direct child processes of all tasks of a process, via /proc/
function readProcessTree
static QList< qint64 > readProcessTree(
qint64 pid
)A process and its descendants, so that workers launched through a wrapper (a debugger, a virtualenv launcher, …) are covered as well. The tree is walked to a limited depth, we do not expect deep process hierarchies here.
function readProcessRssKiB
static qint64 readProcessRssKiB(
qint64 pid
)function readProcessPssKiB
static qint64 readProcessPssKiB(
qint64 pid
)function SY_DEFINE_LOG_CATEGORY
SY_DEFINE_LOG_CATEGORY(
logSyLink ,
"sylink"
)function safeReceive
template <typename Sub >
static std::remove_cvref_t< decltype(sub.receive().value())> safeReceive(
Sub & sub
)Safely receive from a subscriber on the client. Returns the inner optional (empty = no data available) and logs a warning instead of crashing when the receive itself fails.
function getenvSafe
static std::string getenvSafe(
const char * name
)function resolveTypedNewDataCallback
void resolveTypedNewDataCallback(
InputPortInfo * iport
)Resolve the variant (typed) callback into a per-sample raw callback once, using the recorded source-on-wire type ID and the declared input type ID. Compatible stream type castings are applied here.
Port has to be connected (sourceTypeId != 0) and d.newDataCb should be set.
function SY_DEFINE_LOG_CATEGORY
SY_DEFINE_LOG_CATEGORY(
logIpc ,
"ipc"
)function ipcLogMessageDispatch
static void ipcLogMessageDispatch(
datactl::LogSeverity severity,
const std::string & msg
)function edlRelPath
static std::string edlRelPath(
const EDLGroup & root,
const EDLGroup & target
)Helper: compute the relative path of target from the rootGroup. Returns "" if target IS the rootGroup (i.e., put at root level).
function SY_DEFINE_LOG_CATEGORY
SY_DEFINE_LOG_CATEGORY(
logLinkMod ,
"sylm"
)function kTextEditorInstance
inline KTextEditor::Editor * kTextEditorInstance()Obtain the global KTextEditor instance.
This wraps KTextEditor::Editor::instance() and applies workarounds for known issues in the underlying libraries. Always use this function instead of calling KTextEditor::Editor::instance() directly.
Attributes Documentation
variable g_streamTypeIdIndex
static std::vector< std::pair< std::string, int > > g_streamTypeIdIndex;variable US_PER_MS
int64_t US_PER_MS = 1'000;variable US_PER_S
int64_t US_PER_S = 1'000 * US_PER_MS;variable US_PER_MIN
int64_t US_PER_MIN = 60 * US_PER_S;variable US_PER_H
int64_t US_PER_H = 60 * US_PER_MIN;variable NS_PER_US
int64_t NS_PER_US = 1'000;variable MS_PER_S
int64_t MS_PER_S = 1'000;variable MS_PER_MIN
int64_t MS_PER_MIN = 60 * MS_PER_S;variable SECONDARY_CLOCK_TOLERANCE
static auto SECONDARY_CLOCK_TOLERANCE = microseconds_t(1000);The amount of time a secondary clock is allowed to deviate from the master.
Since Syntalos uses millisecond time resolution, permitting (slightly more than) half a millisecond deviation for secondary clocks from the master clock is sensible.
IMPORTANT: Modules may override this value for their synchronizers to one that fits their device better. This is just a default for modules which do not change the default setting.
variable DEFAULT_CLOCKSYNC_CHECK_INTERVAL
static auto DEFAULT_CLOCKSYNC_CHECK_INTERVAL = milliseconds_t(4000);Interval at which we check for external clock synchronization.
IMPORTANT: This is just a default value for modules which do not explicitly define a check interval. Individual modules may choose a different value that fits the device they are communicating with best.
variable g_consoleSink
static std::shared_ptr< quill::Sink > g_consoleSink = nullptr;variable g_fileSink
static std::shared_ptr< quill::Sink > g_fileSink = nullptr;variable g_sinks
static std::vector< std::shared_ptr< quill::Sink > > g_sinks;variable g_defaultLogLevel
static quill::LogLevel g_defaultLogLevel = quill::LogLevel::Info;variable g_logDir
static QString g_logDir;variable g_logFilePath
static QString g_logFilePath;variable g_prevQtHandler
static QtMessageHandler g_prevQtHandler = nullptr;variable SY_LOG_PATTERN
static auto SY_LOG_PATTERN = "%(time) %(log_level_short_code) %(thread_name):%(logger): %(message)";variable SY_LOG_MAX_FILE_SIZE
static size_t SY_LOG_MAX_FILE_SIZE = 32 * 1024 * 1024;variable SY_LOG_MAX_BACKUP_FILES
static uint32_t SY_LOG_MAX_BACKUP_FILES = 5;variable SY_IOX_QUEUE_CAPACITY
static uint64_t SY_IOX_QUEUE_CAPACITY = 16U;variable SY_IOX_HISTORY_SIZE
static uint64_t SY_IOX_HISTORY_SIZE = 1U;variable SY_IOX_INITIAL_SLICE_LEN
static uint64_t SY_IOX_INITIAL_SLICE_LEN = 4096;variable SY_IOX_ID_MAX_LEN
static size_t SY_IOX_ID_MAX_LEN = IOX2_SERVICE_NAME_LENGTH;variable SY_IOX_MAX_RESPONSE_BUF_SIZE
static uint64_t SY_IOX_MAX_RESPONSE_BUF_SIZE = 2U;variable IN_PORT_CHANGE_CHANNEL_ID
static const std::string IN_PORT_CHANGE_CHANNEL_ID = "InPortChange";variable OUT_PORT_CHANGE_CHANNEL_ID
static const std::string OUT_PORT_CHANGE_CHANNEL_ID = "OutPortChange";variable IN_PORT_UPDATE_METADATA_ID
static const std::string IN_PORT_UPDATE_METADATA_ID = "UpdateInputPortMetadata";variable WORKER_CTL_EVENT_ID
static const std::string WORKER_CTL_EVENT_ID = "worker-event";Shared wakeup event service names for the control channel.
WORKER_CTL_EVENT_ID - the worker notifies the master whenever it publishes on a control channel (error, state, port-changes …). The master attaches one listener for this to its WaitSet.
MASTER_CTL_EVENT_ID - the master notifies the worker whenever it sends a request (request-response commands).
variable MASTER_CTL_EVENT_ID
static const std::string MASTER_CTL_EVENT_ID = "master-event";variable ERROR_CHANNEL_ID
static const std::string ERROR_CHANNEL_ID = "Error";variable STATE_CHANNEL_ID
static const std::string STATE_CHANNEL_ID = "State";variable STATUS_MESSAGE_CHANNEL_ID
static const std::string STATUS_MESSAGE_CHANNEL_ID = "StatusMessage";variable SYNC_DETAILS_CHANNEL_ID
static const std::string SYNC_DETAILS_CHANNEL_ID = "SyncDetails";variable SYNC_OFFSET_CHANNEL_ID
static const std::string SYNC_OFFSET_CHANNEL_ID = "SyncOffset";variable API_VERSION_CALL_ID
static const std::string API_VERSION_CALL_ID = "ApiVersion";variable SET_NICENESS_CALL_ID
static const std::string SET_NICENESS_CALL_ID = "SetNiceness";variable SET_MAX_RT_PRIORITY_CALL_ID
static const std::string SET_MAX_RT_PRIORITY_CALL_ID = "SetMaxRealtimePriority";variable SET_CPU_AFFINITY_CALL_ID
static const std::string SET_CPU_AFFINITY_CALL_ID = "SetCPUAffinity";variable DELETE_PORT_CALL_ID
static const std::string DELETE_PORT_CALL_ID = "DeletePort";variable CONNECT_INPUT_CALL_ID
static const std::string CONNECT_INPUT_CALL_ID = "ConnectInputPort";variable LOAD_SCRIPT_CALL_ID
static const std::string LOAD_SCRIPT_CALL_ID = "LoadScript";variable SET_PORTS_PRESET_CALL_ID
static const std::string SET_PORTS_PRESET_CALL_ID = "SetPortsPresetRequest";variable SAVE_SETTINGS_CALL_ID
static const std::string SAVE_SETTINGS_CALL_ID = "SaveSettings";variable LOAD_SETTINGS_CALL_ID
static const std::string LOAD_SETTINGS_CALL_ID = "LoadSettings";variable SET_MODULE_NAME_CALL_ID
static const std::string SET_MODULE_NAME_CALL_ID = "SetModuleName";variable PREPARE_RUN_CALL_ID
static const std::string PREPARE_RUN_CALL_ID = "PrepareRun";variable START_CALL_ID
static const std::string START_CALL_ID = "Start";variable STOP_CALL_ID
static const std::string STOP_CALL_ID = "Stop";variable SHUTDOWN_CALL_ID
static const std::string SHUTDOWN_CALL_ID = "Shutdown";variable SHOW_SETTINGS_CALL_ID
static const std::string SHOW_SETTINGS_CALL_ID = "ShowSettings";variable SHOW_DISPLAY_CALL_ID
static const std::string SHOW_DISPLAY_CALL_ID = "ShowDisplay";variable EDL_RESERVE_CALL_ID
static const std::string EDL_RESERVE_CALL_ID = "EdlReserve";variable g_sigPipe
static int[2] g_sigPipe = {-1, -1};variable kTermSignals
static int[] kTermSignals = {SIGINT, SIGTERM};Updated on 2026-11-26 at 18:54:14 +0000