Corium 1.1.0
High-Performance Zero-Heap C++20 MPSC Application Runtime
Loading...
Searching...
No Matches
corium Namespace Reference

Namespaces

namespace  async
 
namespace  embedded
 
namespace  fsm
 
namespace  internal
 
namespace  ipc
 
namespace  logging
 
namespace  net
 
namespace  profiler
 
namespace  safety
 
namespace  wire
 

Classes

class  Application
 Static CRTP base class for applications managed by Corium Runtime. Subclass Application<Derived> or Application<Derived, EventVariant, MaxServices> for zero-vtable compile-time static dispatch. All framework operations and handlers are protected for clean encapsulation within the derived application. More...
 
class  ApplicationContext
 Context object passed to Application providing event registration, sink access, quit requests, and timer scheduling. Completely encapsulates EventBus and Reactor internals. More...
 
class  AtomicWaitSignalPolicy
 Signal Policy using C++20 std::atomic::wait() / notify_one() for zero-mutex futex signaling. More...
 
class  AuditOverflowPolicy
 Overflow Policy: Audit and count dropped events via atomic counter. More...
 
class  BackgroundService
 Multi-threaded background worker service owning a dedicated std::jthread. Integrates incoming event queue with background worker execution and cooperative shutdown via std::stop_token. Zero heap allocations, zero vtables/RTTI. More...
 
class  BasicEventBus
 Policy-configurable non-virtual event bus implementation. More...
 
class  BasicEventSink
 Non-virtual type-erased event sink handle (raw pointer + static function pointer). Zero dynamic heap allocations, zero vtables/RTTI. More...
 
class  BasicReactor
 Primary template declaration for BasicReactor. More...
 
class  BasicReactor< std::variant< Events... >, StoragePolicy >
 Static Event Reactor providing compile-time zero-heap dispatching. More...
 
class  BasicRuntime
 Corium Application Runtime managing MPSC event loops and static policy execution. Zero dynamic heap allocations, zero RTTI. More...
 
struct  BasicRuntimeBuilder
 Primary template implementation for fluent compile-time Runtime construction. More...
 
class  BasicServiceContext
 Execution context provided to background services. Allows services to post events back to the main event queue thread-safely and communicate with other registered background services. More...
 
class  BasicServiceRegistry
 Non-allocating ServiceRegistry storing service handles in a fixed stack/static array. Zero heap allocations, zero vtables/RTTI. More...
 
class  BlockingQueuePolicy
 Queue Policy for a traditional mutex-protected blocking queue (power saving). More...
 
class  BoundedMpscQueuePolicy
 Queue Policy for fixed-capacity, zero-allocation lock-free MPSC RingBuffer. More...
 
class  CallbackSignalPolicy
 Signal Policy invoking an edge-triggered callback on 0->1 transition when queue becomes non-empty. More...
 
class  ChronoClockPolicy
 Default host clock policy using std::chrono::steady_clock. More...
 
struct  DropNewestOverflowPolicy
 Default Overflow Policy: Silently drop incoming new event when queue is full. Zero overhead. More...
 
struct  DropOldestOverflowPolicy
 Overflow Policy: Evict oldest event in queue to make room for the new event. Ideal for high-frequency telemetry and sensor data where newest reading is critical. More...
 
struct  ErrorEvent
 System, hardware, or framework error event. More...
 
class  EspTimerClockPolicy
 Native ESP32 Hardware Timer clock policy using esp_timer_get_time() (64-bit microsecond counter). More...
 
class  EventRouter
 Zero-heap static topic-based publish/subscribe router. Fans out events to multiple registered delegate subscribers per topic ID without dynamic memory allocation. More...
 
struct  FixedStoragePolicy
 Policy configuring compile-time handler capacity and delegate inline storage size. More...
 
struct  FixedTimerStoragePolicy
 Compile-time policy configuring TimerScheduler capacity and clock source. More...
 
class  FreeRtosClockPolicy
 FreeRTOS RTOS Tick clock policy using xTaskGetTickCount(). More...
 
class  ManualClockPolicy
 Deterministic, manually-advanced clock policy for unit tests and simulation. More...
 
class  MicrosecondTickClockPolicy
 Clock policy driven by a custom microsecond tick provider. More...
 
class  MillisecondTickClockPolicy
 Clock policy driven by a custom millisecond tick provider (e.g. millis(), HAL_GetTick()). More...
 
class  MpscRingBuffer
 Lock-free Multiple-Producer, Single-Consumer (MPSC) RingBuffer. Implements Dmitry Vyukov's algorithm with zero heap allocations (uses std::array). Cache-line aligned (alignas(CORIUM_CACHE_LINE_SIZE)) to eliminate false sharing. More...
 
