![]() |
Mbed OS Reference
|
#include <UserAllocatedEvent.h>
Public Member Functions | |
| constexpr | UserAllocatedEvent (F f, ArgTs... args) |
| Create an event. | |
| constexpr | UserAllocatedEvent (EventQueue *queue, F f, ArgTs... args) |
| Create an event. | |
| ~UserAllocatedEvent () | |
| Destructor for events. | |
| void | call () |
| Posts an event onto the underlying event queue, returning void. | |
| void | call_on (EventQueue *queue) |
| Posts an event onto the event queue passed as argument, returning void. | |
| bool | try_call () |
| Posts an event onto the underlying event queue. | |
| bool | try_call_on (EventQueue *queue) |
| Posts an event onto the event queue passed as argument,. | |
| void | operator() () |
| Posts an event onto the underlying event queue, returning void. | |
| void | delay (int delay) |
| Configure the delay of an event. | |
| void | period (int period) |
| Configure the period of an event. | |
| bool | cancel () |
| Cancels posted event. | |
| template<typename T , typename R > | |
| constexpr | UserAllocatedEvent (T *obj, R(T::*method)(ArgTs...), ArgTs... args) |
| Create an event. | |
| template<typename T , typename R > | |
| constexpr | UserAllocatedEvent (EventQueue *q, T *obj, R(T::*method)(ArgTs...), ArgTs... args) |
| Create an event. | |
| template<typename T , typename R > | |
| constexpr | UserAllocatedEvent (const T *obj, R(T::*method)(ArgTs...) const, ArgTs... args) |
| Create an event. | |
| template<typename T , typename R > | |
| constexpr | UserAllocatedEvent (EventQueue *q, const T *obj, R(T::*method)(ArgTs...) const, ArgTs... args) |
| Create an event. | |
| template<typename T , typename R > | |
| constexpr | UserAllocatedEvent (volatile T *obj, R(T::*method)(ArgTs...) volatile, ArgTs... args) |
| Create an event. | |
| template<typename T , typename R > | |
| constexpr | UserAllocatedEvent (EventQueue *q, volatile T *obj, R(T::*method)(ArgTs...) volatile, ArgTs... args) |
| Create an event. | |
| template<typename T , typename R > | |
| constexpr | UserAllocatedEvent (const volatile T *obj, R(T::*method)(ArgTs...) const volatile, ArgTs... args) |
| Create an event. | |
| template<typename T , typename R > | |
| constexpr | UserAllocatedEvent (EventQueue *q, const volatile T *obj, R(T::*method)(ArgTs...) const volatile, ArgTs... args) |
| Create an event. | |
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 71 of file UserAllocatedEvent.h.
|
constexpr |
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 84 of file UserAllocatedEvent.h.
|
constexpr |
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 98 of file UserAllocatedEvent.h.
| ~UserAllocatedEvent | ( | ) |
Destructor for events.
Definition at line 107 of file UserAllocatedEvent.h.
|
constexpr |
Create an event.
Definition at line 298 of file UserAllocatedEvent.h.
|
constexpr |
Create an event.
Definition at line 305 of file UserAllocatedEvent.h.
|
constexpr |
Create an event.
Definition at line 312 of file UserAllocatedEvent.h.
|
constexpr |
Create an event.
Definition at line 319 of file UserAllocatedEvent.h.
|
constexpr |
Create an event.
Definition at line 326 of file UserAllocatedEvent.h.
|
constexpr |
Create an event.
Definition at line 333 of file UserAllocatedEvent.h.
|
constexpr |
Create an event.
Definition at line 340 of file UserAllocatedEvent.h.
|
constexpr |
Create an event.
Definition at line 347 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 125 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 147 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 166 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 184 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 201 of file UserAllocatedEvent.h.
| void delay | ( | int | delay | ) |
Configure the delay of an event.
| delay | Millisecond delay before dispatching the event |
Definition at line 210 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 220 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 239 of file UserAllocatedEvent.h.