/home/olivier/src/StateMachine/dev_src/StateMachine.h File Reference

User accessible headers. More...

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

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.
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.


Detailed Description

User accessible headers.

Author:
olaporte
Date:
01/09/2010
Version:
2.0 This file contains every header and declaration that a common user need to have to work with the binary library.

Enumeration Type Documentation

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.

See also:
void setDbgParam(StateMachine* stateMachine, unsigned int verboseLevel)

void rmDbgParam(StateMachine* stateMachine, unsigned int verboseLevel)

Enumerator:
ALLOC_DBG  Any debug associated to node or transition creation
DEALLOC_DBG  Any debug associated to memory deallocation
REALLOC_DBG  Any debug associated to dynamique reallocation
TRAN_LOOKING_DBG  Any debug associated to transition research
STATE_WORK_DBG  Any debug associated to the basic state machine work
STATE_OPT_DBG  Any debug associated to the states organization
STATE_E_WORK_DBG  Any debug associated to the states external funtion calls


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