bfirst_cursor Class Template Reference

A bfirst_cursor implements the breadth-first traversal on deterministic automata. More...

#include <cursor.h>

Inherits astl::bfirst_cursor_concept.

List of all members.

Public Types

typedef QueueCursor::char_traits char_traits
 Character traits describing char_type.
typedef QueueCursor::char_type char_type
 The type of the transitions letters.
typedef QueueCursor::state_type state_type
 The type of the automaton-states identifiers.
typedef QueueCursor::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.
tag_type aim_tag () const
 Returns the data attached to the aim state of the pointed transition.
 bfirst_cursor ()
 Creates a cursor with an empty queue used as an end-of-range iterator.
 bfirst_cursor (const QueueCursor &x, const MarkerFunction &f=MarkerFunction())
 Creates a cursor with x as queue.
char_type letter () const
 Returns the letter on the pointed transition.
bool next ()
 Increments the cursor making it point to the next transition in the sequence.
bool operator!= (const self &x) const
 Returns true if queues are different compared element by element.
bool operator== (const self &x) const
 Returns true if both queues are equal compared element by element.
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.
tag_type src_tag () const
 Returns the data attached to the state that this cursor points to.


Detailed Description

template<typename QueueCursor, typename MarkerFunction = none>
class astl::bfirst_cursor< QueueCursor, MarkerFunction >

A bfirst_cursor implements the breadth-first traversal on deterministic automata.

It is an iterator on a sequence of transitions ordered according to the breadth-first traversal algorithm. The method next() allows to increment the cursor, making it point to the next transition in the sequence. This methods returns true if the transition reached has been enqueued and false otherwise (dequeue). The bfirst_cursor is used in the same way as the iterators on sequence to define ranges foralgorithms.

Template parameters
ParameterDescriptionDefaultRequirements
QueueCursor The type of the queue cursorQueueCursor is a model of queue cursor
MarkerFunction The type of state marker used for preventing the cursor from visiting twice the same transition on cyclic automata and DAGsnone MarkerFunction is either none, set_marker<ForwardCursor::state_type> or a model of state marker
Model of
bfirst_cursor
Associated Helper Functions
bfirstc(), bfirst_markc()

Member Function Documentation

state_type aim (  )  const

Returns the aim state of the pointed transition.

Precondition:
The queue is not empty

bool aim_final (  )  const

Returns true if the aim state of the transition that this cursor points to is final.

Precondition:
The queue is not empty

tag_type aim_tag (  )  const

Returns the data attached to the aim state of the pointed transition.

Precondition:
The queue is not empty

char_type letter (  )  const

Returns the letter on the pointed transition.

Precondition:
The queue is not empty

bool next (  ) 

Increments the cursor making it point to the next transition in the sequence.

Returns true if the transition reached has been enqueued.

Precondition:
The queue is not empty

bool operator!= ( const self x  )  const

Returns true if queues are different compared element by element.

bool operator== ( const self x  )  const

Returns true if both queues are equal compared element by element.

state_type src (  )  const

Returns the identifier of the state that this cursor points to.

Precondition:
The queue is not empty

bool src_final (  )  const

Returns true if the state that this cursor points to is final.

Precondition:
The queue is not empty

tag_type src_tag (  )  const

Returns the data attached to the state that this cursor points to.

Precondition:
The queue is not empty


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