Fréchet View  1.6.0
A Tool for Exploring Fréchet Distance Algorithms
frechet::data::Array2D< T >::iterator Class Reference

Detailed Description

template<class T>
class frechet::data::Array2D< T >::iterator

an Array2D iterator

Iterates the array in column-major order. Allows for (column,row) indexing, as well as linear indexing.

Note that iterators allow for modifications to the underlying array (contrary to some stand iterators).

Definition at line 95 of file array2d.h.

#include <array2d.h>

Public Member Functions

 iterator ()
 default constructor More...
 
iteratoroperator= (const iterator &that)
 
bool operator== (const iterator &that) const
 equality comparator More...
 
bool operator!= (const iterator &that) const
 non-equality comparator More...
 
bool valid () const
 
bool valid (int off) const
 
int offset () const
 
int i () const
 
int j () const
 
T & operator * ()
 
T * operator-> ()
 
iteratoroperator++ ()
 pre-increment More...
 
iterator operator++ (int)
 post-increment More...
 
iteratoroperator-- ()
 pre-decrement More...
 
iterator operator-- (int)
 post-decrement More...
 
iteratorup ()
 move index one row up (increment) More...
 
iteratordown ()
 move index one row down (decrement) More...
 
iteratorright ()
 move index one column to the right (increment) More...
 
iteratorleft ()
 move index one column to the left (decrement) More...
 
iteratorto (int i, int j)
 move iterator to a given index More...
 
iteratorto (int off)
 move iterator to a given linear offset More...
 
T * leftNeighbor ()
 
T * rightNeighbor ()
 
T * topNeighbor ()
 
T * bottomNeighbor ()
 

Protected Member Functions

 iterator (Array2D *aparent, int start)
 constructor with parent and start index More...
 

Protected Attributes

Array2Dparent
 reference to paran More...
 
int _offset
 current offset More...
 

Constructor & Destructor Documentation

◆ iterator() [1/2]

template<class T>
frechet::data::Array2D< T >::iterator::iterator ( )
inline

default constructor

Definition at line 98 of file array2d.h.

◆ iterator() [2/2]

template<class T>
frechet::data::Array2D< T >::iterator::iterator ( Array2D aparent,
int  start 
)
inlineprotected

constructor with parent and start index

Parameters
aparentparent array
startinitial index

Definition at line 208 of file array2d.h.

Member Function Documentation

◆ bottomNeighbor()

template<class T>
T* frechet::data::Array2D< T >::iterator::bottomNeighbor ( )
inline
Returns
pointer to bottom neighbor entry, or nullptr

Definition at line 196 of file array2d.h.

◆ down()

template<class T>
iterator& frechet::data::Array2D< T >::iterator::down ( )
inline

move index one row down (decrement)

Returns
this iterator, after advancing it

Definition at line 156 of file array2d.h.

◆ i()

template<class T>
int frechet::data::Array2D< T >::iterator::i ( ) const
inline
Returns
current column index

Definition at line 128 of file array2d.h.

◆ j()

template<class T>
int frechet::data::Array2D< T >::iterator::j ( ) const
inline
Returns
current row index

Definition at line 130 of file array2d.h.

◆ left()

template<class T>
iterator& frechet::data::Array2D< T >::iterator::left ( )
inline

move index one column to the left (decrement)

Returns
this iterator, after advancing it

Definition at line 162 of file array2d.h.

◆ leftNeighbor()

template<class T>
T* frechet::data::Array2D< T >::iterator::leftNeighbor ( )
inline
Returns
pointer to left neighbor entry, or nullptr

Definition at line 175 of file array2d.h.

◆ offset()

template<class T>
int frechet::data::Array2D< T >::iterator::offset ( ) const
inline
Returns
current offset

Definition at line 126 of file array2d.h.

◆ operator *()

template<class T>
T& frechet::data::Array2D< T >::iterator::operator * ( )
inline
Returns
referenc to entry at current index

Definition at line 133 of file array2d.h.

◆ operator!=()

template<class T>
bool frechet::data::Array2D< T >::iterator::operator!= ( const iterator that) const
inline

non-equality comparator

