COSA
An Object-Oriented Platform for Arduino Programming
|
#include <Listener.hh>
Public Member Functions | |
Listener (T key) | |
T | key () const |
void | key (T key) |
bool | match (T key) const |
void | detach () |
Linkage * | succ () const |
Linkage * | pred () const |
void | attach (Linkage *pred) |
virtual void | on_event (uint8_t type, uint16_t value) |
Static Public Member Functions | |
static void | dispatch (Head *head, T key, uint8_t type, uint16_t value) |
Protected Attributes | |
Linkage * | m_succ |
Linkage * | m_pred |
Template class for event listener. Allows dispatch of events onto a keyed set of listeners. The key data type must have assignment and at least operation== defined.
[in] | T | key type. |
Definition at line 33 of file Listener.hh.
Construct Listener.
[in] | key | default value for key. |
Definition at line 39 of file Listener.hh.
|
inlineinherited |
Attach given linkage as predecessor. Will check and detach if already attached.
[in] | pred | linkage to attach. |
Definition at line 71 of file Linkage.hh.
|
inlineinherited |
Detach this link. Unlink from any list.
Definition at line 125 of file Linkage.hh.
|
static |
Dispatch given event type/value to all listeners in queue which match the given key.
[in] | head | of queue. |
[in] | key | to match. |
[in] | type | of event. |
[in] | value | for event. |
Definition at line 89 of file Listener.hh.
|
inline |
|
inline |
|
inline |
Match Listener key with given value. Return true(1) if equal else false(0).
Definition at line 67 of file Listener.hh.
|
inlinevirtualinherited |
Default null event handler. Should be redefined by sub-classes. Called by Event::dispatch().
[in] | type | the event type. |
[in] | value | the event value. |
Reimplemented in Menu::RotaryController, Rotary::Dial< T >, AnalogPin, Job, TWI::Slave, ProtoThread, AnalogPins, and Periodic.
|
inlineinherited |
Return predecessor in sequence.
Definition at line 60 of file Linkage.hh.
|
inlineinherited |
|
protectedinherited |
Definition at line 94 of file Linkage.hh.
|
protectedinherited |
Double linked list pointers.
Definition at line 93 of file Linkage.hh.