sttcl  v0.9c
STTCL C++ template state machine framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sttcl::CompositeState< CompositeStateImpl, StateMachineImpl, IInnerState, HistoryType, StateBaseImpl, StateMachineBaseImpl > Class Template Reference

#include <CompositeState.h>

Inheritance diagram for sttcl::CompositeState< CompositeStateImpl, StateMachineImpl, IInnerState, HistoryType, StateBaseImpl, StateMachineBaseImpl >:
Collaboration diagram for sttcl::CompositeState< CompositeStateImpl, StateMachineImpl, IInnerState, HistoryType, StateBaseImpl, StateMachineBaseImpl >:

List of all members.

Public Types

typedef CompositeStateImpl Implementation
typedef StateMachineImpl Context
typedef StateBaseImpl StateImplementationBase
typedef StateMachineBaseImpl StateMachineImplementationBase
typedef void(Implementation::* StateDoAction )(Context *, bool)
typedef
internal::CompositeStateBaseSelector
< HistoryType, typename
StateMachineBaseImpl::StateBaseClass >
::RESULT_TYPE 
CompositeStateHistoryBaseClass
typedef
StateMachineBaseImpl::StateBaseClass 
InnerStateClass
typedef
StateMachineImpl::StateInterface 
OuterStateInterface
typedef
StateMachineBaseImpl::StateInterface 
StateInterface

Public Member Functions

 CompositeState (StateDoAction argDoAction=0)
virtual ~CompositeState ()
void changeState (InnerStateClass *newState)
bool initializeImpl (bool force)
void finalizeImpl (bool finalizeSubStateMachines)
void subStateMachineCompletedImpl ()
void subStateMachineCompleted ()
void entryImpl (Context *context)
void exitImpl (Context *context)

Protected Member Functions

void changeState (Context *context, StateBase< StateMachineImpl, OuterStateInterface > *newState)
virtual void finalizeSubStateMachines (bool recursive)
virtual void initSubStateMachines (bool recursive)
- Protected Member Functions inherited from sttcl::internal::CompositeStateBase< InnerStateType >
 CompositeStateBase ()
 ~CompositeStateBase ()
void saveCurrentState (InnerStateType *currentState)
InnerStateType * getStateHistory ()
template<class CompositeStateImpl >
InnerStateType * resumeStateHistory (CompositeStateImpl *compositeState)
template<class CompositeStateImpl >
InnerStateType * finalizeStateHistory (CompositeStateImpl *compositeState)

Detailed Description

template<class CompositeStateImpl, class StateMachineImpl, class IInnerState, CompositeStateHistoryType::Values HistoryType = CompositeStateHistoryType::None, class StateBaseImpl = State<CompositeStateImpl,StateMachineImpl,typename StateMachineImpl::StateInterface>, class StateMachineBaseImpl = StateMachine<CompositeStateImpl, IInnerState>>
class sttcl::CompositeState< CompositeStateImpl, StateMachineImpl, IInnerState, HistoryType, StateBaseImpl, StateMachineBaseImpl >

Represents the base class for a composite state implementation.

Template Parameters:
CompositeStateImplThe implementing class.
StateMachineImplThe implementing class.
IInnerStateThe inner state's interface class type.
HistoryTypeThe composite states history pseudo state type.
StateBaseImplThe composite states base state implementation type.
StateMachineBaseImplThe composite states base state machine implementation type.

Member Typedef Documentation

