rasdaman client API  10.6.3
The Array Analytics Engine: Datacubes at Your Fingertips
Public Member Functions | List of all members
r_Iterator< T > Class Template Reference

The template class r_Iterator defines the generic behavior for iteration. More...

#include <collection.hh>

Public Member Functions

 r_Iterator ()=default
 default constructor More...
 
 r_Iterator (const r_Iterator< T > &iter)
 copy constructor More...
 
 r_Iterator (r_Collection< T > &source, int removed_objects=0)
 constructor getting the collection on which to iterate (used for r_Collection::create_iterator()) More...
 
 ~r_Iterator ()=default
 Creates an iterator which points to the first element of the element collection. More...
 
r_Iterator< T > & operator= (const r_Iterator< T > &iter)
 assignment operator More...
 
int is_equal (const r_Iterator< T > &iter) const
 comparisons: equal if they point to the same element in the same collection, not equal if they point to different collections or elements More...
 
r_Iterator< T > & operator++ ()
 prefix incrementor More...
 
r_Iterator< T > operator++ (int)
 postfix incrementor More...
 
void reset (int removed_objects=0)
 re-initialize the iterator to the start of iteration for the same collection More...
 
bool not_done () const
 Resets the iterator to point to the first element of the element collection. More...
 
void advance ()
 advances one element More...
 
operator* ()
 the dereference operator gets the actual element More...
 
get_element () const
 gets the actual element More...
 
bool next (T &element)
 gets the actual element, advances one element, and returns whether iteration is complete or not More...
 
void replace_element (const T &element)
 replaces the actual element (can only be used with r_List) More...
 

Detailed Description

template<class T>
class r_Iterator< T >

The template class r_Iterator defines the generic behavior for iteration.

All iterators use a consistent protocol for sequentially returning each element from the collection over which the iteration is defined. When an iterator is constructed, it is either initialized with another iterator or is set to null. When an iterator is constructed via the create_iterator() method defined in r_Collection, the iterator is initailized to point to the first element, if there is one.

Constructor & Destructor Documentation

◆ r_Iterator() [1/3]

template<class T >
r_Iterator< T >::r_Iterator ( )
default

default constructor

◆ r_Iterator() [2/3]

template<class T >
r_Iterator< T >::r_Iterator ( const r_Iterator< T > &  iter)

copy constructor

◆ r_Iterator() [3/3]

template<class T >
r_Iterator< T >::r_Iterator ( r_Collection< T > &  source,
int  removed_objects = 0 
)
explicit

constructor getting the collection on which to iterate (used for r_Collection::create_iterator())

◆ ~r_Iterator()

template<class T >
r_Iterator< T >::~r_Iterator ( )
default

Creates an iterator which points to the first element of the element collection.

If removed_objects ist set to 1, the iterator points to the first element of the list containing the removed objects (for internal use). destructor

Member Function Documentation

◆ advance()

template<class T >
void r_Iterator< T >::advance ( )

advances one element

◆ get_element()

template<class T >
T r_Iterator< T >::get_element ( ) const

gets the actual element

◆ is_equal()

template<class T >
int r_Iterator< T >::is_equal ( const r_Iterator< T > &  iter) const

comparisons: equal if they point to the same element in the same collection, not equal if they point to different collections or elements

◆ next()

template<class T >
bool r_Iterator< T >::next ( T &  element)

gets the actual element, advances one element, and returns whether iteration is complete or not

◆ not_done()

template<class T >
bool r_Iterator< T >::not_done ( ) const

Resets the iterator to point to the first element of the element collection.

If removed_objects ist set to 1, the iterator points to the first element of the list containing the removed objects (for internal use). returns 1 if there are more elements to be visited in the iteration and 0 if iteration is complete

◆ operator*()

template<class T >
T r_Iterator< T >::operator* ( )

the dereference operator gets the actual element

◆ operator++() [1/2]

template<class T >
r_Iterator<T>& r_Iterator< T >::operator++ ( )

prefix incrementor

◆ operator++() [2/2]

template<class T >
r_Iterator<T> r_Iterator< T >::operator++ ( int  )

postfix incrementor

◆ operator=()

template<class T >
r_Iterator<T>& r_Iterator< T >::operator= ( const r_Iterator< T > &  iter)

assignment operator

◆ replace_element()

template<class T >
void r_Iterator< T >::replace_element ( const T &  element)

replaces the actual element (can only be used with r_List)

◆ reset()

template<class T >
void r_Iterator< T >::reset ( int  removed_objects = 0)

re-initialize the iterator to the start of iteration for the same collection


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