avr-classes
|
#include <queuedeventdispatcher.h>
Public Member Functions | |
virtual void | onEvent (const Event &event) override |
void | dispatch (void) |
bool | isIdle (void) |
![]() | |
bool | subscribe (EventReceiver *subscriber) |
void | unsubscribe (EventReceiver *subscriber) |
This component is able to receive events and puts them into a queue. When calling the dispatch() method, the events are sent to all subscribers. Since queuing and dispatching can happen from different contexts, the QueuedEventDispatcher can be used to decouple ISR context and main context.
SUBSCRIBERCOUNT | Maximum number of subscribers. |
QUEUESIZE | Maximum number of events that can be queued. |
|
inline |
Dispatches the events from the queue by sending each one to all subscribers.
|
inline |
Indicates if event queue is empty or requires dispatching.
|
inlineoverridevirtual |
Handler for incoming events. The passed event is put into the event queue. If the queue is full, the event is silently discarded.
event | Event to handle. |
Reimplemented from EventDispatcher< SUBSCRIBERCOUNT >.