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

FSM::SStateMachine< SState, SEvent, SFunctor, SUnknownEventStrategy > Class Template Reference

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

#include <fsm.h>

Collaboration diagram for FSM::SStateMachine< SState, SEvent, SFunctor, SUnknownEventStrategy >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SStateMachine (const StateType &StartState, const SStateMachineProxy< StateType, EventType > &ProxyMachine)
 The only way to cunstruct a state machine is to provide a complete description.
SStateMachineReset (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.
SStateMachineAcceptEvent (const EventType &Event)
 Accepts an event. First the transition will be executed and then the bound functions (if any) will be called.
SStateMachineoperator<< (const EventType &Event)
 Another way to accept an event. First the transition will be executed and then the bound functions (if any) will be called.
SStateMachineoperator<< (SMachineManipulator Manipulator)
 Process a machine manipulator.

Detailed Description

template<typename SState, typename SEvent, typename SFunctor = SEmptyFunctor<SState,SEvent>, typename SUnknownEventStrategy = SThrowStrategy<SEvent>>
class FSM::SStateMachine< SState, SEvent, SFunctor, SUnknownEventStrategy >

Finite state machine template which bounds functions to the states.

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

Definition at line 515 of file fsm.h.


Constructor & Destructor Documentation

template<typename SState, typename SEvent, typename SFunctor = SEmptyFunctor<SState,SEvent>, typename SUnknownEventStrategy = SThrowStrategy<SEvent>>
FSM::SStateMachine< SState, SEvent, SFunctor, SUnknownEventStrategy >::SStateMachine const StateType &  StartState,
const SStateMachineProxy< StateType, EventType > &  ProxyMachine
[inline]
 

The only way to cunstruct 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 553 of file fsm.h.


Member Function Documentation

template<typename SState, typename SEvent, typename SFunctor = SEmptyFunctor<SState,SEvent>, typename SUnknownEventStrategy = SThrowStrategy<SEvent>>
SStateMachine& FSM::SStateMachine< SState, SEvent, SFunctor, SUnknownEventStrategy >::AcceptEvent const 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 606 of file fsm.h.

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

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

Returns the current machine state.

Returns:
The current state.

Definition at line 594 of file fsm.h.

template<typename SState, typename SEvent, typename SFunctor = SEmptyFunctor<SState,SEvent>, typename SUnknownEventStrategy = SThrowStrategy<SEvent>>
SStateMachine& FSM::SStateMachine< SState, SEvent, SFunctor, 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 636 of file fsm.h.

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

Here is the call graph for this function:

template<typename SState, typename SEvent, typename SFunctor = SEmptyFunctor<SState,SEvent>, typename SUnknownEventStrategy = SThrowStrategy<SEvent>>
SStateMachine& FSM::SStateMachine< SState, SEvent, SFunctor, SUnknownEventStrategy >::operator<< const 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 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 628 of file fsm.h.

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

Here is the call graph for this function:

template<typename SState, typename SEvent, typename SFunctor = SEmptyFunctor<SState,SEvent>, typename SUnknownEventStrategy = SThrowStrategy<SEvent>>
SStateMachine& FSM::SStateMachine< SState, SEvent, SFunctor, 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 machine

Definition at line 581 of file fsm.h.

Referenced by FSM::SStateMachine< SState, SEvent, SFunctor, 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