Aleph-w  1.9
General library for algorithms and data structures
GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter > Class Template Reference

#include <graph-dry.H>

Public Types

using Item_Type = typename Itor::Item_Type
 
using Iterator_Type = Itor
 the type of items (Arc*)
 

Public Member Functions

 Digraph_Iterator (Node *p) noexcept(noexcept(Filter(p)) and noexcept(Itor(p, filt)))
 Instantiate an filtered iterator for arcs on the node p
 
void next_ne () noexcept
 
void next ()
 
void prev ()
 
void prev_ne ()
 
bool has_curr () const noexcept
 Return true is the iterator has a current arc.
 
GT::Arc * get_curr () const
 
GT::Arc * get_curr_ne () const noexcept
 
auto get_current_arc () const
 
auto get_current_arc_ne () const noexcept
 
GT::Node * get_node (typename GT::Arc *a) const noexcept
 
GT::Node * get_node_ne () const noexcept
 
auto get_tgt_node_ne () const noexcept
 
GT::Node * get_node () const
 
auto get_tgt_node () const
 
void reset_first () noexcept
 Reset the iterator to first arc.
 
void reset_last () noexcept
 Reset the iterator to last arc.
 

Detailed Description

template<class GT, class Node, class Arc>
template<class Filter>
class GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >

Special iterator for distinguishing input arcs of output ones.

The intended use of this iterator is to traverse the ars linked to a node p inserted in a non-directed graph and to filter those arcs that are incoming or outcoming respect to p.

The in/out feature is given by the filter.

For example, for iterating on the input arcs of node p, we can do:

for (GT::Digraph_Iterator<In_Filt> it(p); it.has_curr(); it.next())
  auto a = it.get_curr(); // this arc is incoming q --> p

Although this iterator is exclusivelly conceived for dealing with incoming or outcoming arcs. it could be used as filtered iterator. That is, you could to configure the filter for filtering arcs according your own criteria. In this case, we recommend to use the aliased version Filter_Iterator.

Apart from the fact that some arcs are filtered, the interface is identical to the Aleph-w ( $\aleph_\omega$) iterators.

See also
Out_Iterator In_Iterator Filter_Iterator

Member Function Documentation

◆ get_curr()

template<class GT, class Node, class Arc>
template<class Filter >
GT::Arc* GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_curr ( ) const
inline

Return the current arc. Throws overflow_error if there is no current arc

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_current_arc()

template<class GT, class Node, class Arc>
template<class Filter >
auto GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_current_arc ( ) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

+ Here is the call graph for this function:

◆ get_node()

template<class GT, class Node, class Arc>
template<class Filter >
GT::Node* GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_node ( typename GT::Arc *  a) const
inlinenoexcept

Return the node connected to p (passed during construction) and linked through a

+ Here is the caller graph for this function:

◆ get_node_ne()

template<class GT, class Node, class Arc>
template<class Filter >
GT::Node* GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_node_ne ( ) const
inlinenoexcept

Return the node connected to p (passed during construction) and linked through the current arc

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_tgt_node()

template<class GT, class Node, class Arc>
template<class Filter >
auto GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_tgt_node ( ) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

+ Here is the caller graph for this function:

◆ get_tgt_node_ne()

template<class GT, class Node, class Arc>
template<class Filter >
auto GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_tgt_node_ne ( ) const
inlinenoexcept

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

+ Here is the call graph for this function:

◆ next()

template<class GT, class Node, class Arc>
template<class Filter >
void GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::next ( )
inline

Advance to next arc. Throw overflow_error if there is no current arc

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prev()

template<class GT, class Node, class Arc>
template<class Filter >
void GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::prev ( )
inline

back to previous item. Throw underflow_error if there is no current arc

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file:

Leandro Rabindranath León