class  NoQueuePolicy
 Zero-overhead Queue Policy for services or buses that do not receive or queue incoming events. Occupies zero storage space when combined with [[no_unique_address]] in container types. More...
 
class  NoSignalPolicy
 Signal Policy for busy-spin / polling event loops (sub-microsecond latency, zero signaling cost). More...
 
struct  PanicOverflowPolicy
 Overflow Policy: Trigger assertion / panic when queue fills up. Essential for mission-critical systems where event loss is unacceptable. More...
 
class  PriorityMpscQueuePolicy
 Queue Policy supporting strict event priorities using separate lock-free MPSC ring buffers. High priority events are always popped and dispatched before Normal/Low priority events. More...
 
struct  QuitEvent
 Application shutdown event. More...
 
struct  RuntimeBuilder
 Fluent compile-time builder for configuring BasicRuntime. Usage: using MyRuntime = corium::RuntimeBuilder::WithEvents<MyEvents>::Build; More...
 
class  Service
 Non-allocating base class for synchronous or thread-agnostic services. Provides event producing (posting to main EventBus) and event consuming (receiving events into dedicated incoming bus). Does NOT own a thread. Zero heap allocations, zero vtables/RTTI. More...
 
struct  SignalEvent
 Generic signal or notification trigger event. More...
 
struct  StaticCallback
 Lightweight non-allocating static callback wrapper (function pointer + optional context argument). More...
 
struct  TickEvent
 Periodic heartbeat or hardware timer tick event. More...
 
class  TimerScheduler
 Zero-heap Min-Heap Timer Scheduler for delayed and periodic events. Provides O(1) earliest-due timer checks and O(log N) insertion and rescheduling. Supports single-shot delayed events and recurring periodic events with compile-time clock policy. More...
 
struct  UpdateEvent
 Logical update or execution step event. More...
 

Typedefs

using CompactStoragePolicy = FixedStoragePolicy< 4, 16 >
 Footprint-optimized storage policy (4 handlers per event type, 16 bytes inline storage).
 
using CompactTimerStoragePolicy = FixedTimerStoragePolicy< 16, ChronoClockPolicy >
 
template<typename EventVariant = DefaultEvents, std::size_t Capacity = 64>
using ConsumerBackgroundService = BackgroundService< EventVariant, BoundedMpscQueuePolicy< EventVariant, Capacity >, CallbackSignalPolicy, DefaultStoragePolicy >
 BackgroundService alias for consumer worker threads with configurable queue capacity.
 
template<typename EventVariant = DefaultEvents, std::size_t Capacity = 64>
using ConsumerService = Service< EventVariant, BoundedMpscQueuePolicy< EventVariant, Capacity >, CallbackSignalPolicy, DefaultStoragePolicy >
 Explicit Service alias for consumer services with configurable incoming event queue capacity.
 
using DefaultEvents = std::variant< QuitEvent, TickEvent, UpdateEvent, ErrorEvent, SignalEvent >
 Default variant list of core Corium events.
 
using DefaultStoragePolicy = FixedStoragePolicy< 8, 32 >
 Default storage policy (8 handlers per event type, 32 bytes inline delegate storage).
 
using DefaultTimerStoragePolicy = FixedTimerStoragePolicy< 64, ChronoClockPolicy >
 
using Event = DefaultEvents
 Alias for DefaultEvents.
 
using EventBus = BasicEventBus< DefaultEvents >
 Default EventBus alias using DefaultEvents and NoSignalPolicy.
 
template<typename EventVariantType = DefaultEvents, typename QueuePolicy = BoundedMpscQueuePolicy<EventVariantType, 1024>, typename SignalPolicy = NoSignalPolicy, typename StoragePolicy = DefaultStoragePolicy, typename OverflowPolicy = DropNewestOverflowPolicy, typename ProfilerPolicy = profiler::NullProfiler>
using EventBusT = BasicEventBus< EventVariantType, QueuePolicy, SignalPolicy, StoragePolicy, OverflowPolicy, ProfilerPolicy >
 Templated EventBus alias for custom event variant and policies.
 
using EventSink = BasicEventSink< DefaultEvents >
 Default EventSink alias using DefaultEvents.
 
template<typename EventVariant = DefaultEvents>
using EventSinkT = BasicEventSink< EventVariant >
 Templated EventSink alias for custom event variant list.
 
using LargeStoragePolicy = FixedStoragePolicy< 16, 64 >
 High-capacity storage policy (16 handlers per event type, 64 bytes inline storage).
 
using LargeTimerStoragePolicy = FixedTimerStoragePolicy< 256, ChronoClockPolicy >
 
