Go to the source code of this file.
Data Structures | |
struct | StateMachine |
This represent a StateMachine. More... | |
struct | State |
This represent a state. More... | |
struct | ParallelState |
This represent a state. More... | |
Enumerations | |
enum | DBG_DISP_ENUM { ALLOC_DBG = 1, DEALLOC_DBG = 2, REALLOC_DBG = 4, TRAN_LOOKING_DBG = 8, STATE_WORK_DBG = 16, STATE_OPT_DBG = 32, STATE_E_WORK_DBG = 64 } |
enumarate the available debug zones. More... | |
Functions | |
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. | |
StateMachine * | allocStateMachine (const char *name, const char *dbgPref) |
Allocate a new state machine. | |
ParallelState * | allocateParallelState (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. | |
void | makeDefault1 (State *state) |
Make the given state become the default state for its parent. | |
unsigned char | makeHistoryStateDefault (State *state, State *initialChild) |
Make the given state uses its history state as the default target for transition and initialize the history state with the given state. | |
void | setEntryWork (State *state, void(*onEnter)(void)) |
Make the given state executing the given funtion when entered. | |
void | setExitWork (State *state, void(*onExit)(void)) |
Make the given state executing the given funtion when exited. | |
void | allocateSpaceForStates (void *ptr, unsigned short int nbStates) |
Allow you to allocate manually space for the child states. | |
void | allocateSpaceForTransitions (State *state, unsigned short int nbTransition) |
Allow you to allocate manually space for new transitions. | |
unsigned char | addTransition (State *from, void *to, short int eventNum, unsigned char useHistory) |
This create a transition between the source and the target state. | |
unsigned char | startStateMachine (StateMachine *stateMachine) |
Start the given state machine and make it enter its first state. | |
void | sendEvent (StateMachine *stateMachine, short int event) |
Test if a transition should be triggered and trigger it if necessary. | |
void | setDbgParam (StateMachine *stateMachine, unsigned short int verboseFlag) |
This set a verbose flag that activate or deactivate some debug output. | |
void | rmDbgParam (StateMachine *stateMachine, unsigned short int verboseFlag) |
This unset a verbose flag that activate or deactivate some debug output. | |
void | displayStateMachine1 (StateMachine *stateMachine) |
Display the state machine. | |
void | displayStateMachine2 (StateMachine *stateMachine) |
Display the state machine. | |
short int | isConnected (State *from, State *to) |
Test if a transition exist between the given states. | |
void | displayCurrStateName (StateMachine *stateMachine) |
Display the name of the current state. |
enum DBG_DISP_ENUM |
enumarate the available debug zones.
Each of this enum cases correspond to a precise debug type. They should be used as flags and combinated to activate several debug types at the same time. If you doesn't want to use them as flags just make consecutive calls to the appropriate function.
void rmDbgParam(StateMachine* stateMachine, unsigned int verboseLevel)