#include <streamable_dfa.hh>
Inheritance diagram for mpcl::automaton::TStreamableDfa< TState, TEvent >:
Public Types | |
typedef IStreamable::char_type | char_type |
Character type. | |
typedef IStreamable::traits_type | traits_type |
Traits type. | |
Public Methods | |
TStreamableDfa (TEventHandler< TEvent > &rtSOURCE_EVENT_HANDLER) | |
void | start (void) |
Starts the automaton. | |
bool | isFinal (const TString &rkySOURCE_STATE) const |
bool | isFinal (const char *pkcSOURCE_STATE) const |
Protected Types | |
typedef TDeterministicFiniteAutomaton< TState, TEvent >::TPair | TPair |
Imports class 'TPair'. | |
typedef TDeterministicFiniteAutomaton< TState, TEvent >::TTransitionMap | TTransitionMap |
Imports class 'TTransitionMap'. | |
typedef TDeterministicFiniteAutomaton< TState, TEvent >::TStateSet | TStateSet |
Imports class 'TStateSet'. | |
typedef TMap< TString, TEvent > | TStringToEventMap |
String to event map type. | |
typedef TMap< TString, TState > | TStringToStateMap |
String to state map type. | |
Protected Methods | |
void | read (std::basic_istream< char_type, traits_type > &rtSOURCE_ISTREAM) |
void | readFooter (TMatcher &rtSOURCE_REM) |
void | readHeader (TMatcher &rtSOURCE_REM) |
void | readTransitionTable (TMatcher &rtSOURCE_REM) |
virtual void | check (void) const |
Check invariants. | |
TString | eventToString (const TEvent &krtSOURCE_EVENT) const throw (TNotFoundException) |
TString | stateToString (const TState &krtSOURCE_STATE) const throw (TNotFoundException) |
void | write (std::basic_ostream< char_type, traits_type > &rtTARGET_OSTREAM) const |
void | writeFooter (std::basic_ostream< char_type, traits_type > &rtTARGET_OSTREAM) const |
void | writeHeader (std::basic_ostream< char_type, traits_type > &rtTARGET_OSTREAM) const |
void | writeTransitionTable (std::basic_ostream< char_type, traits_type > &rtTARGET_OSTREAM) const |
Protected Attributes | |
TEventHandler< TEvent > & | rtEventHandler |
Event handler. | |
TStringToEventMap | tStringToEventMap |
String to event map. | |
TStringToStateMap | tStringToStateMap |
String to state map. | |
TString | yDescription |
String with DESC-tag text. | |
TString | yName |
String with DFAML-tag attribute named 'name'. | |
TString | yPublic |
String with !DOCTYPE-tag attribute named 'public'. | |
TString | ySystem |
String with !DOCTYPE-tag attribute named 'system'. |
TState | State type name (must be an integer type like). |
TEvent | Event type name. |
Definition at line 61 of file streamable_dfa.hh.
|
Builds a new instance without loading any DFAML document. This is due to that at this stage, it has no information about states nor events. Definition at line 173 of file streamable_dfa.hh. |
|
Returns the string corresponding to event krtSOURCE_EVENT.
Definition at line 586 of file streamable_dfa.hh. Referenced by mpcl::automaton::TStreamableDfa< TState, TEvent >::writeTransitionTable(). |
|
Returns true if pkcSOURCE_STATE is a final state.
Definition at line 269 of file streamable_dfa.hh. |
|
Returns true if rkySOURCE_STATE is a final state.
Definition at line 259 of file streamable_dfa.hh. |
|
Reads the instance from stream rtSOURCE_STREAM.
Reimplemented in mpcl::automaton::TExecutableStreamableDfa< TState, TEvent >. Definition at line 287 of file streamable_dfa.hh. References mpcl::automaton::TStreamableDfa< TState, TEvent >::check(), mpcl::automaton::TStreamableDfa< TState, TEvent >::readFooter(), mpcl::automaton::TStreamableDfa< TState, TEvent >::readHeader(), mpcl::automaton::TStreamableDfa< TState, TEvent >::readTransitionTable(), mpcl::automaton::TDeterministicFiniteAutomaton< TState, TEvent >::tTransitionMap, and mpcl::automaton::TStreamableDfa< TState, TEvent >::yPublic. |
|
Reads footer using rtSOURCE_REM for parsing.
Definition at line 318 of file streamable_dfa.hh. Referenced by mpcl::automaton::TStreamableDfa< TState, TEvent >::read(), and mpcl::automaton::TExecutableStreamableDfa< TState, TEvent >::read(). |
|
Reads header using rtSOURCE_REM for parsing.
Definition at line 333 of file streamable_dfa.hh. References mpcl::automaton::TStreamableDfa< TState, TEvent >::yDescription, mpcl::automaton::TStreamableDfa< TState, TEvent >::yName, mpcl::automaton::TStreamableDfa< TState, TEvent >::yPublic, and mpcl::automaton::TStreamableDfa< TState, TEvent >::ySystem. Referenced by mpcl::automaton::TStreamableDfa< TState, TEvent >::read(), and mpcl::automaton::TExecutableStreamableDfa< TState, TEvent >::read(). |
|
Reads transition table using rtSOURCE_REM for parsing.
Definition at line 380 of file streamable_dfa.hh. References mpcl::automaton::TDeterministicFiniteAutomaton< TState, TEvent >::tFinalStateSet, mpcl::automaton::TDeterministicFiniteAutomaton< TState, TEvent >::tInitialState, mpcl::text::TString, mpcl::automaton::TStreamableDfa< TState, TEvent >::tStringToEventMap, mpcl::automaton::TStreamableDfa< TState, TEvent >::tStringToStateMap, and mpcl::automaton::TDeterministicFiniteAutomaton< TState, TEvent >::tTransitionMap. Referenced by mpcl::automaton::TStreamableDfa< TState, TEvent >::read(), and mpcl::automaton::TExecutableStreamableDfa< TState, TEvent >::read(). |
|
Starts the automaton. Map with state with input event to state name transitions type. It's used to hold the unresolved bindings from pairs of state and event, to state names. Definition at line 499 of file streamable_dfa.hh. References mpcl::automaton::TDeterministicFiniteAutomaton< TState, TEvent >::current(), mpcl::automaton::TDeterministicFiniteAutomaton< TState, TEvent >::move(), mpcl::automaton::TDeterministicFiniteAutomaton< TState, TEvent >::next(), mpcl::automaton::TStreamableDfa< TState, TEvent >::rtEventHandler, and mpcl::automaton::TDeterministicFiniteAutomaton< TState, TEvent >::tInitialState. |
|
Returns the string corresponding to state krtSOURCE_STATE.
Definition at line 611 of file streamable_dfa.hh. Referenced by mpcl::automaton::TStreamableDfa< TState, TEvent >::writeTransitionTable(). |
|
Writes the instance onto stream rtTARGET_OSTREAM.
Reimplemented in mpcl::automaton::TExecutableStreamableDfa< TState, TEvent >. Definition at line 217 of file streamable_dfa.hh. |
|
Writes footer onto stream rtTARGET_OSTREAM.
Definition at line 228 of file streamable_dfa.hh. Referenced by mpcl::automaton::TStreamableDfa< int, TTestEvent >::write(), and mpcl::automaton::TExecutableStreamableDfa< TState, TEvent >::write(). |
|
Writes header onto stream rtTARGET_OSTREAM.
Definition at line 636 of file streamable_dfa.hh. References mpcl::automaton::TStreamableDfa< TState, TEvent >::yDescription, mpcl::automaton::TStreamableDfa< TState, TEvent >::yName, mpcl::automaton::TStreamableDfa< TState, TEvent >::yPublic, and mpcl::automaton::TStreamableDfa< TState, TEvent >::ySystem. Referenced by mpcl::automaton::TStreamableDfa< int, TTestEvent >::write(), and mpcl::automaton::TExecutableStreamableDfa< TState, TEvent >::write(). |
|
Writes transition table onto stream rtTARGET_OSTREAM.
Definition at line 662 of file streamable_dfa.hh. References mpcl::automaton::TStreamableDfa< TState, TEvent >::eventToString(), mpcl::automaton::TStreamableDfa< TState, TEvent >::stateToString(), mpcl::automaton::TDeterministicFiniteAutomaton< TState, TEvent >::tFinalStateSet, mpcl::automaton::TDeterministicFiniteAutomaton< TState, TEvent >::tInitialState, mpcl::automaton::TStreamableDfa< TState, TEvent >::tStringToStateMap, and mpcl::automaton::TDeterministicFiniteAutomaton< TState, TEvent >::tTransitionMap. Referenced by mpcl::automaton::TStreamableDfa< int, TTestEvent >::write(), and mpcl::automaton::TExecutableStreamableDfa< TState, TEvent >::write(). |