7 #include "ActionsStack.hpp" 9 Action::Action(
unsigned long inId, ACCESSORIES_EVENT_TYPE inEvent,
int inData)
12 this->
Event = inEvent;
22 this->pList =
new Action*[inSize];
24 for (
int i = 0; i < this->size; i++)
26 this->pList[i] = NULL;
31 unsigned char ActionsStack::Add(
unsigned long inId, ACCESSORIES_EVENT_TYPE inEvent,
int inData)
33 for (
int i = 0; i < this->size; i++)
35 if (this->pList[i] == NULL)
37 this->pList[i] =
new Action(inId, inEvent, inData);
42 return this->size + 1;
47 for (
int i = 0; i < this->size; i++)
49 if (this->pList[i] != NULL)
51 Action *ret = this->pList[i];
52 this->pList[i] = NULL;
63 if (this->pList[inIndex] != NULL)
65 delete this->pList[inIndex];
66 this->pList[inIndex] = NULL;
73 for (
int i = 0; i < this->size; i++)
82 for (
int i = 0; i < this->size; i++)
84 if (this->pList[i] != NULL)
93 return this->pList[inIndex];
Action * operator[](unsigned char index)
Action * GetActionToExecute()
unsigned char Add(unsigned long inId, ACCESSORIES_EVENT_TYPE inEvent, int inData = 0)
#define ACTION_STACK_SIZE
ACCESSORIES_EVENT_TYPE Event
static ActionsStack Actions
Action(unsigned long inId, ACCESSORIES_EVENT_TYPE inEvent, int inData = 0)