|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Iterator on the arcs of a graph. More...
#include <tpl_graph.H>
Public Types | |
| using | Item_Type = Arc * |
| using | Set_Type = Node * |
| The type of data of set. | |
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 | |
| Node_Arc_Iterator ()=default | |
| The container type (a node) | |
| Node_Arc_Iterator (Node *src) noexcept | |
| Constructs an iterator on the node src. | |
| Arc_Node * | get_current_arc_node () const |
| Arc_Node * | get_current_arc_node_ne () const noexcept |
| Arc * | get_curr () const |
See get_current_arc(). | |
| Arc * | get_curr_ne () const noexcept |
| Return the current arc, which must exist. | |
| Arc * | get_current_arc () const |
| Return the current arc. | |
| Arc * | get_current_arc_ne () const noexcept |
| Node * | get_tgt_node () const |
| Return the connected node to source node (src passed in construction time) through the current arc. | |
| Node * | get_tgt_node_ne () const noexcept |
| Node * | get_node () const |
| Node * | get_node_ne () const noexcept |
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 |
| Remove from the list the current node and move the iterator one position forward, without checking that there is a current node. | |
| 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. | |
Private Attributes | |
| Node * | src_node |
Iterator on the arcs of a graph.
This iterator scans all the arcs related to a node.
If the graph is not directed. then all the related nodes will be seen, independently of specified order when the arc was inserted. Use get_connected_node() for obtaining the target node given a source node and arc.
If you are using List_Graph as a directed graph, then this iterator has not much sense. Use Out_Iterator or In_Iterator in order to iterate on the outcoming or incoming arcs of a node.
If the graph is directed, then only the arcs specified as target (second parameter in the insert_arc() method) will be seen.
Definition at line 853 of file tpl_graph.H.
| using Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::Item_Type = Arc * |
Definition at line 858 of file tpl_graph.H.
| using Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::Set_Type = Node * |
The type of data of set.
Definition at line 860 of file tpl_graph.H.
|
default |
The container type (a node)
|
inlinenoexcept |
Constructs an iterator on the node src.
| [in] | src | the node over whom you wish to iterate. |
Definition at line 868 of file tpl_graph.H.
|
inline |
See get_current_arc().
Definition at line 885 of file tpl_graph.H.
References Aleph::Arc_Node::arc, and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::get_current_arc_node().
Referenced by Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::get_current_arc(), and TYPED_TEST().
|
inlinenoexcept |
Return the current arc, which must exist.
Definition at line 891 of file tpl_graph.H.
References Aleph::Arc_Node::arc, and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::get_current_arc_node_ne().
Referenced by Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::get_current_arc_ne().
|
inline |
Return the current arc.
Throw overflow_error is there is no current arc
Definition at line 898 of file tpl_graph.H.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::get_curr().
Referenced by Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::get_tgt_node().
|
inlinenoexcept |
Definition at line 903 of file tpl_graph.H.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::get_curr_ne().
Referenced by Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::get_tgt_node_ne().
|
inline |
Definition at line 874 of file tpl_graph.H.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::dlink_to_arc_node(), and Aleph::Dlink::Iterator::get_curr().
Referenced by Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::get_curr().
|
inlinenoexcept |
Definition at line 879 of file tpl_graph.H.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::dlink_to_arc_node(), and Aleph::Dlink::Iterator::get_curr_ne().
Referenced by Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::get_curr_ne().
|
inline |
Definition at line 921 of file tpl_graph.H.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::get_tgt_node().
|
inlinenoexcept |
Definition at line 926 of file tpl_graph.H.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::get_tgt_node_ne().
|
inline |
Return the connected node to source node (src passed in construction time) through the current arc.
Throw overflow_error is there is no current
Definition at line 911 of file tpl_graph.H.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::get_current_arc(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::src_node.
Referenced by Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::get_node(), and TYPED_TEST().
|
inlinenoexcept |
Definition at line 916 of file tpl_graph.H.
References Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::get_current_arc_ne(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::src_node.
Referenced by Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::get_node_ne().
|
private |
Definition at line 855 of file tpl_graph.H.
Referenced by Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::get_tgt_node(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::get_tgt_node_ne().