|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Iterator dynamic list. More...
#include <tpl_dynDlist.H>
Public Types | |
| 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. | |
Public Member Functions | |
| 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 Types | |
| using | Base = typename Dnode< T >::Iterator |
Private Attributes | |
| DynDlist * | list_ptr |
| long | pos |
Iterator dynamic list.
Definition at line 485 of file tpl_dynDlist.H.
|
private |
Definition at line 490 of file tpl_dynDlist.H.
The type of element stored in the container.
Definition at line 498 of file tpl_dynDlist.H.
The type of container.
Definition at line 495 of file tpl_dynDlist.H.
|
inlinenoexcept |
Initialize the iterator to the first item of list
Definition at line 548 of file tpl_dynDlist.H.
|
inlinenoexcept |
Definition at line 554 of file tpl_dynDlist.H.
Append by copy an item before the current item.
This method appends a copy of item before the current item of iterator. The current item is not moved.
| [in] | item | the item to append |
| bad_alloc | if there is no enough memory |
| overflow_error | if there is no current item |
Definition at line 624 of file tpl_dynDlist.H.
References ah_overflow_error_if, Aleph::Dnode< T >::Iterator::get_curr(), Aleph::Dlink::Iterator::has_curr(), Aleph::DynDlist< T >::Iterator::list_ptr, FunctionalMethods< Container, T >::maps(), and Aleph::DynDlist< T >::num_elem.
Referenced by Aleph::DynDlist< T >::Iterator::append().
Append by movement an item after the current item.
This method appends a new element in the list before the current and then item is moved. The current item is not moved.
| [in] | item | the item to append |
| bad_alloc | if there is no enough memory |
| overflow_error | if there is no current item |
Definition at line 643 of file tpl_dynDlist.H.
References ah_overflow_error_if, Aleph::DynDlist< T >::Iterator::append(), Aleph::Dnode< T >::Iterator::get_curr(), Aleph::Dlink::Iterator::has_curr(), Aleph::DynDlist< T >::Iterator::list_ptr, FunctionalMethods< Container, T >::maps(), and Aleph::DynDlist< T >::num_elem.
|
inline |
Move and append all elements of list before the current item of iterator.
This operation takes constant time and puts the element of list just before the current item. The current item of iterator is not moved. A prev() operation will move forward the iterator to the last item of list.
After operation list becomes empty, since all its items were moved to the list on which one is iterating.
| [in,out] | list | to append after current item. It becomes empty. |
| overflow_error | if there is no current item |
Definition at line 695 of file tpl_dynDlist.H.
References ah_overflow_error_if, Aleph::Dnode< T >::Iterator::get_curr(), Aleph::Dlink::Iterator::has_curr(), Aleph::Dlink::is_empty(), Aleph::DynDlist< T >::Iterator::list_ptr, FunctionalMethods< Container, T >::maps(), and Aleph::DynDlist< T >::num_elem.
|
inline |
Remove from the list the current node and move the iterator one position forward.
| overflow_error | if there is no current item |
Definition at line 713 of file tpl_dynDlist.H.
References ah_overflow_error_if, Aleph::Dlink::del(), Aleph::Dnode< T >::Iterator::get_curr(), Aleph::Dnode< T >::get_data(), Aleph::Dlink::Iterator::has_curr(), Aleph::DynDlist< T >::Iterator::list_ptr, FunctionalMethods< Container, T >::maps(), Aleph::Dlink::Iterator::next(), and Aleph::DynDlist< T >::num_elem.
|
inlinenoexcept |
Put the iterator at the end state (where there is no current item)
Definition at line 542 of file tpl_dynDlist.H.
References put_itor_at_the_end().
|
inline |
Return the current item; throw overflow_error if there is no current item.
Definition at line 567 of file tpl_dynDlist.H.
References Aleph::Dnode< T >::Iterator::get_curr().
Referenced by Eepic_Plane::compute_extreme_points(), Aleph::Path< GT >::Iterator::get_curr_path_desc(), and Aleph::Path< GT >::get_last_arc().
|
inlinenoexcept |
Definition at line 572 of file tpl_dynDlist.H.
References Aleph::Dnode< T >::Iterator::get_curr_ne().
Referenced by Aleph::Path< GT >::Iterator::get_curr_path_desc_ne().
|
inlinenoexcept |
Return the ordinal position of current item.
Definition at line 501 of file tpl_dynDlist.H.
References Aleph::DynDlist< T >::Iterator::pos.
Insert by copy an item after the current item.
This method inserts a copy of item after the current item of iterator. The current item is not moved.
| [in] | item | the item to insert |
| bad_alloc | if there is no enough memory |
| overflow_error | if there is no current item |
Definition at line 586 of file tpl_dynDlist.H.
References ah_overflow_error_if, Aleph::Dnode< T >::Iterator::get_curr(), Aleph::Dlink::Iterator::has_curr(), Aleph::DynDlist< T >::Iterator::list_ptr, FunctionalMethods< Container, T >::maps(), and Aleph::DynDlist< T >::num_elem.
Referenced by Aleph::DynDlist< T >::Iterator::insert().
Insert by movement an item after the current item.
This method inserts a new element in the list after the current and then item is moved. The current item is not moved.
| [in] | item | the item to insert |
| bad_alloc | if there is no enough memory |
| overflow_error | if there is no current item |
Definition at line 605 of file tpl_dynDlist.H.
References ah_overflow_error_if, Aleph::Dnode< T >::Iterator::get_curr(), Aleph::Dlink::Iterator::has_curr(), Aleph::DynDlist< T >::Iterator::insert(), Aleph::DynDlist< T >::Iterator::list_ptr, FunctionalMethods< Container, T >::maps(), and Aleph::DynDlist< T >::num_elem.
|
inline |
Move and insert all elements of list after the current item of iterator.
This operation takes constant time and puts the element of list just after the current item. The current item of iterator is not moved. A next() operation will move forward the iterator to the first item of list.
After operation list becomes empty, since all its items were moved to the list on which one is iterating.
| [in,out] | list | to insert after current item. It becomes empty. |
| overflow_error | if there is no current item |
Definition at line 668 of file tpl_dynDlist.H.
References ah_overflow_error_if, Aleph::Dnode< T >::Iterator::get_curr(), Aleph::Dlink::Iterator::has_curr(), Aleph::Dlink::is_empty(), Aleph::DynDlist< T >::Iterator::list_ptr, FunctionalMethods< Container, T >::maps(), and Aleph::DynDlist< T >::num_elem.
|
inline |
Move the iterator one item forward.
Throw overflow_error if iterator has not current item
Definition at line 513 of file tpl_dynDlist.H.
References Aleph::Dlink::Iterator::next(), and Aleph::DynDlist< T >::Iterator::pos.
Referenced by Eepic_Plane::compute_extreme_points(), TYPED_TEST(), and TYPED_TEST().
|
inlinenoexcept |
Move the iterator one position forward guaranteeing no exception.
Be careful.
Definition at line 505 of file tpl_dynDlist.H.
References Aleph::Dlink::Iterator::next_ne(), and Aleph::DynDlist< T >::Iterator::pos.
Referenced by Eepic_Plane::compute_extreme_points().
|
inlinenoexcept |
Definition at line 556 of file tpl_dynDlist.H.
References Aleph::DynDlist< T >::Iterator::list_ptr, and Aleph::DynDlist< T >::Iterator::pos.
|
inline |
Move the iterator one item backward.
Throw underflow_error if iterator has not current item
Definition at line 521 of file tpl_dynDlist.H.
References Aleph::DynDlist< T >::Iterator::pos, and Aleph::Dlink::Iterator::prev().
Referenced by Aleph::Path< GT >::get_last_arc().
|
inlinenoexcept |
Reset the iterator to the first item.
Definition at line 528 of file tpl_dynDlist.H.
References Aleph::DynDlist< T >::Iterator::pos, and Aleph::Dlink::Iterator::reset_first().
|
inlinenoexcept |
Reset the iterator to the last item.
Definition at line 535 of file tpl_dynDlist.H.
References Aleph::DynDlist< T >::Iterator::list_ptr, Aleph::DynDlist< T >::num_elem, Aleph::DynDlist< T >::Iterator::pos, and Aleph::Dlink::Iterator::reset_last().
Referenced by Aleph::Path< GT >::get_last_arc().
|
private |
Definition at line 487 of file tpl_dynDlist.H.
Referenced by Aleph::DynDlist< T >::Iterator::append(), Aleph::DynDlist< T >::Iterator::append(), Aleph::DynDlist< T >::Iterator::append_list(), Aleph::DynDlist< T >::Iterator::del(), Aleph::DynDlist< T >::Iterator::insert(), Aleph::DynDlist< T >::Iterator::insert(), Aleph::DynDlist< T >::Iterator::insert_list(), Aleph::DynDlist< T >::Iterator::operator=(), and Aleph::DynDlist< T >::Iterator::reset_last().
|
private |
Definition at line 488 of file tpl_dynDlist.H.
Referenced by Aleph::DynDlist< T >::Iterator::get_pos(), Aleph::DynDlist< T >::Iterator::next(), Aleph::DynDlist< T >::Iterator::next_ne(), Aleph::DynDlist< T >::Iterator::operator=(), Aleph::DynDlist< T >::Iterator::prev(), Aleph::DynDlist< T >::Iterator::reset_first(), and Aleph::DynDlist< T >::Iterator::reset_last().