previousnext
ASTL homeSTL home
Edges

Description

Edges class is a proxy allowing to access outgoing transitions of a state through its STL map (for DFA) or multimap (for NFA) interface. It holds pairs in Sigma::Alphabet x Q. Modifying transitions is not possible through this class, thus it only implements constant map methods.

Example

//going through the transitions of the initial state
DFA_type::State i=dfa.initial();
const DFA_type::Edges& edge = dfa.delta2(i);
DFA_type::Edges::const_iterator trans, trans_end=edge.end();
for(trans=edge.begin();trans!=trans_end;++trans)
{
pair<DFA_type::Alphabet,DFA_type::State> t=*trans;
}

Definition

buit-in with the various DFA and NFA implementations.

Exported types

type identity description
Const iterator X::const_iterator forward iterator on the transition, read only.
key type X::key_type Equivalent to Sigma::Alphabet
value type X::value_type pair<const Sigma::Alphabet, State>
key compare X::key_compare  
const reference X::const_reference  
size type X::size_type  
difference type X::difference_type  

notations

E an Edge type
e, f elements of type E
k of type E::key_type

valid expressions

name expression return type description
begin e.begin() const_iterator returns an iterator on the first transition.
end e.end() const_iterator returns a past-the-end iterator on the transitions.
empty e.empty() bool returns true if there is no transitions
size e.size() size_type returns the number of transitions
find e.find(k) const_iterator returns an iterator on the transition(s) associated with the searched key
count e.count(k) size_type returns the number of transitions admitting k as a key
lower bound e.lower_bound(k) const_iterator returns an iterator on the first transition admitting k as a key
upper bound e.upper_bound(k) const_iterator returns a past-the-end iterator on the transitions admitting k as a key

equal range

e.equal_range(k) pair<const_iterator, const_iterator> returns (lower_bound(k),upper_nound(k));
equallity e==f bool