avr-classes
|
#include <eventdispatcher.h>
Public Member Functions | |
bool | subscribe (EventReceiver *subscriber) |
void | unsubscribe (EventReceiver *subscriber) |
virtual void | onEvent (const Event &event) override |
This component is able to receive events and to forward them to a set of subscribers. The events are forwarded in the same context as they are received.
SUBSCRIBERCOUNT | Maximum number of subscribers. |
|
inlineoverridevirtual |
Dispatches event to all subscribers.
event | Event to dispatch. |
Implements EventReceiver.
Reimplemented in QueuedEventDispatcher< SUBSCRIBERCOUNT, QUEUESIZE >.
|
inline |
Subscribe to event dispatcher. Fails if already subscribed.
subscriber | Pointer to EventReceiver to add to the subscriber list. |
|
inline |
Remove existing subscription.
subscriber | Pointer to EventReceiver to remove from subscriber list. |