template<class CompositeStateImpl, class StateMachineImpl, class IInnerState, CompositeStateHistoryType::Values HistoryType = CompositeStateHistoryType::None, class StateBaseImpl = State<CompositeStateImpl,StateMachineImpl,typename StateMachineImpl::StateInterface>, class StateMachineBaseImpl = StateMachine<CompositeStateImpl, IInnerState>>
typedef internal::CompositeStateBaseSelector<HistoryType,typename StateMachineBaseImpl::StateBaseClass>::RESULT_TYPE sttcl::CompositeState< CompositeStateImpl, StateMachineImpl, IInnerState, HistoryType, StateBaseImpl, StateMachineBaseImpl >::CompositeStateHistoryBaseClass
template<class CompositeStateImpl, class StateMachineImpl, class IInnerState, CompositeStateHistoryType::Values HistoryType = CompositeStateHistoryType::None, class StateBaseImpl = State<CompositeStateImpl,StateMachineImpl,typename StateMachineImpl::StateInterface>, class StateMachineBaseImpl = StateMachine<CompositeStateImpl, IInnerState>>
typedef StateMachineImpl sttcl::CompositeState< CompositeStateImpl, StateMachineImpl, IInnerState, HistoryType, StateBaseImpl, StateMachineBaseImpl >::Context
template<class CompositeStateImpl, class StateMachineImpl, class IInnerState, CompositeStateHistoryType::Values HistoryType = CompositeStateHistoryType::None, class StateBaseImpl = State<CompositeStateImpl,StateMachineImpl,typename StateMachineImpl::StateInterface>, class StateMachineBaseImpl = StateMachine<CompositeStateImpl, IInnerState>>
typedef CompositeStateImpl sttcl::CompositeState< CompositeStateImpl, StateMachineImpl, IInnerState, HistoryType, StateBaseImpl, StateMachineBaseImpl >::Implementation
template<class CompositeStateImpl, class StateMachineImpl, class IInnerState, CompositeStateHistoryType::Values HistoryType = CompositeStateHistoryType::None, class StateBaseImpl = State<CompositeStateImpl,StateMachineImpl,typename StateMachineImpl::StateInterface>, class StateMachineBaseImpl = StateMachine<CompositeStateImpl, IInnerState>>
typedef StateMachineBaseImpl::StateBaseClass sttcl::CompositeState< CompositeStateImpl, StateMachineImpl, IInnerState, HistoryType, StateBaseImpl, StateMachineBaseImpl >::InnerStateClass
template<class CompositeStateImpl, class StateMachineImpl, class IInnerState, CompositeStateHistoryType::Values HistoryType = CompositeStateHistoryType::None, class StateBaseImpl = State<CompositeStateImpl,StateMachineImpl,typename StateMachineImpl::StateInterface>, class StateMachineBaseImpl = StateMachine<CompositeStateImpl, IInnerState>>
typedef StateMachineImpl::StateInterface sttcl::CompositeState< CompositeStateImpl, StateMachineImpl, IInnerState, HistoryType, StateBaseImpl, StateMachineBaseImpl >::OuterStateInterface
template<class CompositeStateImpl, class StateMachineImpl, class IInnerState, CompositeStateHistoryType::Values HistoryType = CompositeStateHistoryType::None, class StateBaseImpl = State<CompositeStateImpl,StateMachineImpl,typename StateMachineImpl::StateInterface>, class StateMachineBaseImpl = StateMachine<CompositeStateImpl, IInnerState>>
typedef void(Implementation::* sttcl::CompositeState< CompositeStateImpl, StateMachineImpl, IInnerState, HistoryType, StateBaseImpl, StateMachineBaseImpl >::StateDoAction)(Context *, bool)
template<class CompositeStateImpl, class StateMachineImpl, class IInnerState, CompositeStateHistoryType::Values HistoryType = CompositeStateHistoryType::None, class StateBaseImpl = State<CompositeStateImpl,StateMachineImpl,typename StateMachineImpl::StateInterface>, class StateMachineBaseImpl = StateMachine<CompositeStateImpl, IInnerState>>
typedef StateBaseImpl sttcl::CompositeState< CompositeStateImpl, StateMachineImpl, IInnerState, HistoryType, StateBaseImpl, StateMachineBaseImpl >::StateImplementationBase
template<class CompositeStateImpl, class StateMachineImpl, class IInnerState, CompositeStateHistoryType::Values HistoryType = CompositeStateHistoryType::None, class StateBaseImpl = State<CompositeStateImpl,StateMachineImpl,typename StateMachineImpl::StateInterface>, class StateMachineBaseImpl = StateMachine<CompositeStateImpl, IInnerState>>
typedef StateMachineBaseImpl::StateInterface sttcl::CompositeState< CompositeStateImpl, StateMachineImpl, IInnerState, HistoryType, StateBaseImpl, StateMachineBaseImpl >::StateInterface
template<class CompositeStateImpl, class StateMachineImpl, class IInnerState, CompositeStateHistoryType::Values HistoryType = CompositeStateHistoryType::None, class StateBaseImpl = State<CompositeStateImpl,StateMachineImpl,typename StateMachineImpl::StateInterface>, class StateMachineBaseImpl = StateMachine<CompositeStateImpl, IInnerState>>
typedef StateMachineBaseImpl sttcl::CompositeState< CompositeStateImpl, StateMachineImpl, IInnerState, HistoryType, StateBaseImpl, StateMachineBaseImpl >::StateMachineImplementationBase

