transition_cursor Class Template Reference

A pointer to an automaton transition (source state, letter, aim state). More...

#include <cursor.h>

Inherits astl::transition_cursor_concept.

List of all members.

Public Types

typedef FA::char_traits char_traits
 Character traits describing char_type.
typedef FA::char_type char_type
 The type of the transitions letters.
typedef FA::state_type state_type
 The type of the automaton-states identifiers.
typedef FA::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 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.
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 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.
 transition_cursor ()
 Creates a singular cursor.
 transition_cursor (const FA &a)
 Creates a cursor pointing to an undefined state of the automaton a.
 transition_cursor (const FA &a, state_type p)
 Creates a cursor pointing to the state p of the automaton a.


Detailed Description

template<typename FA>
class astl::transition_cursor< FA >

A pointer to an automaton transition (source state, letter, aim state).

It implements traversals of the sequence of transitions going out of the source state.

Template parameters
ParameterDescriptionDefaultRequirements
FA The type of the automaton that this cursor will point toFA is a model of FA
Model of
transition_cursor
Associated Helper Functions
transitionc()

Constructor & Destructor Documentation

transition_cursor ( const FA &  a,
state_type  p 
)

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

Postcondition:
 src() == p 


Member Function Documentation

state_type aim (  )  const

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 first (  ) 

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 or next

Reimplemented in forward_cursor.

char_type letter (  )  const

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 (  ) 

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 state p.

Postcondition:
 src() == p 


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