Parameters
thatiterator to compare with
Returns
true, if both iterators point to different indexexs; or refer to different Array2D objects.

Definition at line 116 of file array2d.h.

◆ operator++() [1/2]

template<class T>
iterator& frechet::data::Array2D< T >::iterator::operator++ ( )
inline

pre-increment

Returns
this iterator, after advancing it

Definition at line 139 of file array2d.h.

◆ operator++() [2/2]

template<class T>
iterator frechet::data::Array2D< T >::iterator::operator++ ( int  )
inline

post-increment

Returns
a copy of this iterator, before advancing it

Definition at line 142 of file array2d.h.

◆ operator--() [1/2]

template<class T>
iterator& frechet::data::Array2D< T >::iterator::operator-- ( )
inline

pre-decrement

Returns
this iterator, after advancing it

Definition at line 146 of file array2d.h.

◆ operator--() [2/2]

template<class T>
iterator frechet::data::Array2D< T >::iterator::operator-- ( int  )
inline

post-decrement

Returns
a copy of this iterator, before advancing it

Definition at line 149 of file array2d.h.

◆ operator->()

template<class T>
T* frechet::data::Array2D< T >::iterator::operator-> ( )
inline
Returns
pointer to entry at current index

Definition at line 135 of file array2d.h.

◆ operator=()

template<class T>
iterator& frechet::data::Array2D< T >::iterator::operator= ( const iterator that)
inline

assignment operator

Parameters
thatiterator to copy from
Returns
this iterator

Definition at line 102 of file array2d.h.

◆ operator==()

template<class T>
bool frechet::data::Array2D< T >::iterator::operator== ( const iterator that) const
inline

equality comparator

Parameters
thatiterator to compare with
Returns
true, if both iterators point to the same index; and refer to the same Array2D object.

Definition at line 110 of file array2d.h.

◆ right()

template<class T>
iterator& frechet::data::Array2D< T >::iterator::right ( )
inline

move index one column to the right (increment)

Returns
this iterator, after advancing it

Definition at line 159 of file array2d.h.

◆ rightNeighbor()

template<class T>
T* frechet::data::Array2D< T >::iterator::rightNeighbor ( )
inline
Returns
pointer to right neighbor entry, or nullptr

Definition at line 182 of file array2d.h.

◆ to() [1/2]

template<class T>
iterator& frechet::data::Array2D< T >::iterator::to ( int  i,
int  j 
)
inline

move iterator to a given index

Parameters
icolumn index
jrow index
Returns
this iterator, after modification

Definition at line 168 of file array2d.h.

◆ to() [2/2]

template<class T>
iterator& frechet::data::Array2D< T >::iterator::to ( int  off)
inline

move iterator to a given linear offset

Parameters
offlinear offset
Returns
this iterator, after modification

Definition at line 172 of file array2d.h.

◆ topNeighbor()

template<class T>
T* frechet::data::Array2D< T >::iterator::topNeighbor ( )
inline
Returns
pointer to top neighbor entry, or nullptr

Definition at line 189 of file array2d.h.

◆ up()

template<class T>
iterator& frechet::data::Array2D< T >::iterator::up ( )
inline

move index one row up (increment)

Returns
this iterator, after advancing it

Definition at line 153 of file array2d.h.

◆ valid() [1/2]

template<class T>
bool frechet::data::Array2D< T >::iterator::valid ( ) const
inline
Returns
true if the iterator points to a valid index. false, if the index is out of range.

Definition at line 120 of file array2d.h.

◆ valid() [2/2]

template<class T>
bool frechet::data::Array2D< T >::iterator::valid ( int  off) const
inline
Parameters
offlinear offset into Array2D
Returns
true if the offset points to a valid index. false, if the index is out of range.

Definition at line 123 of file array2d.h.

Member Data Documentation

◆ _offset

template<class T>
int frechet::data::Array2D< T >::iterator::_offset
protected

current offset

Definition at line 212 of file array2d.h.

◆ parent

template<class T>
Array2D* frechet::data::Array2D< T >::iterator::parent
protected

reference to paran

Definition at line 210 of file array2d.h.


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