using PanicHandlerFn = void(*)(const char *file, int line, const char *message) noexcept
 Signature of the custom bare-metal panic handler callback.
 
template<typename EventVariant = DefaultEvents>
using ProducerBackgroundService = BackgroundService< EventVariant, NoQueuePolicy< EventVariant >, NoSignalPolicy, ZeroStoragePolicy >
 Zero-overhead BackgroundService alias for producer worker threads (zero incoming queue/reactor footprint).
 
template<typename EventVariant = DefaultEvents>
using ProducerService = Service< EventVariant, NoQueuePolicy< EventVariant >, NoSignalPolicy, ZeroStoragePolicy >
 Zero-overhead Service alias for pure producer services (no incoming event queue/reactor allocations).
 
using Reactor = BasicReactor< DefaultEvents >
 Default Reactor alias using DefaultEvents and DefaultStoragePolicy.
 
template<typename EventVariant = DefaultEvents, typename StoragePolicy = DefaultStoragePolicy>
using ReactorT = BasicReactor< EventVariant, StoragePolicy >
 Templated Reactor alias for custom event variant and storage policy.
 
using Runtime = BasicRuntime< DefaultEvents, BoundedMpscQueuePolicy< DefaultEvents, 1024 >, NoSignalPolicy, DefaultStoragePolicy, DropNewestOverflowPolicy, DefaultTimerStoragePolicy, profiler::NullProfiler >
 Default Runtime alias using DefaultEvents, NoSignalPolicy, DefaultStoragePolicy, DropNewestOverflowPolicy, DefaultTimerStoragePolicy, and NullProfiler.
 
template<typename EventVariant = DefaultEvents, typename QueuePolicy = BoundedMpscQueuePolicy<EventVariant, 1024>, typename SignalPolicy = NoSignalPolicy, typename StoragePolicy = DefaultStoragePolicy, typename OverflowPolicy = DropNewestOverflowPolicy, typename TimerStoragePolicy = DefaultTimerStoragePolicy, typename ProfilerPolicy = profiler::NullProfiler>
using RuntimeT = BasicRuntime< EventVariant, QueuePolicy, SignalPolicy, StoragePolicy, OverflowPolicy, TimerStoragePolicy, ProfilerPolicy >
 Templated Runtime alias for custom policies.
 
using ServiceContext = BasicServiceContext< DefaultEvents >
 Default ServiceContext alias using DefaultEvents.
 
template<typename EventVariant = DefaultEvents>
using ServiceContextT = BasicServiceContext< EventVariant >
 Templated ServiceContext alias for custom event variant.
 
using ServiceRegistry = BasicServiceRegistry< 8, DefaultEvents >
 Default ServiceRegistry alias using MaxServices=8 and DefaultEvents.
 
template<size_t MaxServices = 8, typename EventVariant = DefaultEvents>
using ServiceRegistryT = BasicServiceRegistry< MaxServices, EventVariant >
 Templated ServiceRegistry alias for custom capacity and event variant.
 
using TimerId = uint32_t
 
using ZeroStoragePolicy = FixedStoragePolicy< 0, 0 >
 Zero-overhead storage policy for producer services or buses with zero event handlers.
 

Enumerations

enum class  EventPriority : uint8_t { High = 0 , Normal = 1 , Low = 2 }
 Event priority levels for multi-priority queue policies. More...
 

Functions

void setPanicHandler (PanicHandlerFn fn) noexcept
 Configure the global bare-metal panic handler hook (e.g. for Hardware Fault logging).
 

Variables

constexpr TimerId INVALID_TIMER_ID = 0
 

Typedef Documentation

◆ CompactStoragePolicy

Footprint-optimized storage policy (4 handlers per event type, 16 bytes inline storage).

◆ CompactTimerStoragePolicy

◆ ConsumerBackgroundService

template<typename EventVariant = DefaultEvents, std::size_t Capacity = 64>
using corium::ConsumerBackgroundService = typedef BackgroundService< EventVariant, BoundedMpscQueuePolicy<EventVariant, Capacity>, CallbackSignalPolicy, DefaultStoragePolicy >

BackgroundService alias for consumer worker threads with configurable queue capacity.

Template Parameters
EventVariantSupported event variant type list.
CapacityIncoming ring buffer event capacity.

◆ ConsumerService

template<typename EventVariant = DefaultEvents, std::size_t Capacity = 64>
using corium::ConsumerService = typedef Service< EventVariant, BoundedMpscQueuePolicy<EventVariant, Capacity>, CallbackSignalPolicy, DefaultStoragePolicy >

Explicit Service alias for consumer services with configurable incoming event queue capacity.

Template Parameters
EventVariantSupported event variant type list.
CapacityIncoming ring buffer event capacity.

