Main Page | Namespace List | Class List | File List | Namespace Members | Class Members | File Members

FSM::SFuncStateMachine< SState, SEvent, SUnknownEventStrategy > Class Template Reference

Finite state machine template which bounds functions to the transitions. More...

#include <fsm.h>

Collaboration diagram for FSM::SFuncStateMachine< SState, SEvent, SUnknownEventStrategy >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SFuncStateMachine (const StateType &StartState, const SFuncStateMachineProxy< StateType, EventType > &ProxyMachine)
 The only way to construct a state machine is to provide a complete description.
SFuncStateMachineReset (void)
 Reset the machine to the initial state. Warning: no transition functions will be called if any.
StateType GetCurrentState (void) const
 Returns the current machine state.
SFuncStateMachineAcceptEvent (EventType &Event)
 Accepts an event. First the transition will be executed and then the bound functions (if any) will be called.
SFuncStateMachineoperator<< (EventType &Event)
 Another way to accept an event. First the transition will be executed and then the bound functions (if any) will be called.
SFuncStateMachineoperator<< (SMachineManipulator Manipulator)
 Process a machine manipulator.

Detailed Description

template<typename SState, typename SEvent, typename SUnknownEventStrategy = SThrowStrategy<SEvent>>
class FSM::SFuncStateMachine< SState, SEvent, SUnknownEventStrategy >

Finite state machine template which bounds functions to the transitions.

Parameters:
SState User defined state type.
SEvent User defined event type
SUnknownEventStrategy User defined strategy of reacting on the unknown event. Default strategy is throwing an exception.

Definition at line 981 of file fsm.h.


Constructor & Destructor Documentation

template<typename SState, typename SEvent, typename SUnknownEventStrategy = SThrowStrategy<SEvent>>
FSM::SFuncStateMachine< SState, SEvent, SUnknownEventStrategy >::SFuncStateMachine const StateType &  StartState,
const SFuncStateMachineProxy< StateType, EventType > &  ProxyMachine
[inline]
 

The only way to construct a state machine is to provide a complete description.

Parameters:
StartState Finite state machine start state
ProxyMachine The machine transition table
Exceptions:
SStateMachineException if any problem is found in the machine description.

Definition at line 1018 of file fsm.h.


Member Function Documentation

template<typename SState, typename SEvent, typename SUnknownEventStrategy = SThrowStrategy<SEvent>>
SFuncStateMachine& FSM::SFuncStateMachine< SState, SEvent, SUnknownEventStrategy >::AcceptEvent EventType &  Event  )  [inline]
 

Accepts an event. First the transition will be executed and then the bound functions (if any) will be called.

Parameters:
Event An event that should be processed.
Returns:
A reference to the machine itself.
Exceptions:
In case of any exception (default Unknown even strategy, user functor exception etc) the machine will be reset.

Definition at line 1069 of file fsm.h.

Referenced by FSM::SFuncStateMachine< SState, SEvent, SUnknownEventStrategy >::operator<<().

template<typename SState, typename SEvent, typename SUnknownEventStrategy = SThrowStrategy<SEvent>>
StateType FSM::SFuncStateMachine< SState, SEvent, SUnknownEventStrategy >::GetCurrentState void   )  const [inline]
 

Returns the current machine state.

Returns:
The current state.

Definition at line 1058 of file fsm.h.

template<typename SState, typename SEvent, typename SUnknownEventStrategy = SThrowStrategy<SEvent>>
SFuncStateMachine& FSM::SFuncStateMachine< SState, SEvent, SUnknownEventStrategy >::operator<< SMachineManipulator  Manipulator  )  [inline]
 

Process a machine manipulator.

Parameters:
Manipulator A manipulator to be processed.
Returns:
A reference to the machine itself.

Definition at line 1098 of file fsm.h.

References FSM::SFuncStateMachine< SState, SEvent, SUnknownEventStrategy >::Reset(), and FSM::ResetMachine.

Here is the call graph for this function:

template<typename SState, typename SEvent, typename SUnknownEventStrategy = SThrowStrategy<SEvent>>
SFuncStateMachine& FSM::SFuncStateMachine< SState, SEvent, SUnknownEventStrategy >::operator<< EventType &  Event  )  [inline]
 

Another way to accept an event. First the transition will be executed and then the bound functions (if any) will be called.

Parameters:
Event Event An event that should be processed.
Returns:
A reference to the machine itself.
Exceptions:
In case of any exception (default Unknown even strategy, user functor exception etc) the machine will be reset.

Definition at line 1090 of file fsm.h.

References FSM::SFuncStateMachine< SState, SEvent, SUnknownEventStrategy >::AcceptEvent().

Here is the call graph for this function:

template<typename SState, typename SEvent, typename SUnknownEventStrategy = SThrowStrategy<SEvent>>
SFuncStateMachine& FSM::SFuncStateMachine< SState, SEvent, SUnknownEventStrategy >::Reset void   )  [inline]
 

Reset the machine to the initial state. Warning: no transition functions will be called if any.

Returns:
A reference to the start state

Definition at line 1045 of file fsm.h.

Referenced by FSM::SFuncStateMachine< SState, SEvent, SUnknownEventStrategy >::operator<<().


The documentation for this class was generated from the following file:
Generated on Thu Sep 15 21:35:19 2005 for Finite State Machine C++ Templates by  doxygen 1.4.4