The composite states base state machine implementation type class.


Constructor & Destructor Documentation

template<class CompositeStateImpl, class StateMachineImpl, class IInnerState, CompositeStateHistoryType::Values HistoryType = CompositeStateHistoryType::None, class StateBaseImpl = State<CompositeStateImpl,StateMachineImpl,typename StateMachineImpl::StateInterface>, class StateMachineBaseImpl = StateMachine<CompositeStateImpl, IInnerState>>
sttcl::CompositeState< CompositeStateImpl, StateMachineImpl, IInnerState, HistoryType, StateBaseImpl, StateMachineBaseImpl >::CompositeState ( StateDoAction  argDoAction = 0)
inline

Constructor for class CompositeState.

Parameters:
argDoActionThe composite state do action.
template<class CompositeStateImpl, class StateMachineImpl, class IInnerState, CompositeStateHistoryType::Values HistoryType = CompositeStateHistoryType::None, class StateBaseImpl = State<CompositeStateImpl,StateMachineImpl,typename StateMachineImpl::StateInterface>, class StateMachineBaseImpl = StateMachine<CompositeStateImpl, IInnerState>>
virtual sttcl::CompositeState< CompositeStateImpl, StateMachineImpl, IInnerState, HistoryType, StateBaseImpl, StateMachineBaseImpl >::~CompositeState ( )
inlinevirtual

Destructor for class CompositeState.


Member Function Documentation

template<class CompositeStateImpl, class StateMachineImpl, class IInnerState, CompositeStateHistoryType::Values HistoryType = CompositeStateHistoryType::None, class StateBaseImpl = State<CompositeStateImpl,StateMachineImpl,typename StateMachineImpl::StateInterface>, class StateMachineBaseImpl = StateMachine<CompositeStateImpl, IInnerState>>
void sttcl::CompositeState< CompositeStateImpl, StateMachineImpl, IInnerState, HistoryType, StateBaseImpl, StateMachineBaseImpl >::changeState ( InnerStateClass newState)
inline

Changes the composite state machine to newState.