◆ DefaultEvents

Default variant list of core Corium events.

◆ DefaultStoragePolicy

Default storage policy (8 handlers per event type, 32 bytes inline delegate storage).

◆ DefaultTimerStoragePolicy

◆ Event

using corium::Event = typedef DefaultEvents

Alias for DefaultEvents.

◆ EventBus

Default EventBus alias using DefaultEvents and NoSignalPolicy.

◆ EventBusT

template<typename EventVariantType = DefaultEvents, typename QueuePolicy = BoundedMpscQueuePolicy<EventVariantType, 1024>, typename SignalPolicy = NoSignalPolicy, typename StoragePolicy = DefaultStoragePolicy, typename OverflowPolicy = DropNewestOverflowPolicy, typename ProfilerPolicy = profiler::NullProfiler>
using corium::EventBusT = typedef BasicEventBus<EventVariantType, QueuePolicy, SignalPolicy, StoragePolicy, OverflowPolicy, ProfilerPolicy>

Templated EventBus alias for custom event variant and policies.

◆ EventSink

Default EventSink alias using DefaultEvents.

◆ EventSinkT

template<typename EventVariant = DefaultEvents>
using corium::EventSinkT = typedef BasicEventSink<EventVariant>

Templated EventSink alias for custom event variant list.

◆ LargeStoragePolicy

High-capacity storage policy (16 handlers per event type, 64 bytes inline storage).

◆ LargeTimerStoragePolicy

◆ ProducerBackgroundService

template<typename EventVariant = DefaultEvents>
using corium::ProducerBackgroundService = typedef BackgroundService< EventVariant, NoQueuePolicy<EventVariant>, NoSignalPolicy, ZeroStoragePolicy >

Zero-overhead BackgroundService alias for producer worker threads (zero incoming queue/reactor footprint).

Template Parameters
EventVariantSupported event variant type list.

◆ ProducerService

template<typename EventVariant = DefaultEvents>
using corium::ProducerService = typedef Service< EventVariant, NoQueuePolicy<EventVariant>, NoSignalPolicy, ZeroStoragePolicy >

Zero-overhead Service alias for pure producer services (no incoming event queue/reactor allocations).

Template Parameters
EventVariantSupported event variant type list.

◆ Reactor

Default Reactor alias using DefaultEvents and DefaultStoragePolicy.

◆ ReactorT

template<typename EventVariant = DefaultEvents, typename StoragePolicy = DefaultStoragePolicy>
using corium::ReactorT = typedef BasicReactor<EventVariant, StoragePolicy>

Templated Reactor alias for custom event variant and storage policy.

◆ Runtime

Default Runtime alias using DefaultEvents, NoSignalPolicy, DefaultStoragePolicy, DropNewestOverflowPolicy, DefaultTimerStoragePolicy, and NullProfiler.

◆ RuntimeT

template<typename EventVariant = DefaultEvents, typename QueuePolicy = BoundedMpscQueuePolicy<EventVariant, 1024>, typename SignalPolicy = NoSignalPolicy, typename StoragePolicy = DefaultStoragePolicy, typename OverflowPolicy = DropNewestOverflowPolicy, typename TimerStoragePolicy = DefaultTimerStoragePolicy, typename ProfilerPolicy = profiler::NullProfiler>
using corium::RuntimeT = typedef BasicRuntime<EventVariant, QueuePolicy, SignalPolicy, StoragePolicy, OverflowPolicy, TimerStoragePolicy, ProfilerPolicy>

Templated Runtime alias for custom policies.

◆ ServiceContext

Default ServiceContext alias using DefaultEvents.

◆ ServiceContextT

template<typename EventVariant = DefaultEvents>
using corium::ServiceContextT = typedef BasicServiceContext<EventVariant>

Templated ServiceContext alias for custom event variant.

◆ ServiceRegistry

Default ServiceRegistry alias using MaxServices=8 and DefaultEvents.

◆ ServiceRegistryT

template<size_t MaxServices = 8, typename EventVariant = DefaultEvents>
using corium::ServiceRegistryT = typedef BasicServiceRegistry<MaxServices, EventVariant>

Templated ServiceRegistry alias for custom capacity and event variant.

◆ TimerId

using corium::TimerId = typedef uint32_t

◆ ZeroStoragePolicy

Zero-overhead storage policy for producer services or buses with zero event handlers.

Enumeration Type Documentation

◆ EventPriority

enum class corium::EventPriority : uint8_t
strong

Event priority levels for multi-priority queue policies.

Enumerator
High 
Normal 
Low 

Variable Documentation

◆ INVALID_TIMER_ID

constexpr TimerId corium::INVALID_TIMER_ID = 0
constexpr