Allocation functions


Functions

StateallocateState (void *parent, const char *name, StateMachine *stateMachine)
 This allocate a new state and make it child of another state, a pointer on the new state is returned.
StateMachineallocStateMachine (const char *name, const char *dbgPref)
 Allocate a new state machine.
ParallelStateallocateParallelState (void *parent, unsigned short int nbChildStates, StateMachine *stateMachine, const char *name)
 Allocate a new ParallelState.
void freeStateMachine (StateMachine *stateMachine)
 This free everything that have been allocated for a state machine including childs states.

Function Documentation

ParallelState * allocateParallelState ( void *  parent,
unsigned short int  nbChildStates,
StateMachine stateMachine,
const char *  name 
)

Allocate a new ParallelState.

Parameters:
parent Another state, stateMachine or parallelState already allocated that will become the parent of the new ParallelState.
nbChildStates Exact number of child states that will be entered simultaneously.
stateMachine A valid pointer on the associated state machine.
name An optional name for the parallel state, helpful while debugging.
Returns:
The return value is a pointer on the newly allocated parallel state, it should never be freed manually.
Once you have allocated the parallel state, use the pointer to allocate the childs states that will be entered simultaneously.
Warning:
If you give a parent pointer pointing on something weird, you might have some surprises !!

State * allocateState ( void *  parent,
const char *  name,
StateMachine stateMachine 
)

This allocate a new state and make it child of another state, a pointer on the new state is returned.

Parameters:
parent Another state, stateMachine or parallelState already allocated that will become the parent of the new state.
name An optional name for the state, helpfull while debugging.
stateMachine A pointer on the associated state machine. (usefull only if parent is a Parallel state).
Returns:
The return value is a pointer on the newly allocated state, it should never be freed manually.
Warning:
If you give a parent pointer pointing on something weird, you might have some surprises !!

StateMachine * allocStateMachine ( const char *  name,
const char *  dbgPref 
)

Allocate a new state machine.

Parameters:
name The name of the state machine.
dbgPref A prefix that will be displayed before any debug output.
Returns:
The return value should be used to manage the state machine and must never be freed manually.
This allocate a empty state machine an return a pointer to manage it. The pointer musn't be freed by hand use the appropriate function instead. The two parameters are only usefull for debug purpose, jest put 'NULL' if not needed.
See also:
void freeStateMachine(StateMachine* stateMachine)

void freeStateMachine ( StateMachine stateMachine  ) 

This free everything that have been allocated for a state machine including childs states.

Parameters:
stateMachine A pointer on the state machine that should be freed.


Generated on Sat Sep 18 15:39:57 2010 for Easy C State Machine by  doxygen 1.5.8