|
Aleph-w 7.10.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 the 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 (DynDlist< T > &list) noexcept | |
Iterator on the first item of the modifiable list list. | |
| Iterator (const DynDlist< T > &)=delete | |
| A constant list is iterated through Const_Iterator. | |
| Iterator () noexcept | |
| Iterator (const Iterator &)=default | |
| 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 |
| 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 Types | |
| using | Base = typename Dnode< T >::Iterator |
Private Attributes | |
| DynDlist * | list_ptr |
| long | pos |
Iterator dynamic list.
Definition at line 605 of file tpl_dynDlist.H.
|
private |
Definition at line 610 of file tpl_dynDlist.H.
| using Aleph::DynDlist< T >::Iterator::Item_Type = T |
The type of element stored in the container.
Definition at line 617 of file tpl_dynDlist.H.
| using Aleph::DynDlist< T >::Iterator::Set_Type = DynDlist |
The type of container.
Definition at line 614 of file tpl_dynDlist.H.
|
inlinenoexcept |
Iterator on the first item of the modifiable list list.
Definition at line 670 of file tpl_dynDlist.H.
|
delete |
A constant list is iterated through Const_Iterator.
|
inlinenoexcept |
Definition at line 678 of file tpl_dynDlist.H.
|
default |
|
inline |
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 751 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, and Aleph::DynDlist< T >::num_elem.
Referenced by Polinomio::operator+=().
|
inline |
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 769 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, 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 818 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, 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 835 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, Aleph::Dlink::Iterator::next(), and Aleph::DynDlist< T >::num_elem.
Referenced by Polinomio::operator+=(), and orden_ejecucion().
|
inlinenoexcept |
Put the iterator at the end state (where there is no current item)
Definition at line 664 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 697 of file tpl_dynDlist.H.
References Aleph::Dnode< T >::Iterator::get_curr().
Referenced by Eepic_Plane::compute_extreme_points(), Polinomio::operator+=(), and orden_ejecucion().
|
inlinenoexcept |
Definition at line 702 of file tpl_dynDlist.H.
References Aleph::Dnode< T >::Iterator::get_curr_ne().
Referenced by Aleph::sort_utils_detail::counting_sort_impl().
|
inlinenoexcept |
Return the ordinal position of the current item.
Definition at line 620 of file tpl_dynDlist.H.
References Aleph::DynDlist< T >::Iterator::pos.
|
inline |
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 716 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, and Aleph::DynDlist< T >::num_elem.
|
inline |
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 734 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, 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 792 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, and Aleph::DynDlist< T >::num_elem.
|
inline |
Move the iterator one item forward.
Throw overflow_error if the iterator has no current item
Definition at line 635 of file tpl_dynDlist.H.
References Aleph::Dlink::Iterator::next(), and Aleph::DynDlist< T >::Iterator::pos.
Referenced by avanceItor(), Eepic_Plane::compute_extreme_points(), and Polinomio::operator+=().
|
inlinenoexcept |
Move the iterator one position forward guaranteeing no exception.
Be careful.
Definition at line 627 of file tpl_dynDlist.H.
References Aleph::Dlink::Iterator::next_ne(), and Aleph::DynDlist< T >::Iterator::pos.
Referenced by Eepic_Plane::compute_extreme_points(), and Aleph::sort_utils_detail::counting_sort_impl().
|
inlinenoexcept |
Definition at line 684 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 the iterator has no current item
Definition at line 643 of file tpl_dynDlist.H.
References Aleph::DynDlist< T >::Iterator::pos, and Aleph::Dlink::Iterator::prev().
|
inlinenoexcept |
Reset the iterator to the first item.
Definition at line 650 of file tpl_dynDlist.H.
References Aleph::DynDlist< T >::Iterator::pos, and Aleph::Dlink::Iterator::reset_first().
Referenced by avanceItor().
|
inlinenoexcept |
Reset the iterator to the last item.
Definition at line 657 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().
|
private |
Definition at line 607 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 608 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().