|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Iterator on nodes and arcs of a path. More...
#include <tpl_graph.H>
Public Member Functions | |
| Iterator (const Path &path) noexcept | |
Create an iterator on the first node of path | |
| Node * | get_current_node () const |
| Return the current node of a path. | |
| Node * | get_current_node_ne () const noexcept |
| Arc * | get_current_arc () const |
| Return the current arc of a path. | |
| Arc * | get_current_arc_ne () const noexcept |
| Node * | get_curr_ne () const noexcept |
| Node * | get_curr () const |
| std::pair< Node *, Arc * > | get_pair () const |
| Return a pair with the current node and arc. | |
| std::tuple< Node *, Arc * > | get_tuple () const |
| Return a tuple with the current node and arc. | |
| std::tuple< Node *, Arc * > | get_tuple_ne () const noexcept |
| bool | has_current_arc () const noexcept |
Return true if iterator has current arc. | |
| bool | has_current_node () const noexcept |
Return true if the iterator has a current node. | |
Public Member Functions inherited from Aleph::DynDlist< T >::Iterator | |
| long | get_pos () const noexcept |
| Return the ordinal position of current item. | |
| void | next_ne () noexcept |
| Move the iterator one position forward guaranteeing no exception. | |
| void | next () |
| Move the iterator one item forward. | |
| void | prev () |
| Move the iterator one item backward. | |
| void | reset_first () noexcept |
| Reset the iterator to the first item. | |
| void | reset_last () noexcept |
| Reset the iterator to the last item. | |
| void | end () noexcept |
| Put the iterator at the end state (where there is no current item) | |
| Iterator (const DynDlist< T > &list) noexcept | |
Initialize the iterator to the first item of list | |
| Iterator () noexcept | |
| Iterator & | operator= (const Iterator &it) noexcept |
| T & | get_curr () const |
Return the current item; throw overflow_error if there is no current item. | |
| T & | get_curr_ne () const noexcept |
| void | insert (const T &item) |
| Insert by copy an item after the current item. | |
| void | insert (T &&item) |
| Insert by movement an item after the current item. | |
| void | append (const T &item) |
| Append by copy an item before the current item. | |
| void | append (T &&item) |
| Append by movement an item after the current item. | |
| void | insert_list (DynDlist &list) |
Move and insert all elements of list after the current item of iterator. | |
| void | append_list (DynDlist &list) |
Move and append all elements of list before the current item of iterator. | |
| T | del () |
| Remove from the list the current node and move the iterator one position forward. | |
Public Member Functions inherited from Aleph::Dnode< T >::Iterator | |
| Dnode< T > * | get_curr_ne () const noexcept |
| Return the current link guaranteeing no exception. Be careful. | |
| Dnode< T > * | get_curr () const |
| Return a pointer to the current node. | |
| Dnode * | del () |
| Remove the current node of the list a return a pointer to the removed node. | |
| Dnode * | del_ne () noexcept |
| Same as del() but without exception check. | |
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. | |
Private Member Functions | |
| Path_Desc & | get_curr_path_desc_ne () const noexcept |
| Path_Desc & | get_curr_path_desc () const |
Additional Inherited Members | |
Public Types inherited from Aleph::DynDlist< T >::Iterator | |
| using | Set_Type = DynDlist |
| The type of container. | |
| using | Item_Type = T |
| The type of element stored in the container. | |
Public Types inherited from Aleph::Dnode< T >::Iterator | |
| using | Set_Type = Dnode< T > |
| The type of set. | |
| using | Item_Type = Dnode< T > * |
| The type of element of set. | |
| using | Base = Dlink::Iterator |
Public Types inherited from Aleph::Dlink::Iterator | |
| using | Set_Type = Dlink |
| The set type. | |
| using | Item_Type = Dlink * |
| The type of elements of container. | |
Create an iterator on the first node of path
Definition at line 3204 of file tpl_graph.H.
|
inline |
Definition at line 3260 of file tpl_graph.H.
References Aleph::Path< GT >::Iterator::get_current_node().
|
inlinenoexcept |
Definition at line 3255 of file tpl_graph.H.
References Aleph::Path< GT >::Iterator::get_current_node_ne().
|
inlineprivate |
Definition at line 3214 of file tpl_graph.H.
References Aleph::DynDlist< T >::Iterator::get_curr().
Referenced by Aleph::Path< GT >::Iterator::get_current_arc(), and Aleph::Path< GT >::Iterator::get_current_node().
|
inlineprivatenoexcept |
Definition at line 3209 of file tpl_graph.H.
References Aleph::DynDlist< T >::Iterator::get_curr_ne().
Referenced by Aleph::Path< GT >::Iterator::get_current_arc_ne(), and Aleph::Path< GT >::Iterator::get_current_node_ne().
|
inline |
Return the current arc of a path.
n nodes has n - 1 arcs. So if the iterator is positioned on the last node, the get_current_arc() has no current arc and will throw an exception.| overflow_error | if path is empty of iterator has not current node |
Definition at line 3242 of file tpl_graph.H.
References ah_overflow_error_if, Aleph::Path< GT >::Path_Desc::arc, Aleph::Path< GT >::Iterator::get_curr_path_desc(), and Aleph::Dlink::Iterator::is_in_last().
Referenced by Aleph::Path< GT >::Iterator::get_pair(), and Aleph::Path< GT >::Iterator::get_tuple().
|
inlinenoexcept |
Definition at line 3249 of file tpl_graph.H.
References Aleph::Path< GT >::Path_Desc::arc, and Aleph::Path< GT >::Iterator::get_curr_path_desc_ne().
Referenced by Aleph::Path< GT >::Iterator::get_tuple_ne().
|
inline |
Return the current node of a path.
Throw overflow_error if path is empty of the iterator has not current node
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 3222 of file tpl_graph.H.
References Aleph::Path< GT >::Iterator::get_curr_path_desc(), and Aleph::Path< GT >::Path_Desc::node.
Referenced by Aleph::Path< GT >::Iterator::get_curr(), Aleph::Path< GT >::Iterator::get_pair(), Aleph::Path< GT >::Iterator::get_tuple(), TYPED_TEST(), and TYPED_TEST().
|
inlinenoexcept |
Definition at line 3227 of file tpl_graph.H.
References Aleph::Path< GT >::Iterator::get_curr_path_desc_ne(), and Aleph::Path< GT >::Path_Desc::node.
Referenced by Aleph::Path< GT >::Iterator::get_curr_ne(), and Aleph::Path< GT >::Iterator::get_tuple_ne().
|
inline |
Return a pair with the current node and arc.
nullptr.| overflow_error | if path is empty of iterator has not current node |
Definition at line 3275 of file tpl_graph.H.
References Aleph::Path< GT >::Iterator::get_current_arc(), and Aleph::Path< GT >::Iterator::get_current_node().
|
inline |
Return a tuple with the current node and arc.
nullptr.| overflow_error | if path is empty of iterator has not current node |
Definition at line 3290 of file tpl_graph.H.
References Aleph::Path< GT >::Iterator::get_current_arc(), and Aleph::Path< GT >::Iterator::get_current_node().
|
inlinenoexcept |
Definition at line 3295 of file tpl_graph.H.
References Aleph::Path< GT >::Iterator::get_current_arc_ne(), and Aleph::Path< GT >::Iterator::get_current_node_ne().
|
inlinenoexcept |
Return true if iterator has current arc.
Definition at line 3308 of file tpl_graph.H.
References Aleph::Dlink::Iterator::has_curr(), Aleph::Dlink::Iterator::is_in_last(), and Aleph::maps().
Referenced by Aleph::Path< GT >::contains_arc(), Aleph::Path< GT >::for_each_arc(), and Aleph::increase_flow().
|
inlinenoexcept |
Return true if the iterator has a current node.
Definition at line 3314 of file tpl_graph.H.
References Aleph::Dlink::Iterator::has_curr().
Referenced by Aleph::Path< GT >::contains_node(), Aleph::Path< GT >::for_each_node(), Aleph::Bellman_Ford< GT, Distance, Ait, NAit, SA >::search_negative_cycle_on_partial_graph(), TEST(), TEST(), and TEST_F().