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

mpcl::automaton::TDeterministicFiniteAutomaton< TState, TEvent > Class Template Reference

#include <deterministic_finite_automaton.hh>

Inheritance diagram for mpcl::automaton::TDeterministicFiniteAutomaton< TState, TEvent >:

mpcl::automaton::TStreamableDfa< TState, TEvent > mpcl::text::TDirectiveDFA< TState, TEvent > mpcl::automaton::TExecutableStreamableDfa< TState, TEvent > List of all members.

Public Methods

 TDeterministicFiniteAutomaton (void)
 Builds a new instance.

virtual ~TDeterministicFiniteAutomaton (void)
 Destroys the instance.

virtual void move (const TState &rktSTATE)
TState current (void) const
TState initial (void) const
virtual bool isFinal (const TState &rktSOURCE_STATE) const
const TState & next (const TEvent &rktSOURCE_EVENT) const throw (TNotFoundException)

Protected Types

typedef pair< TState, TEvent > TPair
 Pairs state with input event type.

typedef TMap< TPair, TState > TTransitionMap
 Map with state with input event to state transitions type.

typedef set< TState > TStateSet
 Set of final states type.


Protected Attributes

TState tCurrentState
 Current state (initially it musts contain initial state).

TStateSet tFinalStateSet
 Set of final states.

TState tInitialState
 Initial state.

TTransitionMap tTransitionMap
 Map with state with input event to state transitions.


Detailed Description

template<typename TState, typename TEvent>
class mpcl::automaton::TDeterministicFiniteAutomaton< TState, TEvent >

Deterministic Finite Automaton (DFA) class.

Definition at line 50 of file deterministic_finite_automaton.hh.


Member Function Documentation

template<typename TState, typename TEvent>
TState mpcl::automaton::TDeterministicFiniteAutomaton< TState, TEvent >::current void    const [inline]
 

Returns current state.

Returns:
Current state.

Definition at line 113 of file deterministic_finite_automaton.hh.

Referenced by mpcl::automaton::TStreamableDfa< TState, TEvent >::start().

template<typename TState, typename TEvent>
TState mpcl::automaton::TDeterministicFiniteAutomaton< TState, TEvent >::initial void    const [inline]
 

Returns initial state.

Returns:
Initial state.

Definition at line 122 of file deterministic_finite_automaton.hh.

template<typename TState, typename TEvent>
virtual bool mpcl::automaton::TDeterministicFiniteAutomaton< TState, TEvent >::isFinal const TState &    rktSOURCE_STATE const [inline, virtual]
 

Returns true if rktSOURCE_STATE is a final state.

Parameters:
rktSOURCE_STATE  Source state.
Returns:
True if rktSOURCE_STATE is a final state.

Definition at line 132 of file deterministic_finite_automaton.hh.

template<typename TState, typename TEvent>
virtual void mpcl::automaton::TDeterministicFiniteAutomaton< TState, TEvent >::move const TState &    rktSTATE [inline, virtual]
 

Move to the state ktSTATE.

Parameters:
rktSTATE  Next state.

Reimplemented in mpcl::automaton::TExecutableStreamableDfa< TState, TEvent >.

Definition at line 97 of file deterministic_finite_automaton.hh.

Referenced by mpcl::automaton::TStreamableDfa< TState, TEvent >::start().

template<typename TState, typename TEvent>
const TState& mpcl::automaton::TDeterministicFiniteAutomaton< TState, TEvent >::next const TEvent &    rktSOURCE_EVENT const throw (TNotFoundException) [inline]
 

Gets next state from current state and the input event rktSOURCE_EVENT.

Parameters:
rktSOURCE_EVENT  Source input event.
Returns:
The next state.
Exceptions:
TNotFoundException  If there is no next state.

Definition at line 144 of file deterministic_finite_automaton.hh.

Referenced by mpcl::automaton::TStreamableDfa< TState, TEvent >::start().


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