|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Special iterator for distinguishing input arcs of output ones. More...
#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) | |
Instantiate an filtered iterator for arcs on the node p | |
| void | next_ne () noexcept |
| void | next () |
| Advance to next arc. | |
| void | prev () |
| back to previous item. | |
| void | prev_ne () |
| bool | has_curr () const noexcept |
| Return true is the iterator has a current arc. | |
| GT::Arc * | get_curr () const |
| Return the current arc. | |
| 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 |
Return the node connected to p (passed during construction) and linked through a | |
| GT::Node * | get_node_ne () const noexcept |
Return the node connected to p (passed during construction) and linked through the current arc. | |
| auto | get_tgt_node_ne () const noexcept |
Backward-compatible alias: return target node (same as get_node_ne()). | |
| GT::Node * | get_node () const |
| auto | get_tgt_node () const |
Backward-compatible alias: return target node (same as get_node()). | |
| void | reset_first () noexcept |
| Reset the iterator to first arc. | |
| void | reset_last () noexcept |
| Reset the iterator to last arc. | |
Private Types | |
| using | Itor = Filter_Iterator< Node *, typename GT::Node_Arc_Iterator, Filter > |
Private Attributes | |
| Filter | filt |
| Itor | it |
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.
Definition at line 2970 of file graph-dry.H.
| using GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::Item_Type = typename Itor::Item_Type |
Definition at line 2978 of file graph-dry.H.
| using GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::Iterator_Type = Itor |
the type of items (Arc*)
Definition at line 2980 of file graph-dry.H.
|
private |
Definition at line 2972 of file graph-dry.H.
|
inline |
Instantiate an filtered iterator for arcs on the node p
Definition at line 2983 of file graph-dry.H.
|
inline |
Return the current arc.
Throws overflow_error if there is no current arc
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 3005 of file graph-dry.H.
References GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::it.
Referenced by GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_current_arc(), and GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_node().
|
inlinenoexcept |
Definition at line 3007 of file graph-dry.H.
References GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::it.
Referenced by GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_current_arc_ne(), and GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_node_ne().
|
inline |
Definition at line 3010 of file graph-dry.H.
References GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_curr().
|
inlinenoexcept |
Definition at line 3012 of file graph-dry.H.
References GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_curr_ne().
|
inline |
Definition at line 3031 of file graph-dry.H.
References GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_curr(), and GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_node().
|
inlinenoexcept |
Return the node connected to p (passed during construction) and linked through a
Definition at line 3016 of file graph-dry.H.
References GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::filt.
Referenced by GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_node(), GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_node_ne(), and GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_tgt_node().
|
inlinenoexcept |
Return the node connected to p (passed during construction) and linked through the current arc.
Definition at line 3023 of file graph-dry.H.
References GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_curr_ne(), and GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_node().
Referenced by GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_tgt_node_ne().
|
inline |
Backward-compatible alias: return target node (same as get_node()).
Definition at line 3037 of file graph-dry.H.
References GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_node().
|
inlinenoexcept |
Backward-compatible alias: return target node (same as get_node_ne()).
Definition at line 3029 of file graph-dry.H.
References GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_node_ne().
|
inlinenoexcept |
Return true is the iterator has a current arc.
Definition at line 3001 of file graph-dry.H.
References GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::it.
Referenced by GraphCommon< GT, Node, Arc >::in_arcs(), GraphCommon< GT, Node, Arc >::in_degree(), GraphCommon< GT, Node, Arc >::in_nodes(), GraphCommon< GT, Node, Arc >::in_pairs(), GraphCommon< GT, Node, Arc >::out_arcs(), GraphCommon< GT, Node, Arc >::out_degree(), GraphCommon< GT, Node, Arc >::out_nodes(), GraphCommon< GT, Node, Arc >::out_pairs(), and GraphCommon< GT, Node, Arc >::search_directed_arc().
|
inline |
Advance to next arc.
Throw overflow_error if there is no current arc
Definition at line 2992 of file graph-dry.H.
References GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::it.
|
inlinenoexcept |
Definition at line 2988 of file graph-dry.H.
References GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::it.
|
inline |
back to previous item.
Throw underflow_error if there is no current arc
Definition at line 2996 of file graph-dry.H.
References GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::it.
|
inline |
Definition at line 2998 of file graph-dry.H.
References GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::it.
|
inlinenoexcept |
Reset the iterator to first arc.
Definition at line 3040 of file graph-dry.H.
References GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::it.
|
inlinenoexcept |
Reset the iterator to last arc.
Definition at line 3043 of file graph-dry.H.
References GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::it.
|
private |
Definition at line 2974 of file graph-dry.H.
Referenced by GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_node().
|
private |
Definition at line 2975 of file graph-dry.H.
Referenced by GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_curr(), GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::get_curr_ne(), GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::has_curr(), GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::next(), GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::next_ne(), GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::prev(), GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::prev_ne(), GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::reset_first(), and GraphCommon< GT, Node, Arc >::Digraph_Iterator< Filter >::reset_last().