|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Iterator on Dlink lists.
More...
#include <dlink.H>
Public Types | |
| using | Set_Type = Dlink |
| The set type. | |
| using | Item_Type = Dlink * |
| The type of elements of container. | |
Public Member Functions | |
| 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 Attributes | |
| Dlink * | head = nullptr |
| Dlink * | curr = nullptr |
|
inlinenoexcept |
|
inline |
Remove from the list the current node and move the iterator one position forward.
Definition at line 795 of file dlink.H.
References curr, Aleph::Dlink::del(), get_curr(), has_curr(), head, Aleph::maps(), and next().
Referenced by Aleph::Dnode< T >::Iterator::del(), Aleph::GenLinearHashTable< Key, BucketType, Cmp >::Iterator::del(), TEST(), TEST_F(), TEST_F(), and TEST_F().
|
inlinenoexcept |
Definition at line 806 of file dlink.H.
References curr, Aleph::Dlink::del(), get_curr(), has_curr(), head, Aleph::maps(), and next_ne().
Referenced by Aleph::Dnode< T >::Iterator::del_ne().
|
inlinenoexcept |
Put the iterator out of range.
Definition at line 709 of file dlink.H.
References put_itor_at_the_end().
|
inline |
Return the current node of iterator.
| overflow_error | if there is not current node |
Definition at line 738 of file dlink.H.
References ah_overflow_error_if, get_curr_ne(), has_curr(), and Aleph::maps().
Referenced by del(), del_ne(), Aleph::GenLinearHashTable< Key, BucketType, Cmp >::Iterator::get_curr(), Aleph::Dnode< T >::Iterator::get_curr(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Arc_Iterator::get_current_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::get_current_arc_node(), Aleph::insert_sorted(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inlinenoexcept |
Return the current link guaranteeing no exception. Be careful.
Definition at line 727 of file dlink.H.
References curr, head, and Aleph::maps().
Referenced by get_curr(), Aleph::Dnode< T >::Iterator::get_curr_ne(), Aleph::GenLinearHashTable< Key, BucketType, Cmp >::Iterator::get_curr_ne(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Arc_Iterator::get_current_arc_ne(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::Node_Arc_Iterator::get_current_arc_node_ne().
|
inlinenoexcept |
Return true if the iterator has current item.
Definition at line 715 of file dlink.H.
References curr, head, and Aleph::maps().
Referenced by Aleph::DynDlist< T >::DynDlist(), Aleph::DynDlist< T >::Iterator::append(), Aleph::DynDlist< T >::Iterator::append(), Aleph::DynDlist< T >::Iterator::append_list(), Aleph::Tarjan_Connected_Components< GT, Itor, SA >::build_path(), Eepic_Plane::compute_extreme_points(), Aleph::compute_maximum_cardinality_bipartite_matching(), Aleph::compute_min_cut(), Polygon::copy_points(), del(), Aleph::DynDlist< T >::Iterator::del(), del_ne(), demo_any_path(), demo_degrees_of_separation(), Eepic_Plane::draw(), Aleph::edge_connectivity(), Aleph::Karger_Min_Cut< GT, SA >::fast(), Aleph::generate_dot_file(), get_curr(), Polygon::Segment_Iterator::has_curr(), Aleph::Path< GT >::Iterator::has_current_arc(), Aleph::Path< GT >::Iterator::has_current_node(), Aleph::DynDlist< T >::Iterator::insert(), Aleph::DynDlist< T >::Iterator::insert(), Aleph::DynDlist< T >::Iterator::insert_list(), Aleph::insert_sorted(), Aleph::Karger_Min_Cut< GT, SA >::karger_min_cut(), Aleph::Compute_Cut_Nodes< GT, SA >::map_cut_graph(), Polinomio::multiplicado_por(), next(), Aleph::DynDlist< T >::operator=(), Aleph::Compute_Cut_Nodes< GT, SA >::paint_subgraphs(), prev(), Polinomio::print(), print_grid_with_path(), process_tag_node(), Aleph::Karger_Min_Cut< GT, SA >::rebuild_arc_index(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), Aleph::Karger_Min_Cut< GT, SA >::update_arcs(), and Aleph::vertex_connectivity().
Return true if the iterator is positiones on the first item.
Definition at line 746 of file dlink.H.
References curr, head, Aleph::Dlink::is_empty(), Aleph::maps(), and Aleph::Dlink::next.
|
inlinenoexcept |
Return true if the iterator is positiones on the last item.
Definition at line 752 of file dlink.H.
References is_last().
Referenced by Aleph::Path< GT >::Iterator::get_current_arc(), Aleph::Path< GT >::Iterator::has_current_arc(), and TEST_F().
|
inlinenoexcept |
Definition at line 721 of file dlink.H.
References curr, head, Aleph::Dlink::is_empty(), Aleph::maps(), and Aleph::Dlink::prev.
Referenced by is_in_last(), TEST(), TEST(), TEST_F(), and TEST_F().
|
inline |
Move the iterator one position forward.
| overflow_error | if there is no current item |
Definition at line 776 of file dlink.H.
References ah_overflow_error_if, has_curr(), Aleph::maps(), and next_ne().
Referenced by del(), Aleph::DynDlist< T >::Iterator::del(), Aleph::DynDlist< T >::Iterator::next(), Aleph::GenLinearHashTable< Key, BucketType, Cmp >::Iterator::next(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inlinenoexcept |
Move the iterator one position backward guaranteeing no exception.
Be careful.
Definition at line 770 of file dlink.H.
References curr, and Aleph::Dlink::get_next().
Referenced by del_ne(), Aleph::insert_sorted(), next(), Aleph::DynDlist< T >::Iterator::next_ne(), and Aleph::GenLinearHashTable< Key, BucketType, Cmp >::Iterator::next_ne().
|
inline |
Move the iterator one position backward.
| underflow_error | if there is no current item |
Definition at line 762 of file dlink.H.
References ah_underflow_error_if, has_curr(), Aleph::maps(), and prev_ne().
Referenced by Aleph::DynDlist< T >::Iterator::prev(), Aleph::GenLinearHashTable< Key, BucketType, Cmp >::Iterator::prev(), TEST_F(), TEST_F(), and TEST_F().
|
inlinenoexcept |
Move the iterator one position backward guaranteeing no exception.
Be careful.
Definition at line 756 of file dlink.H.
References curr, and Aleph::Dlink::get_prev().
Referenced by prev().
|
inlinenoexcept |
Reset the iterator to the first item of list.
Definition at line 695 of file dlink.H.
References curr, Aleph::Dlink::get_next(), head, and Aleph::maps().
Referenced by Aleph::DynDlist< T >::Iterator::reset_first(), TEST(), and TEST_F().
|
inlinenoexcept |
Reset the iterator to the last item of list.
Definition at line 702 of file dlink.H.
References curr, Aleph::Dlink::get_prev(), head, and Aleph::maps().
Referenced by Aleph::DynDlist< T >::Iterator::reset_last(), TEST(), TEST_F(), and TEST_F().
Set the current node .
This method set the current node to new_curr, which of course must be a valid pointer to a item in the list.
| [in] | new_curr | pointer to the new current item |
Definition at line 686 of file dlink.H.
References curr, head, and Aleph::maps().
Definition at line 651 of file dlink.H.
Referenced by del(), del_ne(), get_curr_ne(), has_curr(), is_in_first(), is_last(), next_ne(), operator!=(), operator==(), prev_ne(), reset_first(), reset_last(), and set().
Definition at line 650 of file dlink.H.
Referenced by del(), del_ne(), get_curr_ne(), has_curr(), is_in_first(), is_last(), reset_first(), reset_last(), set(), verify(), and verify().