Accessories
Arduino for motors and lights library.
ActionsStack Class Reference

#include "ActionsStack.hpp"

Public Member Functions

 ActionsStack (int inSize)
 
unsigned char Add (unsigned long inId, ACCESSORIES_EVENT_TYPE inEvent, int inData = 0)
 
Actionoperator[] (unsigned char idx)
 
void Clear ()
 
void Delete (int inIndex)
 
ActionGetActionToExecute ()
 
int GetNumber () const
 

Static Public Attributes

static ActionsStack Actions
 
static bool FillingStack
 

Detailed Description

This class is a small list of available actions. When the stack reach the size, new actions are lost...

Definition at line 31 of file ActionsStack.hpp.

Constructor & Destructor Documentation

ActionsStack::ActionsStack ( int  inSize)

Default constructor.

Definition at line 19 of file ActionsStack.cpp.

Member Function Documentation

unsigned char ActionsStack::Add ( unsigned long  inId,
ACCESSORIES_EVENT_TYPE  inEvent,
int  inData = 0 
)

Add a new action.

Parameters
inIdId of the accessory
inEventEvent type
inDataAssociated data for this event. Default is 0.
Returns
Index of the new action or 'size of the stack+1' if the stack is full.
Remarks
If the stack is full, this event will be lost.

Definition at line 31 of file ActionsStack.cpp.

void ActionsStack::Clear ( )

Clears the complete stack.

Definition at line 71 of file ActionsStack.cpp.

void ActionsStack::Delete ( int  inIndex)

Remove the given index of the stack.

Parameters
inIndexindex to clear.

Definition at line 61 of file ActionsStack.cpp.

Action * ActionsStack::GetActionToExecute ( )

Get an action to execute.

Returns
action address or NULL

Definition at line 45 of file ActionsStack.cpp.

int ActionsStack::GetNumber ( ) const

Get the number of available actions to execute.

Returns
action number.

Definition at line 78 of file ActionsStack.cpp.

Action * ActionsStack::operator[] ( unsigned char  idx)

Array operator.

Parameters
idxindex of the action to get.

Definition at line 91 of file ActionsStack.cpp.

Member Data Documentation

ActionsStack ActionsStack::Actions
static

Static list of actions.

Definition at line 69 of file ActionsStack.hpp.

bool ActionsStack::FillingStack
static

If this flag is false, the event are not added t the list.

Definition at line 71 of file ActionsStack.hpp.


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