sttcl  v0.9c
STTCL C++ template state machine framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sttcl::State< StateImpl, StateMachineImpl, IState > Class Template Reference

#include <State.h>

Inheritance diagram for sttcl::State< StateImpl, StateMachineImpl, IState >:
Collaboration diagram for sttcl::State< StateImpl, StateMachineImpl, IState >:

List of all members.

Public Types

typedef StateMachineImpl Context
typedef StateImpl Implementation
typedef StateBase
< StateMachineImpl, IState > 
StateBaseType
typedef void(Implementation::* StateDoAction )(Context *, bool)
- Public Types inherited from sttcl::StateBase< StateMachineImpl, IState >
typedef IState StateInterface

Public Member Functions

void entryImpl (Context *context)
void exitImpl (Context *context)
void startDoImpl (Context *context)
void endDoImpl (Context *context)
void finalizeSubStateMachinesImpl (bool recursive)
void initSubStateMachinesImpl (bool recursive)
bool checkDirectTransitionImpl (Context *context, bool &finalize, StateBaseType *&nextState)
- Public Member Functions inherited from sttcl::StateBase< StateMachineImpl, IState >
void changeStateImpl (Context *context, StateBase< StateMachineImpl, IState > *newState)
template<class StateMachineContext >
void changeStateImpl (StateMachineContext *context, StateBase< StateMachineImpl, IState > *newState)

Protected Member Functions

 State (StateDoAction argDoAction=0)
virtual ~State ()
void changeState (Context *context, StateBaseType *newState)
template<class StateMachineContext >
void changeState (StateMachineContext *context, StateBaseType *newState)
- Protected Member Functions inherited from sttcl::StateBase< StateMachineImpl, IState >
 StateBase ()
virtual ~StateBase ()

Protected Attributes

StateDoAction doAction

Detailed Description

template<class StateImpl, class StateMachineImpl, class IState>
class sttcl::State< StateImpl, StateMachineImpl, IState >

Represents a particular state machines state implementation base class.

Template Parameters:
StateImplThe state implementation type.
StateMachineThe state machine implementation type.
IStateSpecifies the internal interface of state implementations for the state machine.

Member Typedef Documentation

template<class StateImpl , class StateMachineImpl , class IState >
typedef StateMachineImpl sttcl::State< StateImpl, StateMachineImpl, IState >::Context

The state machine implementation type.

Reimplemented from sttcl::StateBase< StateMachineImpl, IState >.

template<class StateImpl , class StateMachineImpl , class IState >
typedef StateImpl sttcl::State< StateImpl, StateMachineImpl, IState >::Implementation

The implementation class type.

template<class StateImpl , class StateMachineImpl , class IState >
typedef StateBase<StateMachineImpl,IState> sttcl::State< StateImpl, StateMachineImpl, IState >::StateBaseType

The state base class type.

template<class StateImpl , class StateMachineImpl , class IState >
typedef void(Implementation::* sttcl::State< StateImpl, StateMachineImpl, IState >::StateDoAction)(Context *, bool)

The state do action type. The first parameter is a pointer to the containing state machine, the second parameter indicates that the state do action is called the first time when true.


Constructor & Destructor Documentation

template<class StateImpl , class StateMachineImpl , class IState >
sttcl::State< StateImpl, StateMachineImpl, IState >::State ( StateDoAction  argDoAction = 0)
inlineprotected

Constructor for class State.

Parameters:
argDoActionA pointer to the state do action.
template<class StateImpl , class StateMachineImpl , class IState >
virtual sttcl::State< StateImpl, StateMachineImpl, IState >::~State ( )
inlineprotectedvirtual

Destructor for class State.


Member Function Documentation

template<class StateImpl , class StateMachineImpl , class IState >
void sttcl::State< StateImpl, StateMachineImpl, IState >::changeState ( Context context,
StateBaseType newState 
)
inlineprotected

Changes context state machine to another sibling state.

Parameters:
contextA pointer to the containing state machine.
newStateA pointer to the sibling state to change to.
template<class StateImpl , class StateMachineImpl , class IState >
template<class StateMachineContext >
void sttcl::State< StateImpl, StateMachineImpl, IState >::changeState ( StateMachineContext *  context,
StateBaseType newState 
)
inlineprotected

Changes context state machine to another sibling state.

Parameters:
contextA pointer to the containing state machine.
newStateA pointer to the sibling state to change to.
template<class StateImpl , class StateMachineImpl , class IState >
bool sttcl::State< StateImpl, StateMachineImpl, IState >::checkDirectTransitionImpl ( Context context,
bool &  finalize,
StateBaseType *&  nextState 
)
inline

Default implementation for the getDirectTransitionImpl() method.

Parameters:
contextA pointer to the containing state machine.
nextStateReceives a pointer to the next sibling state to appear on a direct transition.
finalizeReceives true to finalize the containing state machine.
Returns:
true if a direct transition should be performed, false otherwise.
template<class StateImpl , class StateMachineImpl , class IState >
void sttcl::State< StateImpl, StateMachineImpl, IState >::endDoImpl ( Context context)
inline

Default implementation for the endDo() method.

Parameters:
contextA pointer to the containing state machine.
template<class StateImpl , class StateMachineImpl , class IState >
void sttcl::State< StateImpl, StateMachineImpl, IState >::entryImpl ( Context context)
inline

Default implementation for the entry() method.

Parameters:
contextA pointer to the containing state machine.
template<class StateImpl , class StateMachineImpl , class IState >
void sttcl::State< StateImpl, StateMachineImpl, IState >::exitImpl ( Context context)
inline

Default implementation for the exit() method.

Parameters:
contextA pointer to the containing state machine.
template<class StateImpl , class StateMachineImpl , class IState >
void sttcl::State< StateImpl, StateMachineImpl, IState >::finalizeSubStateMachinesImpl ( bool  recursive)
inline

Default implementation for the finalizeSubStateMachines() method.

Parameters:
recursiveIf true further sub state machines should be finalized recursively.
template<class StateImpl , class StateMachineImpl , class IState >
void sttcl::State< StateImpl, StateMachineImpl, IState >::initSubStateMachinesImpl ( bool  recursive)
inline

Default implementation for the initSubStateMachines() method.

Parameters:
recursiveIf true further sub state machines should be initialized recursively.
template<class StateImpl , class StateMachineImpl , class IState >
void sttcl::State< StateImpl, StateMachineImpl, IState >::startDoImpl ( Context context)
inline

Default implementation for the startDo() method.

Parameters:
contextA pointer to the containing state machine.

Member Data Documentation

template<class StateImpl , class StateMachineImpl , class IState >
StateDoAction sttcl::State< StateImpl, StateMachineImpl, IState >::doAction
protected

The state do action.


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