sttcl
v0.9c
STTCL C++ template state machine framework
|
#include <StateMachine.h>
Classes | |
struct | StateMachineFlags |
Public Types | |
typedef StateMachineImpl | Context |
typedef IState | StateInterface |
typedef StateBase < StateMachineImpl, IState > | StateBaseClass |
Public Member Functions | |
~StateMachine () | |
bool | initialize (bool force=false) |
void | finalize (bool finalizeSubStateMachines=true) |
bool | isReady () const |
bool | isInitialized () const |
bool | isInitalizing () const |
bool | isFinalized () const |
bool | isFinalizing () const |
StateBaseClass * | getState () const |
bool | initializeImpl (bool force) |
void | finalizeImpl (bool finalizeSubStateMachines) |
void | subStateMachineCompleted (StateBaseClass *state) |
void | subStateMachineCompletedImpl (StateBaseClass *state) |
Protected Member Functions | |
StateMachine () | |
void | changeState (typename StateMachine< StateMachineImpl, IState >::StateBaseClass *newState) |
void | setState (StateBaseClass *newState) |
StateBaseClass * | getInitialState () const |
StateBaseClass * | getInitialStateImpl () const |
bool | isReadyImpl () const |
void | exitCurrentState () |
void | enterNewState () |
Friends | |
class | StateBase< StateMachineImpl, IState > |
Represents the base class for a state machine.
StateMachineImpl | Specifies the class implementing the state machine. |
IState | Specifies the internal interface of state implementations for the state machine. |
typedef StateMachineImpl sttcl::StateMachine< StateMachineImpl, IState >::Context |
The state machine implementation type.
Reimplemented in sttcl::Region< RegionImpl, RegionContainerImpl, IInnerState, EventArgs, HistoryType, StateThreadType, TimeDurationType, SemaphoreType, MutexType, EventQueueType >, and sttcl::CompositeState< Region< RegionImpl, RegionContainerImpl, IInnerState, EventArgs, HistoryType, StateThreadType, TimeDurationType, SemaphoreType, MutexType, EventQueueType >, RegionContainerImpl, IInnerState, HistoryType, ActiveState< Region< RegionImpl, RegionContainerImpl, IInnerState, EventArgs, HistoryType, StateThreadType, TimeDurationType, SemaphoreType, MutexType, EventQueueType >, RegionContainerImpl, IInnerState, StateThreadType, TimeDurationType, SemaphoreType, MutexType >, StateMachine< RegionImpl, IInnerState > >.
typedef StateBase<StateMachineImpl,IState> sttcl::StateMachine< StateMachineImpl, IState >::StateBaseClass |
The internal state implementation base type.
Reimplemented in sttcl::Region< RegionImpl, RegionContainerImpl, IInnerState, EventArgs, HistoryType, StateThreadType, TimeDurationType, SemaphoreType, MutexType, EventQueueType >.
typedef IState sttcl::StateMachine< StateMachineImpl, IState >::StateInterface |
The internal state implementation interface.
Reimplemented in sttcl::Region< RegionImpl, RegionContainerImpl, IInnerState, EventArgs, HistoryType, StateThreadType, TimeDurationType, SemaphoreType, MutexType, EventQueueType >, and sttcl::CompositeState< Region< RegionImpl, RegionContainerImpl, IInnerState, EventArgs, HistoryType, StateThreadType, TimeDurationType, SemaphoreType, MutexType, EventQueueType >, RegionContainerImpl, IInnerState, HistoryType, ActiveState< Region< RegionImpl, RegionContainerImpl, IInnerState, EventArgs, HistoryType, StateThreadType, TimeDurationType, SemaphoreType, MutexType, EventQueueType >, RegionContainerImpl, IInnerState, StateThreadType, TimeDurationType, SemaphoreType, MutexType >, StateMachine< RegionImpl, IInnerState > >.
|
inline |
Destructor for class StateMachine.
|
inlineprotected |
Constructor for class StateMachine.
|
protected |
Changes the state machines current state.
newState | The new target state. |
|
protected |
|
protected |
|
inline |
Finalizes the state machine.
finalizeSubStateMachines | Indicates to finalize any sub state machines. |
|
inline |
Default implementation for the finalize() method.
finalizeSubStateMachines | Indicates to finalize any sub state machines. |
Reimplemented in sttcl::Region< RegionImpl, RegionContainerImpl, IInnerState, EventArgs, HistoryType, StateThreadType, TimeDurationType, SemaphoreType, MutexType, EventQueueType >, and sttcl::CompositeState< Region< RegionImpl, RegionContainerImpl, IInnerState, EventArgs, HistoryType, StateThreadType, TimeDurationType, SemaphoreType, MutexType, EventQueueType >, RegionContainerImpl, IInnerState, HistoryType, ActiveState< Region< RegionImpl, RegionContainerImpl, IInnerState, EventArgs, HistoryType, StateThreadType, TimeDurationType, SemaphoreType, MutexType, EventQueueType >, RegionContainerImpl, IInnerState, StateThreadType, TimeDurationType, SemaphoreType, MutexType >, StateMachine< RegionImpl, IInnerState > >.
|
inlineprotected |
Gets the initial state of the state machine.
|
inlineprotected |
Default implementation for getInitialState().
|
inline |
Gets the current state.
|
inline |
Initializes the state machine.
force | Indicates to finalize the state machine before (re-)initializing. |
|
inline |
Default implementation for the initialize() method.
force | Indicates to finalize the state machine before (re-)initializing. |
Reimplemented in sttcl::Region< RegionImpl, RegionContainerImpl, IInnerState, EventArgs, HistoryType, StateThreadType, TimeDurationType, SemaphoreType, MutexType, EventQueueType >, and sttcl::CompositeState< Region< RegionImpl, RegionContainerImpl, IInnerState, EventArgs, HistoryType, StateThreadType, TimeDurationType, SemaphoreType, MutexType, EventQueueType >, RegionContainerImpl, IInnerState, HistoryType, ActiveState< Region< RegionImpl, RegionContainerImpl, IInnerState, EventArgs, HistoryType, StateThreadType, TimeDurationType, SemaphoreType, MutexType, EventQueueType >, RegionContainerImpl, IInnerState, StateThreadType, TimeDurationType, SemaphoreType, MutexType >, StateMachine< RegionImpl, IInnerState > >.
|
inline |
Indicates that the state machine is finalized.
true
if the state machine is finalized, false
otherwise.
|
inline |
Indicates that the state machine is currently finalizing.
true
if the state machine is currently finalizing, false
otherwise.
|
inline |
Indicates that the state machine is currently initializing.
true
if the state machine is currently initializing, false
otherwise.
|
inline |
Indicates that the state machine is initialized.
true
if the state machine is initialized, false
otherwise.
|
inline |
Indicates that the state machine is ready to process events.
true
if the state machine is ready to process events, false
otherwise.
|
inlineprotected |
Default implementation for isReady().
true
if the state machine is ready to process events, false
otherwise.
|
inlineprotected |
Sets the state machines current state without calling any state operations.
newState |
|
inline |
Called by a contained (composite) state when its sub state machine is completed (finalized).
state | A pointer to the contained (composite) state. |
|
inline |
The default implementation of the subStateMachineCompleted method.
state | A pointer to the contained (composite) state. |
|
friend |