Commanders
Arduino buttons/bus library
EventStack Class Reference

#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
 

Detailed Description

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.

Member Function Documentation

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.

Parameters
inIndexindex of the event to get.
inpIdaddress to fill with the id of the event
inpTypeaddress to fill with the type
inpDataaddress to fill with the associated data
Remarks
A previous call to GetPendingEventIndex() will give the first available event index.

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.

Parameters
inIdid of the event
inTypetype
inDataassociated data

Definition at line 12 of file EventStack.cpp.

Member Data Documentation

EventStack EventStack::EventsStack
static

Stack of events itself.

Definition at line 36 of file EventStack.hpp.


The documentation for this class was generated from the following files: