Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

mpcl::automaton::TActionHandler< TState > Class Template Reference

#include <action_handler.hh>

Inheritance diagram for mpcl::automaton::TActionHandler< TState >:

List of all members.

Public Types

typedef std::list< TString > TActionNamesList
 Action names list type.


Public Methods

 TActionHandler (const unsigned int kuiRETRIES=1) throw (TIntegrityException)
virtual ~TActionHandler (void)
 Destroys the instance.

int execute (const TState &rktSTATE)
void setActions (const TState &rktSOURCE_STATE, const TActionNamesList &rktSOURCE_ACTION_NAMES_LIST)
TActionNamesList getActions (const TState &rktSOURCE_STATE) const

Protected Types

typedef std::list< IAction * > TActionList
 Pointer to action list type.

typedef TMap< TState, TActionListTStateToActionListMap
 Map with state to action lists bindings type.


Protected Attributes

TActionList tActionList
TStateToActionListMap tStateToActionListMap
 Map with state to action lists bindings.


Detailed Description

template<typename TState>
class mpcl::automaton::TActionHandler< TState >

Base action handler.

Action Handler is the part of a Deterministic Finite Automaton (DFA) that executes the list of actions of a given state. Every individual action has a 'reaction' or error handling function.

A DFA that lacks a list of actions behaves as a classic, pattern recognizing DFA.

Definition at line 62 of file action_handler.hh.


Constructor & Destructor Documentation

template<typename TState>
mpcl::automaton::TActionHandler< TState >::TActionHandler const unsigned int    kuiRETRIES = 1 throw (TIntegrityException) [inline]
 

Builds the instance with an optional retry value

Parameters:
rktSOURCE_ACTIONLIST  List of possible actions for the DFA.
kiRETRIES  (optional) Times to retry 'reactions' after a failed action.

Definition at line 124 of file action_handler.hh.


Member Function Documentation

template<typename TState>
int mpcl::automaton::TActionHandler< TState >::execute const TState &    rktSTATE [inline]
 

Executes the actions for a given state

Parameters:
rktSOURCE_STATE  The state

Definition at line 152 of file action_handler.hh.

Referenced by mpcl::automaton::TExecutableStreamableDfa< TState, TEvent >::move().

template<typename TState>
mpcl::automaton::TActionHandler< TState >::TActionNamesList mpcl::automaton::TActionHandler< TState >::getActions const TState &    rktSOURCE_STATE const
 

Gets the list of action names of a given state.

Returns:
The list of action names.

Definition at line 235 of file action_handler.hh.

References mpcl::automaton::TActionHandler< TState >::TActionNamesList, and mpcl::automaton::TActionHandler< TState >::tStateToActionListMap.

template<typename TState>
void mpcl::automaton::TActionHandler< TState >::setActions const TState &    rktSOURCE_STATE,
const TActionNamesList   rktSOURCE_ACTION_NAMES_LIST
 

Sets the actions for a given state.

Parameters:
rktSOURCE_STATE  The state.
rktSOURCE_ACTION_NAMES_LIST  Action list for the state.

Definition at line 265 of file action_handler.hh.

References mpcl::automaton::TActionHandler< TState >::tActionList, mpcl::automaton::TActionHandler< TState >::TActionList, and mpcl::automaton::TActionHandler< TState >::tStateToActionListMap.


Member Data Documentation

template<typename TState>
TActionList mpcl::automaton::TActionHandler< TState >::tActionList [protected]
 

List of possible actions for this DFA. This attribute musts be protected to allow sons to insert the proper actions.

Definition at line 87 of file action_handler.hh.

Referenced by mpcl::automaton::TActionHandler< TState >::setActions(), and mpcl::automaton::TActionHandler< int >::~TActionHandler().


The documentation for this class was generated from the following file:
Generated on Mon Oct 13 02:35:25 2003 for MPCL by doxygen1.2.18