Commanders
Arduino buttons/bus library
|
#include "EventStack.hpp"
Public Member Functions | |
void | PushEvent (unsigned long inId, COMMANDERS_EVENT_TYPE inType, int inData) |
void | GetEvent (byte inIndex, unsigned long *inpId, COMMANDERS_EVENT_TYPE *inpType, int *inpData) |
byte | GetPendingEventIndex () |
Static Public Attributes | |
static EventStack | EventsStack |
The event stack is a small location for a few events ready to be send to the caller. This is a barely a list. If the 'id' for the given index is UNDEFINED_ID, so no event is defined at this index. Each RaiseEvent will be push the new one in the first free index of the list. Each PushEvent will returns the first not free event content, and free the event list for this index. There is no priority in the list...
Definition at line 19 of file EventStack.hpp.
void EventStack::GetEvent | ( | byte | inIndex, |
unsigned long * | inpId, | ||
COMMANDERS_EVENT_TYPE * | inpType, | ||
int * | inpData | ||
) |
Gets the given event from the stack, at the given index.
inIndex | index of the event to get. |
inpId | address to fill with the id of the event |
inpType | address to fill with the type |
inpData | address to fill with the associated data |
Definition at line 37 of file EventStack.cpp.
byte EventStack::GetPendingEventIndex | ( | ) |
Gets the first available event index in the stack. There is no history of stack filling, so the first one is not necessary the oldest in the list...
Definition at line 28 of file EventStack.cpp.
void EventStack::PushEvent | ( | unsigned long | inId, |
COMMANDERS_EVENT_TYPE | inType, | ||
int | inData | ||
) |
Add a new event to the stack.
inId | id of the event |
inType | type |
inData | associated data |
Definition at line 12 of file EventStack.cpp.
|
static |
Stack of events itself.
Definition at line 36 of file EventStack.hpp.