Parameters:
newStateThe inner state to change to.
template<class CompositeStateImpl, class StateMachineImpl, class IInnerState, CompositeStateHistoryType::Values HistoryType = CompositeStateHistoryType::None, class StateBaseImpl = State<CompositeStateImpl,StateMachineImpl,typename StateMachineImpl::StateInterface>, class StateMachineBaseImpl = StateMachine<CompositeStateImpl, IInnerState>>
void sttcl::CompositeState< CompositeStateImpl, StateMachineImpl, IInnerState, HistoryType, StateBaseImpl, StateMachineBaseImpl >::changeState ( Context context,
StateBase< StateMachineImpl, OuterStateInterface > *  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 CompositeStateImpl, class StateMachineImpl, class IInnerState, CompositeStateHistoryType::Values HistoryType = CompositeStateHistoryType::None, class StateBaseImpl = State<CompositeStateImpl,StateMachineImpl,typename StateMachineImpl::StateInterface>, class StateMachineBaseImpl = StateMachine<CompositeStateImpl, IInnerState>>
void sttcl::CompositeState< CompositeStateImpl, StateMachineImpl, IInnerState, HistoryType, StateBaseImpl, StateMachineBaseImpl >::entryImpl ( Context context)
inline

Called when this state is entered.

Parameters:
contextThe state machine context.
template<class CompositeStateImpl, class StateMachineImpl, class IInnerState, CompositeStateHistoryType::Values HistoryType = CompositeStateHistoryType::None, class StateBaseImpl = State<CompositeStateImpl,StateMachineImpl,typename StateMachineImpl::StateInterface>, class StateMachineBaseImpl = StateMachine<CompositeStateImpl, IInnerState>>
void sttcl::CompositeState< CompositeStateImpl, StateMachineImpl, IInnerState, HistoryType, StateBaseImpl, StateMachineBaseImpl >::exitImpl ( Context context)
inline

Called when this state is left.

Parameters:
contextThe state machine context.
template<class CompositeStateImpl, class StateMachineImpl, class IInnerState, CompositeStateHistoryType::Values HistoryType = CompositeStateHistoryType::None, class StateBaseImpl = State<CompositeStateImpl,StateMachineImpl,typename StateMachineImpl::StateInterface>, class StateMachineBaseImpl = StateMachine<CompositeStateImpl, IInnerState>>
void sttcl::CompositeState< CompositeStateImpl, StateMachineImpl, IInnerState, HistoryType, StateBaseImpl, StateMachineBaseImpl >::finalizeImpl ( bool  finalizeSubStateMachines)
inline

Default implementation for the finalize() method.

Parameters:
finalizeSubStateMachinesIndicates to finalize any sub state machines.

Reimplemented in sttcl::Region< RegionImpl, RegionContainerImpl, IInnerState, EventArgs, HistoryType, StateThreadType, TimeDurationType, SemaphoreType, MutexType, EventQueueType >.

template<class CompositeStateImpl, class StateMachineImpl, class IInnerState, CompositeStateHistoryType::Values HistoryType = CompositeStateHistoryType::None, class StateBaseImpl = State<CompositeStateImpl,StateMachineImpl,typename StateMachineImpl::StateInterface>, class StateMachineBaseImpl = StateMachine<CompositeStateImpl, IInnerState>>
virtual void sttcl::CompositeState< CompositeStateImpl, StateMachineImpl, IInnerState, HistoryType, StateBaseImpl, StateMachineBaseImpl >::finalizeSubStateMachines ( bool  recursive)
inlineprotectedvirtual

Called by the containing StateMachine to finalize any sub state machines.

Parameters:
recursiveIf true further sub state machines should be finalized recursively.
template<class CompositeStateImpl, class StateMachineImpl, class IInnerState, CompositeStateHistoryType::Values HistoryType = CompositeStateHistoryType::None, class StateBaseImpl = State<CompositeStateImpl,StateMachineImpl,typename StateMachineImpl::StateInterface>, class StateMachineBaseImpl = StateMachine<CompositeStateImpl, IInnerState>>
bool sttcl::CompositeState< CompositeStateImpl, StateMachineImpl, IInnerState, HistoryType, StateBaseImpl, StateMachineBaseImpl >::initializeImpl ( bool  force)
inline

Default implementation for the initialize() method.

Parameters:
forceIndicates to finalize the state machine before (re-)initializing.
Returns:
The ready state of the state machine.

Reimplemented in sttcl::Region< RegionImpl, RegionContainerImpl, IInnerState, EventArgs, HistoryType, StateThreadType, TimeDurationType, SemaphoreType, MutexType, EventQueueType >.

template<class CompositeStateImpl, class StateMachineImpl, class IInnerState, CompositeStateHistoryType::Values HistoryType = CompositeStateHistoryType::None, class StateBaseImpl = State<CompositeStateImpl,StateMachineImpl,typename StateMachineImpl::StateInterface>, class StateMachineBaseImpl = StateMachine<CompositeStateImpl, IInnerState>>
virtual void sttcl::CompositeState< CompositeStateImpl, StateMachineImpl, IInnerState, HistoryType, StateBaseImpl, StateMachineBaseImpl >::initSubStateMachines ( bool  recursive)
inlineprotectedvirtual

Called by the containing StateMachine to initialize any sub state machines.

Parameters:
recursiveIf true further sub state machines should be initialized recursively.
template<class CompositeStateImpl, class StateMachineImpl, class IInnerState, CompositeStateHistoryType::Values HistoryType = CompositeStateHistoryType::None, class StateBaseImpl = State<CompositeStateImpl,StateMachineImpl,typename StateMachineImpl::StateInterface>, class StateMachineBaseImpl = StateMachine<CompositeStateImpl, IInnerState>>
void sttcl::CompositeState< CompositeStateImpl, StateMachineImpl, IInnerState, HistoryType, StateBaseImpl, StateMachineBaseImpl >::subStateMachineCompleted ( )
inline

Notifies the implementation class when the sub state machine has finished.

template<class CompositeStateImpl, class StateMachineImpl, class IInnerState, CompositeStateHistoryType::Values HistoryType = CompositeStateHistoryType::None, class StateBaseImpl = State<CompositeStateImpl,StateMachineImpl,typename StateMachineImpl::StateInterface>, class StateMachineBaseImpl = StateMachine<CompositeStateImpl, IInnerState>>
void sttcl::CompositeState< CompositeStateImpl, StateMachineImpl, IInnerState, HistoryType, StateBaseImpl, StateMachineBaseImpl >::subStateMachineCompletedImpl ( )
inline

Default implementation of the subStateMachineCompleted() method.


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