#include "AccessoriesEventStack.hpp"
Public Member Functions | |
void | PushEvent (unsigned long inId, ACCESSORIES_EVENT_TYPE inType, int inData) |
void | GetEvent (unsigned long *inpId, ACCESSORIES_EVENT_TYPE *inpType, int *inpData) |
byte | GetFreeEventIndex () |
Static Public Attributes | |
static AccessoriesEventStack | 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. The defined events are always from index 0 to the last defined. Each PushEvent will be push the new one at the end of the list. Each GetEvent will always returns the first element of the list at index 0. If index 0 has its id at UNDEFINED_ID, so the list is empty... With this structure, this is a FIFO stack.
Function call | 0 | 1 | 2 |
---|---|---|---|
empty list | undef | undef | undef |
PushEvent A | A | undef | undef |
PushEvent B | A | B | undef |
GetEvent | B | undef | undef |
Definition at line 27 of file AccessoriesEventStack.hpp.
void AccessoriesEventStack::GetEvent | ( | unsigned long * | inpId, |
ACCESSORIES_EVENT_TYPE * | inpType, | ||
int * | inpData | ||
) |
Gets an event from the stack.
inpId | address to fill with the id of the event or UNDEFINED_ID if no event is available. |
inpType | address to fill with the type |
inpData | address to fill with the associated data |
Definition at line 41 of file AccessoriesEventStack.cpp.
byte AccessoriesEventStack::GetFreeEventIndex | ( | ) |
Gets the first free event index in the stack.
Definition at line 32 of file AccessoriesEventStack.cpp.
void AccessoriesEventStack::PushEvent | ( | unsigned long | inId, |
ACCESSORIES_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 16 of file AccessoriesEventStack.cpp.
|
static |
Stack of events itself.
Definition at line 44 of file AccessoriesEventStack.hpp.