|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Iterator on all arcs of a graph. More...
#include <tpl_graph.H>
Public Types | |
| using | Item_Type = Arc * |
| using | Set_Type = List_Graph |
| The type of element over whom iterate. | |
Public Types inherited from Aleph::Dlink::Iterator | |
| using | Set_Type = Dlink |
| The set type. | |
| using | Item_Type = Dlink * |
| The type of elements of container. | |
Public Member Functions | |
| Arc_Iterator ()=default | |
| The type of set. | |
| Arc_Iterator (const List_Graph &g) noexcept | |
Initialize an iterator for all the arc of g | |
| Arc * | get_current_arc_ne () const noexcept |
Return the current arc. Throw overflow_error if there is no one. | |
| Arc * | get_current_arc () const |
| Arc * | get_curr () const |
| Arc * | get_curr_ne () const noexcept |
| Node * | get_src_node () const |
| Return the source node of the current arc. | |
| Node * | get_src_node_ne () const |
| Node * | get_tgt_node () const |
| Return the target node of current arc. | |
| Node * | get_tgt_node_ne () const |
Public Member Functions inherited from Aleph::Dlink::Iterator | |
| Iterator (Dlink *head_ptr) noexcept | |
Initialize an iterator on the first item of the list pointed by head_ptr. | |
| Iterator (const Dlink &list) noexcept | |
Initialize an iterator on the first item of list. | |
| void | set (Dlink *new_curr) noexcept |
| Set the current node . | |
| Iterator () noexcept | |
| void | reset_first () noexcept |
| Reset the iterator to the first item of list. | |
| void | reset_last () noexcept |
| Reset the iterator to the last item of list. | |
| void | end () noexcept |
| Put the iterator out of range. | |
| bool | has_curr () const noexcept |
Return true if the iterator has current item. | |
| bool | is_last () const noexcept |
| Dlink * | get_curr_ne () const noexcept |
| Return the current link guaranteeing no exception. Be careful. | |
| Dlink * | get_curr () const |
| Return the current node of iterator. | |
| constexpr bool | is_in_first () const noexcept |
Return true if the iterator is positiones on the first item. | |
| bool | is_in_last () const noexcept |
Return true if the iterator is positiones on the last item. | |
| void | prev_ne () noexcept |
| Move the iterator one position backward guaranteeing no exception. | |
| void | prev () |
| Move the iterator one position backward. | |
| void | next_ne () noexcept |
| Move the iterator one position backward guaranteeing no exception. | |
| void | next () |
| Move the iterator one position forward. | |
| constexpr bool | operator== (const Iterator &it) const noexcept |
Return true if this and it are positioned on the same item. | |
| constexpr bool | operator!= (const Iterator &it) const noexcept |
Return true if this and it hace different states. | |
| Dlink * | del () |
| Remove from the list the current node and move the iterator one position forward. | |
| Dlink * | del_ne () noexcept |
| constexpr bool | verify (Dlink *l) const noexcept |
Return true if the iterator is on the list pointed by l | |
| constexpr bool | verify (const Iterator &it) const noexcept |
Return true if this and it are on the same list. | |
Iterator on all arcs of a graph.
This iterator scans all the arcs of the graph. The apparition order is random, but this can be modified through of sort_arcs() method.
Definition at line 916 of file tpl_graph.H.
| using Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Arc_Iterator::Item_Type = Arc * |
Definition at line 918 of file tpl_graph.H.
| using Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Arc_Iterator::Set_Type = List_Graph |
The type of element over whom iterate.
Definition at line 920 of file tpl_graph.H.
|
default |
The type of set.
|
inlinenoexcept |
Initialize an iterator for all the arc of g
Definition at line 925 of file tpl_graph.H.
|
inline |
Definition at line 942 of file tpl_graph.H.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Arc_Iterator::get_current_arc().
|
inlinenoexcept |
Definition at line 947 of file tpl_graph.H.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Arc_Iterator::get_current_arc_ne().
|
inline |
Definition at line 937 of file tpl_graph.H.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::dlink_to_arc(), and Aleph::Dlink::Iterator::get_curr().
Referenced by Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Arc_Iterator::get_curr(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Arc_Iterator::get_src_node(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Arc_Iterator::get_tgt_node().
|
inlinenoexcept |
Return the current arc. Throw overflow_error if there is no one.
Definition at line 932 of file tpl_graph.H.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::dlink_to_arc(), and Aleph::Dlink::Iterator::get_curr_ne().
Referenced by Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Arc_Iterator::get_curr_ne(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Arc_Iterator::get_src_node_ne(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Arc_Iterator::get_tgt_node_ne().
|
inline |
Return the source node of the current arc.
Throw overflow_error if there is no one. Of course, only has sense if one iterates on a directed graph
Definition at line 955 of file tpl_graph.H.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Arc_Iterator::get_current_arc().
|
inline |
Definition at line 960 of file tpl_graph.H.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Arc_Iterator::get_current_arc_ne().
|
inline |
Return the target node of current arc.
Throw overflow_error if there is no one. Of course, only has sense if one iterates on a directed graph
Definition at line 968 of file tpl_graph.H.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Arc_Iterator::get_current_arc().
|
inline |
Definition at line 973 of file tpl_graph.H.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Arc_Iterator::get_current_arc_ne().