#include <cursor.h>
Inherits astl::queue_cursor_concept.
Public Types | |
typedef ForwardCursor::char_traits | char_traits |
Character traits describing char_type. | |
typedef ForwardCursor::char_type | char_type |
The type of the transitions letters. | |
typedef ForwardCursor::state_type | state_type |
The type of the automaton-states identifiers. | |
typedef ForwardCursor::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. | |
bool | dequeue () |
Dequeues a forward cursor and return false if the resulting queue is empty. | |
bool | exists (const char_type &a) const |
Returns true if an outgoing transition labeled with a exists. | |
bool | find (const char_type &a) |
Returns the sink state identifier. | |
bool | first () |
Makes this cursor point to the first element of the transitions sequence of the source state and enqueues the resulting forward cursor. | |
bool | forward (const char_type &a) |
Moves along the outgoing transition labeled with a if defined, otherwise moves to sink state and returns false . | |
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 and enqueues the resulting cursor. | |
queue_cursor () | |
Creates a cursor with an empty queue. | |
queue_cursor (const ForwardCursor &x) | |
Creates a cursor with a queue containing x . | |
bool | sink () const |
Returns true if this cursor points to the sink 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. | |
tag_type | src_tag () const |
Returns the data attached to the state that this cursor points to. |
Each move through the sequence of the outgoing transitions of the source state (next()) enqueues a forward cursor. An extra method dequeue() allows to dequeue and to implement the breadth-first traversal.
Parameter | Description | Default | Requirements |
---|---|---|---|
ForwardCursor | The type of the cursors that are stored in the queue | ForwardCursor is a model of forward cursor | |
QueueContainer | The type of the sequential container managing the queue | deque<ForwardCursor> | QueueContainer is a model of front and back insertion sequence and QueueContainer::value_type is ForwardCursor |
state_type aim | ( | ) | const |
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.
bool dequeue | ( | ) |
Dequeues a forward cursor and return false
if the resulting queue is empty.
bool exists | ( | const char_type & | a | ) | const |
Returns true
if an outgoing transition labeled with a
exists.
bool first | ( | ) |
bool forward | ( | const char_type & | a | ) |
Moves along the outgoing transition labeled with a
if defined, otherwise moves to sink state and returns false
.
void forward | ( | ) |
char_type letter | ( | ) | const |
bool next | ( | ) |
bool sink | ( | ) | const |
state_type src | ( | ) | const |
bool src_final | ( | ) | const |
tag_type src_tag | ( | ) | const |
Returns the data attached to the state that this cursor points to.