Back to index

scribus-ng  1.3.4.dfsg+svn20071115
Public Types | Public Member Functions | Protected Attributes
automata::FA_base< STATE, INPUT, OUTPUT > Class Template Reference

#include <automata.h>

Inheritance diagram for automata::FA_base< STATE, INPUT, OUTPUT >:
Inheritance graph
[legend]
Collaboration diagram for automata::FA_base< STATE, INPUT, OUTPUT >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef std::map< INPUT, OUTPUT > Transitions

Public Member Functions

 FA_base (STATE s, OUTPUT d)
 FA_base (const std::set< STATE > &states, const std::set< INPUT > &inputs, STATE start, STATE deflt)
virtual ~FA_base ()
const std::set< STATE > & states () const
const std::set< INPUT > & inputs () const
const Transitionstransitions (STATE s) const
const STATE start () const
const OUTPUT deflt () const
const OUTPUT next (STATE from, INPUT input) const
void addState (STATE newState)
void addInput (INPUT newInput)
void setTransition (STATE from, INPUT input, OUTPUT to)

Protected Attributes

std::set< STATE > states_
std::set< INPUT > inputs_
std::map< STATE, Transitionstransitions_
const Transitions noTransitions
STATE start_
OUTPUT default_

Detailed Description

template<class STATE, class INPUT, class OUTPUT>
class automata::FA_base< STATE, INPUT, OUTPUT >

Definition at line 21 of file automata.h.


Member Typedef Documentation

template<class STATE, class INPUT, class OUTPUT>
typedef std::map<INPUT, OUTPUT> automata::FA_base< STATE, INPUT, OUTPUT >::Transitions

Definition at line 27 of file automata.h.


Constructor & Destructor Documentation

template<class STATE, class INPUT , class OUTPUT>
automata::FA_base< STATE, INPUT, OUTPUT >::FA_base ( STATE  s,
OUTPUT  d 
)

Definition at line 50 of file automata.h.

                                                        : states_(), inputs_(), transitions_(), noTransitions(), start_(s), default_(d) 
{ 
       states_.insert(s); 
}
template<class STATE, class INPUT, class OUTPUT>
automata::FA_base< STATE, INPUT, OUTPUT >::FA_base ( const std::set< STATE > &  states,
const std::set< INPUT > &  inputs,
STATE  start,
STATE  deflt 
)

Definition at line 56 of file automata.h.

                                                                                                                         : states_(states), inputs_(inputs), transitions_(), noTransitions(), start_(start), default_(deflt) 
{
       if (states_.find(start) == states_.end())
              states_.insert(start);      
}
template<class STATE , class INPUT , class OUTPUT >
automata::FA_base< STATE, INPUT, OUTPUT >::~FA_base ( ) [virtual]

Definition at line 191 of file automata.h.

{
       // clean up
}

Member Function Documentation

template<class STATE , class INPUT, class OUTPUT >
void automata::FA_base< STATE, INPUT, OUTPUT >::addInput ( INPUT  newInput)

Definition at line 223 of file automata.h.

{
       if (inputs_.find(newInput) == inputs_.end())
              inputs_.insert(newInput);
}
template<class STATE, class INPUT , class OUTPUT >
void automata::FA_base< STATE, INPUT, OUTPUT >::addState ( STATE  newState)

Definition at line 215 of file automata.h.

{
       if (states_.find(newState) == states_.end())
              states_.insert(newState);
}
template<class STATE , class INPUT , class OUTPUT >
const OUTPUT automata::FA_base< STATE, INPUT, OUTPUT >::deflt ( ) const

Definition at line 81 of file automata.h.

{ 
       return default_; 
}

Here is the caller graph for this function:

template<class STATE , class INPUT , class OUTPUT >
const std::set< INPUT > & automata::FA_base< STATE, INPUT, OUTPUT >::inputs ( ) const

Definition at line 69 of file automata.h.

{ 
       return inputs_; 
}

Here is the caller graph for this function:

template<class STATE, class INPUT, class OUTPUT >
const OUTPUT automata::FA_base< STATE, INPUT, OUTPUT >::next ( STATE  from,
INPUT  input 
) const

Definition at line 207 of file automata.h.

{
       const Transitions& tr(transitions(from));
       typename Transitions::const_iterator it = tr.find(input);
       return it==tr.end() ? default_ : it->second;
}

Here is the call graph for this function:

Here is the caller graph for this function:

template<class STATE, class INPUT, class OUTPUT>
void automata::FA_base< STATE, INPUT, OUTPUT >::setTransition ( STATE  from,
INPUT  input,
OUTPUT  to 
)

Definition at line 231 of file automata.h.

{
       Transitions& trans(transitions_[from]);
       trans[input] = to;
}
template<class STATE , class INPUT , class OUTPUT >
const STATE automata::FA_base< STATE, INPUT, OUTPUT >::start ( ) const

Definition at line 75 of file automata.h.

{ 
       return start_; 
}

Here is the caller graph for this function:

template<class STATE , class INPUT , class OUTPUT >
const std::set< STATE > & automata::FA_base< STATE, INPUT, OUTPUT >::states ( ) const

Definition at line 63 of file automata.h.

{ 
       return states_; 
}

Here is the caller graph for this function:

template<class STATE, class INPUT , class OUTPUT >
const FA_base< STATE, INPUT, OUTPUT >::Transitions & automata::FA_base< STATE, INPUT, OUTPUT >::transitions ( STATE  s) const

Definition at line 197 of file automata.h.

{ 
       typename std::map<STATE, Transitions>::const_iterator tr = transitions_.find(s);
       if (tr != transitions_.end())
              return tr->second;
       else
              return noTransitions; 
}

Here is the call graph for this function:


Member Data Documentation

template<class STATE, class INPUT, class OUTPUT>
OUTPUT automata::FA_base< STATE, INPUT, OUTPUT >::default_ [protected]

Definition at line 46 of file automata.h.

template<class STATE, class INPUT, class OUTPUT>
std::set<INPUT> automata::FA_base< STATE, INPUT, OUTPUT >::inputs_ [protected]

Definition at line 42 of file automata.h.

template<class STATE, class INPUT, class OUTPUT>
const Transitions automata::FA_base< STATE, INPUT, OUTPUT >::noTransitions [protected]

Definition at line 44 of file automata.h.

template<class STATE, class INPUT, class OUTPUT>
STATE automata::FA_base< STATE, INPUT, OUTPUT >::start_ [protected]

Definition at line 45 of file automata.h.

template<class STATE, class INPUT, class OUTPUT>
std::set<STATE> automata::FA_base< STATE, INPUT, OUTPUT >::states_ [protected]

Definition at line 41 of file automata.h.

template<class STATE, class INPUT, class OUTPUT>
std::map<STATE, Transitions> automata::FA_base< STATE, INPUT, OUTPUT >::transitions_ [protected]

Definition at line 43 of file automata.h.


The documentation for this class was generated from the following file: