Public Types | Public Member Functions | Friends
range2d_iterator< I > Class Template Reference

a 2D iterator that knows its position in the 2D grid ans supports iterating over sub-ranges More...

#include <mia/2d/iterator.hh>

Inheritance diagram for range2d_iterator< I >:

Public Types

enum  EBoundary {
  eb_none = 0, eb_xlow = 1, eb_xhigh = 2, eb_x = 3,
  eb_ylow = 4, eb_yhigh = 8, eb_y = 0xC
}
 
typedef I internal_iterator
 data type for the real iterator in the background More...
 
typedef I::pointer pointer
 data type pointer More...
 
typedef I::reference reference
 data type reference More...
 

Public Member Functions

int get_boundary_flags () const
 
internal_iterator get_point ()
 
reference operator* () const
 
range2d_iterator< I > & operator++ ()
 prefix increment More...
 
range2d_iterator< I > operator++ (int)
 postfix increment More...
 
pointer operator-> () const
 
range2d_iterator< I > & operator= (const range2d_iterator< I > &other)
 assignment operator More...
 
template<typename AI >
range2d_iterator< I > & operator= (const range2d_iterator< AI > &other)
 
const C2DBoundspos () const
 
 range2d_iterator ()
 
 range2d_iterator (const C2DBounds &pos, const C2DBounds &size, const C2DBounds &start, const C2DBounds &end, I iterator)
 
 range2d_iterator (const C2DBounds &pos)
 
 range2d_iterator (const range2d_iterator< I > &other)
 copy constructore More...
 
template<typename AI >
 range2d_iterator (const range2d_iterator< AI > &other)
 

Friends

template<typename AI >
class range2d_iterator
 friend iterator type because we may want to copy a iterator to a const_iterator. More...
 

Detailed Description

template<typename I>
class range2d_iterator< I >

a 2D iterator that knows its position in the 2D grid ans supports iterating over sub-ranges

Iterator to iterate over a sub-range of 2D data that is given on a grid. Two iterators are considered to be equal, if their positions are equal.

Template Parameters
theinternal iterator that is used to iterate of the original grid without skipping.

Definition at line 42 of file 2d/iterator.hh.

Member Typedef Documentation

template<typename I>
typedef I range2d_iterator< I >::internal_iterator

data type for the real iterator in the background

Definition at line 49 of file 2d/iterator.hh.

template<typename I>
typedef I::pointer range2d_iterator< I >::pointer

data type pointer

Definition at line 47 of file 2d/iterator.hh.

template<typename I>
typedef I::reference range2d_iterator< I >::reference

data type reference

Definition at line 45 of file 2d/iterator.hh.

Member Enumeration Documentation

template<typename I>
enum range2d_iterator::EBoundary

Enumerate to describe the various positions on the domain boundarys. These boundaries correspond to the full domain of the data, not to the sub-range this iteratior works on. I.e. if the sub-range is a subset of the open domain (i.e. without its boundary) then the iterator will never touch the domain boundary.

Enumerator
eb_none 

no boundary

eb_xlow 

at low x-boundary

eb_xhigh 

at high x-boundary

eb_x 

at one of the x-boundaries

eb_ylow 

at low y-boundary

eb_yhigh 

at high y-boundary

eb_y 

at one of the y-boundaries

Definition at line 58 of file 2d/iterator.hh.

Constructor & Destructor Documentation

template<typename I>
range2d_iterator< I >::range2d_iterator ( )

standard constructor

template<typename I>
range2d_iterator< I >::range2d_iterator ( const C2DBounds pos,
const C2DBounds size,
const C2DBounds start,
const C2DBounds end,
iterator 
)

Full constructor of the range iterator

Parameters
positerator position to initialize the iterator with
sizesize of the original data field
startstart of the iterator range
endend of the iterator range
iteratorthe iterator of the underlying 2D data structure
template<typename I>
range2d_iterator< I >::range2d_iterator ( const C2DBounds pos)

End iterator, can't be dereferenced This iterator is only there to define the end position of the range_iterator.

Parameters
posend position to set this iterator to.
template<typename I>
range2d_iterator< I >::range2d_iterator ( const range2d_iterator< I > &  other)

copy constructore

template<typename I >
template<typename AI >
range2d_iterator< I >::range2d_iterator ( const range2d_iterator< AI > &  other)

Constructor to construct the iterator from one that is based on another iterator type. The usual idea is that a iterator may be converted into it's const variant.

Template Parameters
AIthe other iterator type. Iterator type I must be copy-constructable from type AI
Parameters
other

Definition at line 182 of file 2d/iterator.hh.

Member Function Documentation

template<typename I>
int range2d_iterator< I >::get_boundary_flags ( ) const
Returns
the flags describing whether the iterator is on a domain boundary.
template<typename I>
internal_iterator range2d_iterator< I >::get_point ( )

Return the internal iterator

template<typename I>
reference range2d_iterator< I >::operator* ( ) const
Returns
current value the iterator points to
template<typename I>
range2d_iterator<I>& range2d_iterator< I >::operator++ ( )

prefix increment

template<typename I>
range2d_iterator<I> range2d_iterator< I >::operator++ ( int  )

postfix increment

template<typename I>
pointer range2d_iterator< I >::operator-> ( ) const
Returns
pointer to the current value the iterator points to
template<typename I>
range2d_iterator<I>& range2d_iterator< I >::operator= ( const range2d_iterator< I > &  other)

assignment operator

template<typename I >
template<typename AI >
range2d_iterator< I > & range2d_iterator< I >::operator= ( const range2d_iterator< AI > &  other)

Assignment operator from another type of iterator

Template Parameters
AIother iterator type. The assignment I b = a; with a of type AI must be defined.
Parameters
other

Definition at line 168 of file 2d/iterator.hh.

template<typename I>
const C2DBounds& range2d_iterator< I >::pos ( ) const
Returns
the current position within the 2D grid with respect to the full size of the grid.

Friends And Related Function Documentation

template<typename I>
template<typename AI >
friend class range2d_iterator
friend

friend iterator type because we may want to copy a iterator to a const_iterator.

Definition at line 99 of file 2d/iterator.hh.


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