|
Aleph-w 7.10.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 |
| Return the current node, which must exist. | |
| 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::Const_Iterator< It > | |
| Const_Iterator ()=default | |
| A view with no current item. | |
| template<class C > requires (not std::same_as<std::remove_cvref_t<C>, Const_Iterator> and not std::same_as<std::remove_cvref_t<C>, It>) | |
| Const_Iterator (const C &c) | |
View positioned on the first item of the container c. | |
| Const_Iterator (It underlying) noexcept(std::is_nothrow_move_constructible_v< It >) | |
| Read-only view over an existing iterator. | |
| template<class I = It> | |
| auto | has_curr () const noexcept(noexcept(std::declval< I & >().has_curr())) -> decltype(std::declval< I & >().has_curr()) |
true if there is a current item. | |
| template<class I = It> | |
| auto | get_curr () const noexcept(noexcept(std::declval< I & >().get_curr())) -> const_iterator_detail::const_item_t< decltype(std::declval< I & >().get_curr())> |
| The current item, read-only. | |
| template<class I = It> | |
| auto | get_curr_ne () const noexcept(noexcept(std::declval< I & >().get_curr_ne())) -> const_iterator_detail::const_item_t< decltype(std::declval< I & >().get_curr_ne())> |
| get_curr() without the checks of the underlying iterator. | |
| template<class I = It> | |
| auto | next () noexcept(noexcept(std::declval< I & >().next())) -> decltype(std::declval< I & >().next()) |
| Move to the next item; what the underlying iterator throws. | |
| template<class I = It> | |
| auto | next_ne () noexcept(noexcept(std::declval< I & >().next_ne())) -> decltype(std::declval< I & >().next_ne()) |
| next() without checks. | |
| template<class I = It> | |
| auto | prev () noexcept(noexcept(std::declval< I & >().prev())) -> decltype(std::declval< I & >().prev()) |
| Move to the previous item; what the underlying iterator throws. | |
| template<class I = It> | |
| auto | prev_ne () noexcept(noexcept(std::declval< I & >().prev_ne())) -> decltype(std::declval< I & >().prev_ne()) |
| prev() without checks. | |
| template<class I = It> | |
| auto | reset_first () noexcept(noexcept(std::declval< I & >().reset_first())) -> decltype(std::declval< I & >().reset_first()) |
| Position the view on the first item. | |
| template<class I = It> | |
| auto | reset_last () noexcept(noexcept(std::declval< I & >().reset_last())) -> decltype(std::declval< I & >().reset_last()) |
| Position the view on the last item. | |
| template<class I = It> | |
| auto | reset () noexcept(noexcept(std::declval< I & >().reset())) -> decltype(std::declval< I & >().reset()) |
| Position the view on the first item. | |
| template<class I = It> | |
| auto | end () noexcept(noexcept(std::declval< I & >().end())) -> decltype(std::declval< I & >().end()) |
| Position the view past the last item. | |
| template<class I = It> | |
| auto | get_pos () const noexcept(noexcept(std::declval< I & >().get_pos())) -> decltype(std::declval< I & >().get_pos()) |
| Ordinal position of the current item. | |
| template<class I = It> | |
| auto | set_pos (const long pos) noexcept(noexcept(std::declval< I & >().set_pos(pos))) -> decltype(std::declval< I & >().set_pos(pos)) |
Position the view on the item at ordinal position pos. | |
| template<class I = It> | |
| auto | is_last () const noexcept(noexcept(std::declval< I & >().is_last())) -> decltype(std::declval< I & >().is_last()) |
true if the current item is the last one. | |
| template<class I = It> | |
| auto | is_in_first () const noexcept(noexcept(std::declval< I & >().is_in_first())) -> decltype(std::declval< I & >().is_in_first()) |
true if the current item is the first one. | |
| template<class I = It> | |
| auto | is_in_last () const noexcept(noexcept(std::declval< I & >().is_in_last())) -> decltype(std::declval< I & >().is_in_last()) |
true if the current item is the last one. | |
| void | swap (Const_Iterator &other) noexcept(std::is_nothrow_swappable_v< It >) |
| Exchange the views. | |
| template<class I = It> | |
| auto | operator== (const Const_Iterator &other) const -> decltype(std::declval< I & >()==std::declval< I & >()) |
| Equality of the underlying iterators, when they have it. | |
| template<class I = It> | |
| auto | operator!= (const Const_Iterator &other) const -> decltype(not(std::declval< I & >()==std::declval< I & >())) |
Negation of ==. | |
Private Types | |
| using | Base = Aleph::const_iterator_t< DynDlist< Path_Desc > > |
Private Member Functions | |
| const Path_Desc & | get_curr_path_desc_ne () const noexcept |
| const Path_Desc & | get_curr_path_desc () const |
Additional Inherited Members | |
Public Types inherited from Aleph::Const_Iterator< It > | |
| using | Itor = It |
| The underlying iterator. | |
| using | aleph_random_access_iterator = std::conditional_t< AlephRandomAccessItor< It >, Const_Iterator, void > |
| Random access when the underlying iterator opts in; see AlephRandomAccessItor. | |
Protected Member Functions inherited from Aleph::Const_Iterator< It > | |
| It & | underlying () const noexcept |
The underlying iterator, for the views that extend the reading protocol with members of their own (the read-only iterators of the graphs do it with get_src_node() and get_tgt_node()). | |
Iterator on nodes and arcs of a path.
Definition at line 4394 of file tpl_graph.H.
|
private |
Definition at line 4398 of file tpl_graph.H.
|
inlinenoexcept |
Create an iterator on the first node of path
Definition at line 4402 of file tpl_graph.H.
|
inline |
Definition at line 4458 of file tpl_graph.H.
References Aleph::Path< GT >::Iterator::get_current_node().
|
inlinenoexcept |
Return the current node, which must exist.
Definition at line 4453 of file tpl_graph.H.
References Aleph::Path< GT >::Iterator::get_current_node_ne().
|
inlineprivate |
Definition at line 4412 of file tpl_graph.H.
References Aleph::Const_Iterator< It >::get_curr().
Referenced by Aleph::Path< GT >::Iterator::get_current_arc(), and Aleph::Path< GT >::Iterator::get_current_node().
|
inlineprivatenoexcept |
Definition at line 4407 of file tpl_graph.H.
References Aleph::Const_Iterator< It >::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 4440 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::Const_Iterator< It >::is_in_last().
Referenced by Aleph::Path< GT >::Iterator::get_pair(), and Aleph::Path< GT >::Iterator::get_tuple().
|
inlinenoexcept |
Definition at line 4447 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
Definition at line 4420 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 4425 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 4473 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 4488 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 4493 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 4506 of file tpl_graph.H.
References Aleph::and, Aleph::Const_Iterator< It >::has_curr(), and Aleph::Const_Iterator< It >::is_in_last().
Referenced by Aleph::Shortest_Path_Base< GT, Distance, Itor, SA, HeapT >::get_min_path(), Aleph::increase_flow(), and TYPED_TEST().
|
inlinenoexcept |
Return true if the iterator has a current node.
Definition at line 4512 of file tpl_graph.H.
References Aleph::Const_Iterator< It >::has_curr().
Referenced by Aleph::k_shortest_paths_detail::path_to_state(), TEST(), TEST(), and TEST_F().