cursor Class Template Reference

A plain cursor is a pointer to an automaton state that is able to move along defined transitions. More...

#include <cursor.h>

Inherits astl::cursor_concept.

List of all members.

Public Types

typedef DFA::char_traits char_traits
 Character traits describing char_type.
typedef DFA::char_type char_type
 The type of the transitions letters.
typedef DFA::state_type state_type
 The type of the automaton-states identifiers.
typedef DFA::tag_type tag_type
 The type of the data attached to states.

Public Member Functions

 cursor (const DFA &a, state_type p)
 Creates a cursor pointing to state p of the automaton a.
 cursor (const DFA &a)
 Creates a cursor pointing to an undefined state of the automaton a.
 cursor ()
 Creates a singular cursor.
bool exists (const char_type &a) const
 Returns true if any outgoing transition labeled with a exists.
bool forward (const char_type &a)
 Moves along the outgoing transition labeled with a if defined, otherwise moves to sink state and returns false.
selfoperator= (state_type p)
 Sets this cursor to point to the state p.
bool operator== (const self &x) const
 Returns true if x points to the same state as this cursor.
bool sink () const
 Returns true if this cursor points to the sink state DFA::null_state.
state_type sink_state () const
 Returns the identifier of the sink state DFA::null_state.
state_type src () const
 Returns the identifier of the state that this cursor points to.
bool src_final () const
 Returns true if the state that this cursor points to is final.
const tag_typesrc_tag () const
 Returns the data attached to the state that this cursor points to.


Detailed Description

template<typename DFA>
class astl::cursor< DFA >

A plain cursor is a pointer to an automaton state that is able to move along defined transitions.

Its purpose is to implement simple traversals checking if a word is in the language defined by an automaton.

Template parameters
ParameterDescriptionDefaultRequirements
DFA The type of the DFA that this cursor will point toDFA is a model of DFA
Model of
cursor
Associated Helper Functions
plainc()

Constructor & Destructor Documentation

cursor ( const DFA &  a,
state_type  p 
)

Creates a cursor pointing to state p of the automaton a.

Postcondition:
 src() == p 


Member Function Documentation

self& operator= ( state_type  p  ) 

Sets this cursor to point to the state p.

Postcondition:
 src() == p

bool operator== ( const self x  )  const

Returns true if x points to the same state as this cursor.

Precondition:
This cursor and x point to the same automaton


Generated on Sun Mar 8 02:41:35 2009 for ASTL by  doxygen 1.5.7.1