#include <UserAllocatedEvent.h>
Public Member Functions | |
constexpr | UserAllocatedEvent (F f, ArgTs...args) |
Create an event. More... | |
constexpr | UserAllocatedEvent (EventQueue *queue, F f, ArgTs...args) |
Create an event. More... | |
~UserAllocatedEvent () | |
Destructor for events. More... | |
void | call () |
Posts an event onto the underlying event queue, returning void. More... | |
void | call_on (EventQueue *queue) |
Posts an event onto the event queue passed as argument, returning void. More... | |
bool | try_call () |
Posts an event onto the underlying event queue. More... | |
bool | try_call_on (EventQueue *queue) |
Posts an event onto the event queue passed as argument,. More... | |
void | operator() () |
Posts an event onto the underlying event queue, returning void. More... | |
void | delay (int delay) |
Configure the delay of an event. More... | |
void | period (int period) |
Configure the period of an event. More... | |
bool | cancel () |
Cancels posted event. More... | |
template<typename T , typename R > | |
constexpr | UserAllocatedEvent (T *obj, R(T::*method)(ArgTs...), ArgTs...args) |
Create an event. More... | |
template<typename T , typename R > | |
constexpr | UserAllocatedEvent (EventQueue *q, T *obj, R(T::*method)(ArgTs...), ArgTs...args) |
Create an event. More... | |
template<typename T , typename R > | |
constexpr | UserAllocatedEvent (const T *obj, R(T::*method)(ArgTs...) const, ArgTs...args) |
Create an event. More... | |
template<typename T , typename R > | |
constexpr | UserAllocatedEvent (EventQueue *q, const T *obj, R(T::*method)(ArgTs...) const, ArgTs...args) |
Create an event. More... | |
template<typename T , typename R > | |
constexpr | UserAllocatedEvent (volatile T *obj, R(T::*method)(ArgTs...) volatile, ArgTs...args) |
Create an event. More... | |
template<typename T , typename R > | |
constexpr | UserAllocatedEvent (EventQueue *q, volatile T *obj, R(T::*method)(ArgTs...) volatile, ArgTs...args) |
Create an event. More... | |
template<typename T , typename R > | |
constexpr | UserAllocatedEvent (const volatile T *obj, R(T::*method)(ArgTs...) const volatile, ArgTs...args) |
Create an event. More... | |
template<typename T , typename R > | |
constexpr | UserAllocatedEvent (EventQueue *q, const volatile T *obj, R(T::*method)(ArgTs...) const volatile, ArgTs...args) |
Create an event. More... | |
Representation of an static event for fine-grain dispatch control.
UserAllocatedEvent provides mechanism for event posting and dispatching without utilization of queue internal memory. It embeds all underlying event data and doesn't require any memory allocation while posting and dispatching. All of these makes it cannot fail due to memory exhaustion while posting
Usage:
Definition at line 76 of file UserAllocatedEvent.h.
constexpr UserAllocatedEvent | ( | F | f, |
ArgTs... | args | ||
) |
Create an event.
Constructs an event. The specified callback acts as the target for the event and is executed in the context of the event queue's dispatch loop once posted.
f | Function to execute when the event is dispatched |
args | Arguments to bind to the callback |
Definition at line 89 of file UserAllocatedEvent.h.
constexpr UserAllocatedEvent | ( | EventQueue * | queue, |
F | f, | ||
ArgTs... | args | ||
) |
Create an event.
Constructs an event. The specified callback acts as the target for the event and is executed in the context of the event queue's dispatch loop once posted.
queue | Event queue to dispatch on |
f | Function to execute when the event is dispatched |
args | Arguments to bind to the callback |
Definition at line 103 of file UserAllocatedEvent.h.
~UserAllocatedEvent | ( | ) |
Destructor for events.
Definition at line 112 of file UserAllocatedEvent.h.
constexpr UserAllocatedEvent | ( | T * | obj, |
R(T::*)(ArgTs...) | method, | ||
ArgTs... | args | ||
) |
Create an event.
Definition at line 303 of file UserAllocatedEvent.h.
constexpr UserAllocatedEvent | ( | EventQueue * | q, |
T * | obj, | ||
R(T::*)(ArgTs...) | method, | ||
ArgTs... | args | ||
) |
Create an event.
Definition at line 310 of file UserAllocatedEvent.h.
constexpr UserAllocatedEvent | ( | const T * | obj, |
R(T::*)(ArgTs...) const | method, | ||
ArgTs... | args | ||
) |
Create an event.
Definition at line 317 of file UserAllocatedEvent.h.
constexpr UserAllocatedEvent | ( | EventQueue * | q, |
const T * | obj, | ||
R(T::*)(ArgTs...) const | method, | ||
ArgTs... | args | ||
) |
Create an event.
Definition at line 324 of file UserAllocatedEvent.h.
constexpr UserAllocatedEvent | ( | volatile T * | obj, |
R(T::*)(ArgTs...) volatile | method, | ||
ArgTs... | args | ||
) |
Create an event.
Definition at line 331 of file UserAllocatedEvent.h.
constexpr UserAllocatedEvent | ( | EventQueue * | q, |
volatile T * | obj, | ||
R(T::*)(ArgTs...) volatile | method, | ||
ArgTs... | args | ||
) |
Create an event.
Definition at line 338 of file UserAllocatedEvent.h.
constexpr UserAllocatedEvent | ( | const volatile T * | obj, |
R(T::*)(ArgTs...) const volatile | method, | ||
ArgTs... | args | ||
) |
Create an event.
Definition at line 345 of file UserAllocatedEvent.h.
constexpr UserAllocatedEvent | ( | EventQueue * | q, |
const volatile T * | obj, | ||
R(T::*)(ArgTs...) const volatile | method, | ||
ArgTs... | args | ||
) |
Create an event.
Definition at line 352 of file UserAllocatedEvent.h.
void call | ( | ) |
Posts an event onto the underlying event queue, returning void.
The event is posted to the underlying queue and is executed in the context of the event queue's dispatch loop.
This call cannot fail due queue memory exhaustion because it doesn't allocate any memory
The post function is IRQ safe and can act as a mechanism for moving events out of IRQ contexts.
Definition at line 130 of file UserAllocatedEvent.h.
void call_on | ( | EventQueue * | queue | ) |
Posts an event onto the event queue passed as argument, returning void.
The event is posted to the event queue passed as argument and is executed in the context of the event queue's dispatch loop.
This call cannot fail due queue memory exhaustion because it doesn't allocate any memory
The post function is IRQ safe and can act as a mechanism for moving events out of IRQ contexts.
queue | Event queue to dispatch on. Will replace earlier bound EventQueue. |
Definition at line 152 of file UserAllocatedEvent.h.
bool cancel | ( | ) |
Cancels posted event.
Attempts to cancel posted event. It is not safe to call cancel after an event has already been dispatched.
The cancel function is IRQ safe.
If called while the event queue's dispatch loop is active, the cancel function does not guarantee that the event will not execute after it returns, as the event may have already begun executing.
Definition at line 244 of file UserAllocatedEvent.h.
void delay | ( | int | delay | ) |
Configure the delay of an event.
delay | Millisecond delay before dispatching the event |
Definition at line 215 of file UserAllocatedEvent.h.
void operator() | ( | ) |
Posts an event onto the underlying event queue, returning void.
The event is posted to the underlying queue and is executed in the context of the event queue's dispatch loop.
This call cannot fail due queue memory exhaustion because it doesn't allocate any memory
The post function is IRQ safe and can act as a mechanism for moving events out of IRQ contexts.
Definition at line 206 of file UserAllocatedEvent.h.
void period | ( | int | period | ) |
Configure the period of an event.
period | Millisecond period for repeatedly dispatching an event |
Definition at line 225 of file UserAllocatedEvent.h.
bool try_call | ( | ) |
Posts an event onto the underlying event queue.
The event is posted to the event queue passed as argument and is executed in the context of the event queue's dispatch loop.
This call cannot fail due queue memory exhaustion because it doesn't allocate any memory
Definition at line 171 of file UserAllocatedEvent.h.
bool try_call_on | ( | EventQueue * | queue | ) |
Posts an event onto the event queue passed as argument,.
The event is posted to the underlying queue and is executed in the context of the event queue's dispatch loop.
This call cannot fail due queue memory exhaustion because it doesn't allocate any memory
queue | Event queue to dispatch on. Will replace earlier bound EventQueue. |
Definition at line 189 of file UserAllocatedEvent.h.