Struct anira::v2::ContextConfig#
-
struct ContextConfig#
Collaboration diagram for anira::v2::ContextConfig:
![digraph {
graph [bgcolor="#00000000"]
node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2]
edge [color="#1414CE"]
"1" [label="anira::v2::ContextConfig" tooltip="anira::v2::ContextConfig" fillcolor="#BFBFBF"]
"2" [label="anira::v2::LogConfig" tooltip="anira::v2::LogConfig"]
"1" -> "2" [dir=forward tooltip="usage"]
}](../../_images/graphviz-e4c79d626d8d9178f50cef0421531a852a7202c2.png)
The 2.x ContextConfig (v2.3.0’s name): a plain value with the 2.x fields, minted into an anira::ContextConfig when a handler is built (to_context_config). The default thread count is k_threads_auto, the sentinel anira resolves (half the hardware threads, at least 1, on WebAssembly too) where 2.x stored the resolved count: a host that read m_num_threads back to learn the count reads the sentinel.
Public Functions
-
inline ContextConfig(unsigned num_threads = k_threads_auto, WaitStrategy wait_strategy = WaitStrategy::SpinBackoff, LogLevel log_level = default_log_level())#
-
inline explicit ContextConfig(const anira::ContextConfig &loaded)#
The values a loaded context config holds (anira_context_config_threads and anira_context_config_log), e.g. one ContextConfig::from_json read from a 2.x document. A field the document left out reads anira’s default: ANIRA_THREADS_AUTO threads, and the Warning level where 2.x took default_log_level().
- Throws:
Error{ANIRA_ERROR_INVALID_ARGUMENT} – on an empty handle.
-
inline anira::ContextConfig to_context_config() const#
The anira::ContextConfig of these values: the threads with the wait strategy, the log level, the drain with its interval and the queue capacity; no sink, no flags, no device.
Public Members
-
unsigned m_num_threads = k_threads_auto#
-
WaitStrategy m_wait_strategy = WaitStrategy::SpinBackoff#
Public Static Attributes
-
static constexpr unsigned k_threads_auto = ANIRA_THREADS_AUTO#
-
inline ContextConfig(unsigned num_threads = k_threads_auto, WaitStrategy wait_strategy = WaitStrategy::SpinBackoff, LogLevel log_level = default_log_level())#