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...
|
| size_t | activeCount () const noexcept |
| | Get current number of active timers.
|
| |
| bool | cancelTimer (TimerId id) noexcept |
| | Cancel an active timer by its TimerId handle.
|
| |
| constexpr size_t | capacity () const noexcept |
| | Get maximum timer capacity.
|
| |
| template<typename EventSink > |
| std::size_t | processDueTimers (EventSink &sink, time_point now=ClockPolicy::now()) |
| | Process all due timers and post their events into target event bus or sink. Uses O(1) early exit when the earliest timer is not yet due.
|
| |
| 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.
|
| |
| TimerId | scheduleDelayed (EventVariant event, duration 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.
|
| |
| TimerId | schedulePeriodic (EventVariant event, duration interval, EventPriority priority=EventPriority::Normal) |
| | Schedule a recurring periodic event with native clock duration.
|
| |
| | TimerScheduler ()=default |
| |
template<typename EventVariant = DefaultEvents, size_t MaxTimers = 64, typename ClockPolicy = ChronoClockPolicy>
class corium::TimerScheduler< EventVariant, MaxTimers, ClockPolicy >
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.
- Template Parameters
-
| EventVariant | Supported event variant list type. |
| MaxTimers | Maximum number of concurrent active timers (static min-heap capacity). |
| ClockPolicy | Policy governing time acquisition and arithmetic (ChronoClockPolicy default). |