forward_cursor Class Template Reference

A pointer to a deterministic-automaton transition (source state, letter, aim state). More...

#include <cursor.h>

Inheritance diagram for forward_cursor:

transition_cursor< DFA >

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

state_type aim () const
 Returns the aim state of the pointed transition.
bool aim_final () const
 Returns true if the aim state of the transition that this cursor points to is final.
const tag_typeaim_tag () const
 Returns the data attached to the aim state of the pointed transition.
bool exists (const char_type &a) const
 Returns true if an outgoing transition labeled with a exists.
bool find (const char_type &a)
 Makes this cursor point to the transition labeled with a.
bool first ()
 Makes this cursor point to the first element of the transitions sequence of the source state.
void forward ()
 Moves forward along the pointed transition.
bool forward (const char_type &a)
 Moves along the outgoing transition labeled with .
 forward_cursor ()
 Creates a singular cursor.
 forward_cursor (const DFA &a)
 Creates a cursor pointing to an undefined state of the automaton a.
 forward_cursor (const DFA &a, state_type p)
 Creates a cursor pointing to a state p of the automaton a.
char_type letter () const
 Returns the letter on the pointed transition.
bool next ()
 Moves this cursor to the next element of the transitions sequence of the source state.
bool operator!= (const self &x) const
 Returns true if x points to another transition than this cursor.
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 transition as this cursor.
bool sink () const
 Returns true if this cursor points to the sink state FA::null_state.
state_type sink_state () const
 Returns the identifier of the sink state FA::null_state.
state_type src () const
 Returns the id of the state that this cursor points to.
bool src_final () const
 Returns true if the state this cursor points to is final.
const tag_typesrc_tag () const
 Returns the data attached to the state this cursor points to.


Detailed Description

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

A pointer to a deterministic-automaton transition (source state, letter, aim state).

It provides all the functionnalities of the plain cursor and the transition_cursor

Template parameters
ParameterDescriptionDefaultRequirements
DFA The type of the automaton that this cursor will point toDFA is a model of DFA
Model of
cursor, transition_cursor, forward_cursor
Associated Helper Functions
forwardc()

Member Function Documentation

state_type aim (  )  const [inherited]

Returns the aim state of the pointed transition.

Precondition:
The cursor shall have been set to point to a defined transition beforehand by successfully calling first or next

bool find ( const char_type a  ) 

Makes this cursor point to the transition labeled with a.

Returns:
true if such a transition exists, otherwise return false and the pointed transition is undefined

bool first (  )  [inherited]

Makes this cursor point to the first element of the transitions sequence of the source state.

Returns true if such an element exists (if any transition is defined), otherwise the pointed transition is undefined

void forward (  ) 

Moves forward along the pointed transition.

Precondition:
The cursor shall have been set to point to a defined transition beforehand by successfully calling first, next or find

Reimplemented from transition_cursor< DFA >.

bool forward ( const char_type a  ) 

Moves along the outgoing transition labeled with .

Returns:
true if such a transition is defined, otherwise move to sink state and return false

References transition_cursor< DFA >::sink().

char_type letter (  )  const [inherited]

Returns the letter on the pointed transition.

Precondition:
The cursor shall have been set to point to a defined transition beforehand by successfully calling first or next

bool next (  )  [inherited]

Moves this cursor to the next element of the transitions sequence of the source state.

Returns true if such an element exists (the cursor is not at the end of the sequence), otherwise the pointed transition is undefined.

Precondition:
The cursor shall have been set to point to a defined transition beforehand by successfully calling first or next

self& operator= ( state_type  p  ) 

Sets this cursor to point to the state p.

Postcondition:
 src() == p 

References transition_cursor< DFA >::operator=().


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