|
| | BasicRuntime () |
| |
| | BasicRuntime (const BasicRuntime &)=delete |
| |
| bool | cancelTimer (TimerId id) noexcept |
| | Cancel an active timer handle.
|
| |
| void | detachApplication () noexcept |
| | Detach application to prevent dangling callbacks on shutdown.
|
| |
| std::size_t | drain () |
| | Drain and dispatch all currently enqueued events immediately.
|
| |
| EventSinkT< EventVariant > | eventSink () noexcept |
| | Access event sink handle.
|
| |
| template<typename Derived , typename AppEvents = EventVariant, std::size_t MaxServices = 8> |
| void | initialize (corium::Application< Derived, AppEvents, MaxServices > &application) |
| | Initialize runtime with target application using static CRTP dispatch.
|
| |
| BasicRuntime & | operator= (const BasicRuntime &)=delete |
| |
| const OverflowPolicy & | overflowPolicy () const noexcept |
| | Access const reference to overflow policy.
|
| |
| OverflowPolicy & | overflowPolicy () noexcept |
| | Access reference to overflow policy.
|
| |
| const ProfilerPolicyType & | profiler () const noexcept |
| | Access const reference to profiler policy.
|
| |
| ProfilerPolicyType & | profiler () noexcept |
| | Access reference to profiler policy.
|
| |
| void | pump () |
| | Pump all pending events in the queue until empty.
|
| |
| void | pump (std::size_t maxEvents) |
| | Pump up to maxEvents pending events from the queue.
|
| |
| std::size_t | pumpBatch (std::size_t batchSize=16, std::size_t maxTotal=(std::numeric_limits< std::size_t >::max)()) |
| | Pump events in consecutive batches to maximize CPU cache locality.
|
| |
| bool | quitRequested () const noexcept |
| | Check if runtime quit has been requested.
|
| |
| void | requestQuit () noexcept |
| | Request runtime quit.
|
| |
| template<typename Rep , typename Period > |
| TimerId | scheduleDelayed (EventVariant event, const std::chrono::duration< Rep, Period > &delay, EventPriority priority=EventPriority::Normal) |
| | Schedule a single-shot delayed event with std::chrono duration.
|
| |
template<typename DurationType >
requires (!std::is_same_v<DurationType, std::chrono::microseconds> && !std::is_same_v<DurationType, std::chrono::milliseconds>) |
| TimerId | scheduleDelayed (EventVariant event, DurationType delay, EventPriority priority=EventPriority::Normal) |
| | Schedule a single-shot delayed event with native clock duration.
|
| |
| template<typename Rep , typename Period > |
| TimerId | schedulePeriodic (EventVariant event, const std::chrono::duration< Rep, Period > &interval, EventPriority priority=EventPriority::Normal) |
| | Schedule a recurring periodic event with std::chrono duration.
|
| |
template<typename DurationType >
requires (!std::is_same_v<DurationType, std::chrono::microseconds> && !std::is_same_v<DurationType, std::chrono::milliseconds>) |
| TimerId | schedulePeriodic (EventVariant event, DurationType interval, EventPriority priority=EventPriority::Normal) |
| | Schedule a recurring periodic event with native clock duration.
|
| |
| void | setOnQueueNonEmpty (StaticCallback callback) |
| | Set static callback triggered when event queue transitions from empty to non-empty (0 -> 1).
|
| |
| void | shutdown () noexcept |
| | Stop runtime cleanly.
|
| |
| const SignalPolicy & | signalPolicy () const noexcept |
| | Access const reference to signal policy.
|
| |
| SignalPolicy & | signalPolicy () noexcept |
| | Access reference to signal policy.
|
| |
| State | state () const noexcept |
| | Access current lifecycle state of the runtime.
|
| |
| const TimerSchedulerType & | timerScheduler () const noexcept |
| | Access const reference to timer scheduler.
|
| |
| TimerSchedulerType & | timerScheduler () noexcept |
| | Access reference to timer scheduler.
|
| |
| template<typename Rep , typename Period > |
| std::size_t | waitAndPump (const std::chrono::duration< Rep, Period > &timeout) |
| | Wait for at least one event to become available (or until timeout), then pump all pending events.
|
| |
| | ~BasicRuntime () |
| |
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>
class corium::BasicRuntime< EventVariant, QueuePolicy, SignalPolicy, StoragePolicy, OverflowPolicy, TimerStoragePolicy, ProfilerPolicy >
Corium Application Runtime managing MPSC event loops and static policy execution. Zero dynamic heap allocations, zero RTTI.
- Template Parameters
-
| EventVariant | The variant type list of supported events. |
| QueuePolicy | Policy governing event queueing (Lock-free MPSC). |
| SignalPolicy | Policy governing notification (NoSignalPolicy default). |
| StoragePolicy | Policy governing handler capacity and delegate inline storage size. |
| OverflowPolicy | Policy governing queue overflow handling (DropNewestOverflowPolicy default). |
| TimerStoragePolicy | Policy governing maximum concurrent timers (DefaultTimerStoragePolicy default: 64). |
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>
template<typename Derived , typename AppEvents = EventVariant, std::size_t MaxServices = 8>
| void corium::BasicRuntime< EventVariant, QueuePolicy, SignalPolicy, StoragePolicy, OverflowPolicy, TimerStoragePolicy, ProfilerPolicy >::initialize |
( |
corium::Application< Derived, AppEvents, MaxServices > & |
application | ) |
|
|
inline |
Initialize runtime with target application using static CRTP dispatch.
- Template Parameters
-
| Derived | Application core type deriving from Application<Derived, AppEvents, MaxServices>. |
| AppEvents | Event variant or event bus type defined on the application. |
| MaxServices | Number of services the application can register (deduced automatically). |
- Parameters
-
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>
template<typename Rep , typename Period >
Schedule a single-shot delayed event with std::chrono duration.
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>
template<typename DurationType >
requires (!std::is_same_v<DurationType, std::chrono::microseconds> && !std::is_same_v<DurationType, std::chrono::milliseconds>)
Schedule a single-shot delayed event with native clock duration.
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>
template<typename Rep , typename Period >
Schedule a recurring periodic event with std::chrono duration.
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>
template<typename DurationType >
requires (!std::is_same_v<DurationType, std::chrono::microseconds> && !std::is_same_v<DurationType, std::chrono::milliseconds>)
Schedule a recurring periodic event with native clock duration.
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>
template<typename Rep , typename Period >
| std::size_t corium::BasicRuntime< EventVariant, QueuePolicy, SignalPolicy, StoragePolicy, OverflowPolicy, TimerStoragePolicy, ProfilerPolicy >::waitAndPump |
( |
const std::chrono::duration< Rep, Period > & |
timeout | ) |
|
|
inline |
Wait for at least one event to become available (or until timeout), then pump all pending events.