Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

State_t< EVENT > Class Template Reference

A State in an FSA. More...

#include <fsa.H>

Collaboration diagram for State_t< EVENT >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef Arc_t< EVENT > arc_type

Public Member Functions

 State_t ()
 State_t (Cstr_ptr &n)
int is_empty ()
void operator+= (const State_t< EVENT > &s)
void operator-= (const State_t< EVENT > &s)
void operator+= (const Arc_t< EVENT > &a)
void operator-= (const Arc_t< EVENT > &a)
int consumes (const EVENT &e) const
State_t< EVENT > * event (const EVENT &e, State_t< EVENT > *start=0, int *ret=0) const
 Process the event, returning the next state. If requested, return the result of the callback in ret.
void clear ()
const ARRAY< arc_type > & arcs () const
ARRAY< arc_type > & arcs ()
Cstr_ptr & name () const
void set_name (Cstr_ptr &n)
int operator== (const State_t< EVENT > &a) const

Private Attributes

ARRAY< arc_type_arcs
str_ptr _name

Detailed Description

template<class EVENT>
class State_t< EVENT >

A State in an FSA.

The State may contain multiple Arcs. Only one Arc out of a State will be traversed. When an Event is passed to a state, each Arc will be matched to the Event. The first Arc that matches the Event is traversed.

Definition at line 243 of file fsa.H.


Member Typedef Documentation

template<class EVENT>
typedef Arc_t<EVENT> State_t< EVENT >::arc_type
 

Definition at line 247 of file fsa.H.


Constructor & Destructor Documentation

template<class EVENT>
State_t< EVENT >::State_t  )  [inline]
 

Definition at line 249 of file fsa.H.

template<class EVENT>
State_t< EVENT >::State_t Cstr_ptr &  n  )  [inline]
 

Definition at line 250 of file fsa.H.


Member Function Documentation

template<class EVENT>
ARRAY<arc_type>& State_t< EVENT >::arcs  )  [inline]
 

Definition at line 274 of file fsa.H.

References State_t< EVENT >::_arcs.

template<class EVENT>
const ARRAY<arc_type>& State_t< EVENT >::arcs  )  const [inline]
 

Definition at line 273 of file fsa.H.

References State_t< EVENT >::_arcs.

template<class EVENT>
void State_t< EVENT >::clear void   )  [inline]
 

Definition at line 271 of file fsa.H.

References State_t< EVENT >::_arcs, and ARRAY< T >::clear().

template<class EVENT>
int State_t< EVENT >::consumes const EVENT &  e  )  const [inline]
 

Definition at line 262 of file fsa.H.

References State_t< EVENT >::_arcs, and ARRAY< T >::num().

Referenced by MMENU::invoke().

template<class EVENT>
State_t< EVENT > * State_t< EVENT >::event const EVENT &  e,
State_t< EVENT > *  start = 0,
int *  ret = 0
const
 

Process the event, returning the next state. If requested, return the result of the callback in ret.

Definition at line 355 of file fsa.H.

References State_t< EVENT >::_arcs, and ARRAY< T >::num().

Referenced by MMENU::invoke().

template<class EVENT>
int State_t< EVENT >::is_empty  )  [inline]
 

Definition at line 252 of file fsa.H.

References State_t< EVENT >::_arcs, and ARRAY< T >::num().

template<class EVENT>
Cstr_ptr& State_t< EVENT >::name  )  const [inline]
 

Definition at line 276 of file fsa.H.

References State_t< EVENT >::_name.

template<class EVENT>
void State_t< EVENT >::operator+= const Arc_t< EVENT > &  a  )  [inline]
 

Definition at line 257 of file fsa.H.

References State_t< EVENT >::_arcs, Arc_t< EVENT >::guarded(), and ARRAY< T >::push().

template<class EVENT>
void State_t< EVENT >::operator+= const State_t< EVENT > &  s  ) 
 

Definition at line 291 of file fsa.H.

References State_t< EVENT >::_arcs, j, ARRAY< T >::num(), and ARRAY< T >::push().

template<class EVENT>
void State_t< EVENT >::operator-= const Arc_t< EVENT > &  a  )  [inline]
 

Definition at line 260 of file fsa.H.

References State_t< EVENT >::_arcs.

template<class EVENT>
void State_t< EVENT >::operator-= const State_t< EVENT > &  s  ) 
 

Definition at line 331 of file fsa.H.

References State_t< EVENT >::_arcs, j, ARRAY< T >::num(), and ARRAY< T >::remove().

template<class EVENT>
int State_t< EVENT >::operator== const State_t< EVENT > &  a  )  const [inline]
 

Definition at line 279 of file fsa.H.

template<class EVENT>
void State_t< EVENT >::set_name Cstr_ptr &  n  )  [inline]
 

Definition at line 277 of file fsa.H.

References State_t< EVENT >::_name.

Referenced by FilmTrans::FilmTrans(), Key_int::Key_int(), Pen::Pen(), and Simple_int::Simple_int().


Member Data Documentation

template<class EVENT>
ARRAY<arc_type> State_t< EVENT >::_arcs [private]
 

Definition at line 284 of file fsa.H.

Referenced by State_t< EVENT >::arcs(), State_t< EVENT >::clear(), State_t< EVENT >::consumes(), State_t< EVENT >::event(), State_t< EVENT >::is_empty(), State_t< EVENT >::operator+=(), and State_t< EVENT >::operator-=().

template<class EVENT>
str_ptr State_t< EVENT >::_name [private]
 

Definition at line 285 of file fsa.H.

Referenced by State_t< EVENT >::name(), and State_t< EVENT >::set_name().


The documentation for this class was generated from the following file:
Generated on Mon Sep 18 11:47:23 2006 for jot by  doxygen 1.4.4