bookeeper of future events More...
#include <planner.hpp>
Public Member Functions | |
| PlannerBase (TimeEvent *events, int32_t events_count) | |
| PlannerBase (const PlannerBase &)=delete | |
| PlannerBase (PlannerBase &&)=delete | |
| template<typename Ctx > | |
| EventId | add_event (TimePoint when, Callback callback, void *data) |
| records the new event More... | |
| void | remove_event (EventId event_id) |
| EventConsumer | consume (TimePoint deadline) |
| TimePoint | next_event () |
Friends | |
| struct | EventConsumer |
bookeeper of future events
| rotor_light::PlannerBase::PlannerBase | ( | TimeEvent * | events, |
| int32_t | events_count | ||
| ) |
records events storage pointer and maximum amount of events
|
inline |
records the new event
the contextt is either ctx::thread (mask interrupts) or ctx::interrupt (do not mask interrupts).
returns cancellable event_id
| EventConsumer rotor_light::PlannerBase::consume | ( | TimePoint | deadline | ) |
returns expired event iterator upto the deadline
| TimePoint rotor_light::PlannerBase::next_event | ( | ) |
returns timepoint of the next event
| void rotor_light::PlannerBase::remove_event | ( | EventId | event_id | ) |
cancels (removes) the specified event