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 index)
 
void Clear ()
 
void Delete (int inIndex)
 
unsigned char GetActionToExecute ()
 
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 75 of file ActionsStack.cpp.

void ActionsStack::Delete ( int  inIndex)

Remove the given index of the stack.

Parameters
inIndexindex to clear.

Definition at line 60 of file ActionsStack.cpp.

unsigned char ActionsStack::GetActionToExecute ( )

Get an action to execute.

Returns
action index or 255

Definition at line 50 of file ActionsStack.cpp.

int ActionsStack::GetNumber ( ) const

Get the number of available actions to execute.

Returns
action number.

Definition at line 82 of file ActionsStack.cpp.

Action* ActionsStack::operator[] ( unsigned char  index)
inline

Array operator.

Parameters
indexindex of the action to get.

Definition at line 52 of file ActionsStack.hpp.

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: