Aleph-w  1.9
General library for algorithms and data structures
Aleph::DynArray< T >::Iterator Class Reference

#include <tpl_dynArray.H>

Inherited by Aleph::DynArrayHeap< T, Compare >::Iterator.

+ Collaboration diagram for Aleph::DynArray< T >::Iterator:

Public Types

using Set_Type = DynArray
 

Public Member Functions

 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
 
long get_pos () const noexcept
 Return the ordinal position of current item.
 
void next_ne () noexcept
 
void next ()
 
void prev_ne () noexcept
 exception. Be careful.
 
void prev ()
 
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.
 

Protected Attributes

DynArrayarray_ptr = nullptr
 
long curr_idx = 0
 

Detailed Description

template<typename T>
class Aleph::DynArray< T >::Iterator

Iterator on the elements 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.

Member Function Documentation

◆ get_curr()

template<typename T>
T& Aleph::DynArray< T >::Iterator::get_curr ( ) const
inline

Return the current item

Exceptions
overflow_errorif there is no current
+ Here is the call graph for this function:

◆ next()

template<typename T>
void Aleph::DynArray< T >::Iterator::next ( )
inline

Move the current a position forward. Throw overflow_error if current is the last item

+ Here is the call graph for this function:

◆ next_ne()

template<typename T>
void Aleph::DynArray< T >::Iterator::next_ne ( )
inlinenoexcept

Move the iterator one position forward guaranteeing no exception. Be careful.

◆ prev()

template<typename T>
void Aleph::DynArray< T >::Iterator::prev ( )
inline

Move the current a position backward. Throw underflow_error if current is the first item


The documentation for this class was generated from the following file:

Leandro Rabindranath León