#include <tpl_dynDlist.H>
|
|
long | get_pos () const noexcept |
| | Return the ordinal position of current item.
|
| |
| void | next_ne () noexcept |
| |
| void | next () |
| |
| void | prev () |
| |
|
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 theiterator 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 & | operator= (const Iterator &it) noexcept |
| |
| T & | get_curr () const |
| |
|
T & | get_curr_ne () const noexcept |
| |
| void | insert (const T &item) |
| |
| void | insert (T &&item) |
| |
| void | append (const T &item) |
| |
| void | append (T &&item) |
| |
| void | insert_list (DynDlist &list) |
| |
| void | append_list (DynDlist &list) |
| |
| T | del () |
| |
| void | set (Dlink *new_curr) noexcept |
| |
|
bool | has_curr () const noexcept |
| | Return true if the iterator has current item.
|
| |
|
bool | is_last () const noexcept |
| |
|
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 |
| |
|
bool | operator== (const Iterator &it) const noexcept |
| | Return true if this and it are positioned on the same item.
|
| |
|
bool | operator!= (const Iterator &it) const noexcept |
| | Return true if this and it hace different states.
|
| |
|
Dlink * | del_ne () noexcept |
| |
|
bool | verify (Dlink *l) const |
| | Return true if the iterator is on the list pointed by l
|
| |
|
bool | verify (const Iterator &it) const |
| | Return true if this and it are on the same list.
|
| |
template<typename T = int>
class Aleph::DynDlist< T >::Iterator
Iterator dynamic list.
◆ append() [1/2]
template<typename T = int>
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.
- Parameters
-
| [in] | item | the item to append |
- Exceptions
-
| bad_alloc | if there is no enough memory |
| overflow_error | if there is no current item |
◆ append() [2/2]
template<typename T = int>
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.
- Parameters
-
| [in] | item | the item to append |
- Exceptions
-
| bad_alloc | if there is no enough memory |
| overflow_error | if there is no current item |
◆ append_list()
template<typename T = int>
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.
- Parameters
-
| [in,out] | list | to append after current item. It becomes empty. |
- Exceptions
-
| overflow_error | if there is no current item |
◆ del()
template<typename T = int>
Remove from the list the current node and move the iterator one position forward.
- Returns
- a copy to removed item
- Exceptions
-
| overflow_error | if there is no current item |
◆ get_curr()
template<typename T = int>
Return the current item; throw overflow_error if there is no current item
◆ insert() [1/2]
template<typename T = int>
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.
- Parameters
-
| [in] | item | the item to insert |
- Exceptions
-
| bad_alloc | if there is no enough memory |
| overflow_error | if there is no current item |
◆ insert() [2/2]
template<typename T = int>
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.
- Parameters
-
| [in] | item | the item to insert |
- Exceptions
-
| bad_alloc | if there is no enough memory |
| overflow_error | if there is no current item |
◆ insert_list()
template<typename T = int>
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.
- Parameters
-
| [in,out] | list | to insert after current item. It becomes empty. |
- Exceptions
-
| overflow_error | if there is no current item |
◆ next()
template<typename T = int>
Move the iterator one item forward. Throw overflow_error if iterator has not current item
◆ next_ne()
template<typename T = int>
Move the iterator one position forward guaranteeing no exception. Be careful.
◆ prev()
template<typename T = int>
Move the iterator one item backward. Throw underflow_error if iterator has not current item
◆ prev_ne()
| void Aleph::Dlink::Iterator::prev_ne |
( |
| ) |
|
|
inlinenoexceptinherited |
Move the iterator one position backward guaranteeing no exception. Be careful.
◆ set()
| void Aleph::Dlink::Iterator::set |
( |
Dlink * |
new_curr | ) |
|
|
inlinenoexceptinherited |
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.
- Parameters
-
| [in] | new_curr | pointer to the new current item |
The documentation for this class was generated from the following file: