|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Iterator on the items of array. More...
#include <tpl_dynArray.H>
Public Types | |
| using | Set_Type = DynArray |
Public Member Functions | |
| Iterator () noexcept=default | |
| Default constructor creates an "end" iterator. | |
| Iterator (const DynArray &array) noexcept | |
Initializes an iterator on array | |
| bool | has_curr () const noexcept |
Return true if there is current item. | |
| bool | is_last () const noexcept |
| T & | get_curr_ne () const noexcept |
| Return the current link guaranteeing no exception. Be careful. | |
| T & | get_curr () const |
| Return the current item. | |
| 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 current a position forward. | |
| void | prev_ne () noexcept |
| exception. Be careful. | |
| void | prev () |
| Move the current a position backward. | |
| void | reset_last () noexcept |
| Reset the iterator to the last item. | |
| void | end () noexcept |
| Put the iterator in the end state. | |
| void | reset_first () noexcept |
| Reset the iterator to the first item. | |
| void | set_pos (const long pos) noexcept |
Protected Attributes | |
| DynArray * | array_ptr = nullptr |
| long | curr_idx = 0 |
Iterator on the items of array.
The visit order is from the lower index 0 to current dimension minus one.
It is assumed that all the entries between 0 and current dimension have been allocated.
Definition at line 1331 of file tpl_dynArray.H.
Definition at line 1338 of file tpl_dynArray.H.
|
defaultnoexcept |
Default constructor creates an "end" iterator.
|
inlinenoexcept |
Initializes an iterator on array
Definition at line 1344 of file tpl_dynArray.H.
|
inlinenoexcept |
Put the iterator in the end state.
Definition at line 1402 of file tpl_dynArray.H.
References Aleph::DynArray< T >::Iterator::array_ptr, Aleph::DynArray< T >::Iterator::curr_idx, and Aleph::DynArray< T >::size().
|
inline |
Return the current item.
| overflow_error | if there is no current |
Definition at line 1365 of file tpl_dynArray.H.
References ah_overflow_error_if, Aleph::DynArray< T >::Iterator::array_ptr, Aleph::DynArray< T >::Iterator::curr_idx, Aleph::DynArray< T >::Iterator::get_curr_ne(), and Aleph::DynArray< T >::size().
|
inlinenoexcept |
Return the current link guaranteeing no exception. Be careful.
Definition at line 1359 of file tpl_dynArray.H.
References Aleph::DynArray< T >::access(), Aleph::DynArray< T >::Iterator::array_ptr, and Aleph::DynArray< T >::Iterator::curr_idx.
Referenced by Aleph::DynArray< T >::Iterator::get_curr().
|
inlinenoexcept |
Return the ordinal position of current item.
Definition at line 1372 of file tpl_dynArray.H.
References Aleph::DynArray< T >::Iterator::curr_idx.
|
inlinenoexcept |
Return true if there is current item.
Definition at line 1351 of file tpl_dynArray.H.
References Aleph::DynArray< T >::Iterator::array_ptr, Aleph::DynArray< T >::Iterator::curr_idx, FunctionalMethods< DynArray< T >, T >::maps(), and Aleph::DynArray< T >::size().
|
inlinenoexcept |
Definition at line 1356 of file tpl_dynArray.H.
References Aleph::DynArray< T >::Iterator::array_ptr, Aleph::DynArray< T >::Iterator::curr_idx, and Aleph::DynArray< T >::size().
|
inline |
Move the current a position forward.
Throw overflow_error if current is the last item
Definition at line 1380 of file tpl_dynArray.H.
References ah_overflow_error_if, Aleph::DynArray< T >::Iterator::array_ptr, Aleph::DynArray< T >::Iterator::curr_idx, Aleph::DynArray< T >::Iterator::next_ne(), and Aleph::DynArray< T >::size().
|
inlinenoexcept |
Move the iterator one position forward guaranteeing no exception.
Be careful.
Definition at line 1376 of file tpl_dynArray.H.
References Aleph::DynArray< T >::Iterator::curr_idx.
Referenced by Aleph::DynArrayHeap< T, Compare >::Iterator::Iterator(), and Aleph::DynArray< T >::Iterator::next().
|
inline |
Move the current a position backward.
Throw underflow_error if current is the first item
Definition at line 1392 of file tpl_dynArray.H.
References ah_underflow_error_if, Aleph::DynArray< T >::Iterator::curr_idx, and Aleph::DynArray< T >::Iterator::prev_ne().
|
inlinenoexcept |
exception. Be careful.
Definition at line 1388 of file tpl_dynArray.H.
References Aleph::DynArray< T >::Iterator::curr_idx.
Referenced by Aleph::DynArray< T >::Iterator::prev().
|
inlinenoexcept |
Reset the iterator to the first item.
Definition at line 1405 of file tpl_dynArray.H.
References Aleph::DynArray< T >::Iterator::curr_idx.
|
inlinenoexcept |
Reset the iterator to the last item.
Definition at line 1399 of file tpl_dynArray.H.
References Aleph::DynArray< T >::Iterator::array_ptr, Aleph::DynArray< T >::Iterator::curr_idx, and Aleph::DynArray< T >::size().
Definition at line 1407 of file tpl_dynArray.H.
References Aleph::DynArray< T >::Iterator::curr_idx.
Referenced by Aleph::DynArray< T >::get_it().
Definition at line 1334 of file tpl_dynArray.H.
Referenced by Aleph::DynArray< T >::Iterator::end(), Aleph::DynArray< T >::Iterator::get_curr(), Aleph::DynArray< T >::Iterator::get_curr_ne(), Aleph::DynArray< T >::Iterator::has_curr(), Aleph::DynArrayHeap< T, Compare >::Iterator::has_curr(), Aleph::DynArray< T >::Iterator::is_last(), Aleph::DynArray< T >::Iterator::next(), and Aleph::DynArray< T >::Iterator::reset_last().
|
protected |
Definition at line 1335 of file tpl_dynArray.H.
Referenced by Aleph::DynArray< T >::Iterator::end(), Aleph::DynArray< T >::Iterator::get_curr(), Aleph::DynArray< T >::Iterator::get_curr_ne(), Aleph::DynArray< T >::Iterator::get_pos(), Aleph::DynArray< T >::Iterator::has_curr(), Aleph::DynArrayHeap< T, Compare >::Iterator::has_curr(), Aleph::DynArray< T >::Iterator::is_last(), Aleph::DynArray< T >::Iterator::next(), Aleph::DynArray< T >::Iterator::next_ne(), Aleph::DynArray< T >::Iterator::prev(), Aleph::DynArray< T >::Iterator::prev_ne(), Aleph::DynArray< T >::Iterator::reset_first(), Aleph::DynArray< T >::Iterator::reset_last(), and Aleph::DynArray< T >::Iterator::set_pos().