SLIP  1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | List of all members
slip::const_iterator2d_range< T > Class Template Reference

This is some iterator to iterate a 2d container into two Range defined by the indices and strides of the 2d container. More...

#include <Array2d.hpp>

Public Types

typedef
std::random_access_iterator2d_tag 
iterator_category
 
typedef Container2D::value_type value_type
 
typedef DPoint2d< int > difference_type
 
typedef Container2D::const_pointer pointer
 
typedef
Container2D::const_reference 
reference
 
typedef const_iterator2d_range self
 
typedef Container2D::size_type size_type
 

Public Member Functions

reference operator* () const
 Dereference operator. Returns the element that the current const_iterator2d_range i point to. More...
 
pointer operator-> () const
 
Constructors & Destructors
 const_iterator2d_range ()
 Constructs a const_iterator2d_range. More...
 
 const_iterator2d_range (Container2D *c, const slip::Range< int > &r1, const slip::Range< int > &r2)
 Constructs a const_iterator2d_range. More...
 
 const_iterator2d_range (const self &o)
 Constructs a copy of the const_iterator2d_range o. More...
 
Assignment operators and methods
selfoperator= (const self &o)
 Assign a const_iterator2d_range. More...
 
Forward operators addons
selfoperator++ ()
 Preincrement a const_iterator2d_range. Iterate to the next location inside the Range. More...
 
self operator++ (int)
 Postincrement a const_iterator2d_range. Iterate to the next location inside the Range2d. More...
 
Bidirectional operators addons
selfoperator-- ()
 Predecrement a const_iterator2d_range. Iterate to the previous location inside the Range2d. More...
 
self operator-- (int)
 Postdecrement a const_iterator2d_range. Iterate to the previous location inside the Range2d. More...
 
Indices accessors
int x1 () const
 Access to the first index of the current const_iterator2d_range. More...
 
int i () const
 Access to the first index of the current const_iterator2d_range. More...
 
int x2 () const
 Access to the second index of the current const_iterator2d_range. More...
 
int j () const
 Access to the second index of the current const_iterator2d_range. More...
 

Friends

Equality comparable operators
bool operator== (const self &i1, const self &i2)
 Equality operator. More...
 
bool operator!= (const self &i1, const self &i2)
 Inequality operator. More...
 
Strict Weakly comparable operators
bool operator< (const self &i1, const self &i2)
 < operator. More...
 
bool operator> (const self &i1, const self &i2)
 

operator.

More...
 
bool operator<= (const self &i1, const self &i2)
 <= operator. More...
 
bool operator>= (const self &i1, const self &i2)
 >= operator. More...
 

const_iterator2d_range operators addons

selfoperator+= (const difference_type &d)
 const_iterator2d_range addition. More...
 
selfoperator-= (const difference_type &d)
 const_iterator2d_range substraction. More...
 
self operator+ (const difference_type &d)
 const_iterator2d_range addition. More...
 
self operator- (const difference_type &d)
 const_iterator2d_range substraction. More...
 
reference operator[] (difference_type d) const
 const_iterator2d_range element assignment operator. Equivalent to *(i + d). More...
 
Container2D::const_row_range_iterator row_begin (size_type row) const
 const_iterator2d_range element assignment operator. More...
 
Container2D::const_row_range_iterator row_end (size_type row) const
 const_iterator2d_range element assignment operator. More...
 
Container2D::const_col_range_iterator col_begin (size_type col) const
 const_iterator2d_range element assignment operator. More...
 
Container2D::const_col_range_iterator col_end (size_type col) const
 const_iterator2d_range element assignment operator. More...
 
difference_type operator- (const self &i1, const self &i2)
 const_iterator2d_range difference operator. More...
 

Detailed Description

template<class T>
class slip::const_iterator2d_range< T >

This is some iterator to iterate a 2d container into two Range defined by the indices and strides of the 2d container.

Author
Benoit Tremblais <tremblais_AT_sic.univ-poitiers.fr>
Version
0.0.3
Date
2007/12/15
Parameters
Container2DType of 2d container in the const_iterator2d_range
Description:
This iterator is an 2d extension of the random_access_iterator. It is compatible with the bidirectional_iterator of the Standard library. It iterate into a range area defined inside the indices range of the 2d container. Those indices are defined as follows :
(0,0)--------> x2 (or j)
|
|
|
|
\|/
x1 (or i)
(0,0) is the upper left corner of the 2d container.

Definition at line 125 of file Array2d.hpp.

Member Typedef Documentation

template<class T >
typedef DPoint2d<int> slip::const_iterator2d_range< T >::difference_type

Definition at line 668 of file iterator2d_range.hpp.

Definition at line 666 of file iterator2d_range.hpp.

template<class T >
typedef Container2D::const_pointer slip::const_iterator2d_range< T >::pointer

Definition at line 669 of file iterator2d_range.hpp.

template<class T >
typedef Container2D::const_reference slip::const_iterator2d_range< T >::reference

Definition at line 670 of file iterator2d_range.hpp.

template<class T >
typedef const_iterator2d_range slip::const_iterator2d_range< T >::self

Definition at line 672 of file iterator2d_range.hpp.

template<class T >
typedef Container2D::size_type slip::const_iterator2d_range< T >::size_type

Definition at line 674 of file iterator2d_range.hpp.

template<class T >
typedef Container2D::value_type slip::const_iterator2d_range< T >::value_type

Definition at line 667 of file iterator2d_range.hpp.

Constructor & Destructor Documentation

template<class T >
slip::const_iterator2d_range< T >::const_iterator2d_range ( )
inline

Constructs a const_iterator2d_range.

The range to iterate is in this case the full container

Definition at line 684 of file iterator2d_range.hpp.

template<class T >
slip::const_iterator2d_range< T >::const_iterator2d_range ( Container2D *  c,
const slip::Range< int > &  r1,
const slip::Range< int > &  r2 
)
inline

Constructs a const_iterator2d_range.

Parameters
cpointer to an existing 2d container
r1Range<int> defining the range of indices of the first axis to iterate
r2Range<int> defining the range of indices of the second axis to iterate
Precondition
range indices must be inside those of the 2d container

Definition at line 698 of file iterator2d_range.hpp.

template<class T >
slip::const_iterator2d_range< T >::const_iterator2d_range ( const self o)
inline

Constructs a copy of the const_iterator2d_range o.

Parameters
oconst_iterator2d_range to copy.

Definition at line 709 of file iterator2d_range.hpp.

Member Function Documentation

template<class T >
Container2D::const_col_range_iterator slip::const_iterator2d_range< T >::col_begin ( size_type  col) const
inline

const_iterator2d_range element assignment operator.

Parameters
coloffset.
Returns
a const col_range_iterator to the first element of range at the col col of the container
Todo:
add assert

Definition at line 1118 of file iterator2d_range.hpp.

template<class T >
Container2D::const_col_range_iterator slip::const_iterator2d_range< T >::col_end ( size_type  col) const
inline

const_iterator2d_range element assignment operator.

Parameters
coloffset.
Returns
a const col_range_iterator to the past-the-end element of range at the col col of the container
Todo:
add assert

Definition at line 1133 of file iterator2d_range.hpp.

template<class T >
int slip::const_iterator2d_range< T >::i ( ) const
inline

Access to the first index of the current const_iterator2d_range.

Returns
the first index.

Definition at line 1161 of file iterator2d_range.hpp.

template<class T >
int slip::const_iterator2d_range< T >::j ( ) const
inline

Access to the second index of the current const_iterator2d_range.

Returns
the second index.

Definition at line 1179 of file iterator2d_range.hpp.

template<class T >
reference slip::const_iterator2d_range< T >::operator* ( ) const
inline

Dereference operator. Returns the element that the current const_iterator2d_range i point to.

Returns
a const const_iterator2d_range reference.

Definition at line 751 of file iterator2d_range.hpp.

template<class T >
self slip::const_iterator2d_range< T >::operator+ ( const difference_type d)
inline

const_iterator2d_range addition.

Parameters
ddifference_type
Returns
a const_iterator2d_range reference
Precondition
All the iterators between the current iterator i and i + d must be dereferenceable.

Definition at line 1021 of file iterator2d_range.hpp.

template<class T >
self& slip::const_iterator2d_range< T >::operator++ ( )
inline

Preincrement a const_iterator2d_range. Iterate to the next location inside the Range.

Definition at line 775 of file iterator2d_range.hpp.

template<class T >
self slip::const_iterator2d_range< T >::operator++ ( int  )
inline

Postincrement a const_iterator2d_range. Iterate to the next location inside the Range2d.

Definition at line 810 of file iterator2d_range.hpp.

template<class T >
self& slip::const_iterator2d_range< T >::operator+= ( const difference_type d)
inline

const_iterator2d_range addition.

Parameters
ddifference_type
Returns
a const_iterator2d_range reference
Precondition
All the iterators between the current iterator i and i + d must be dereferenceable.

Definition at line 985 of file iterator2d_range.hpp.

template<class T >
self slip::const_iterator2d_range< T >::operator- ( const difference_type d)
inline

const_iterator2d_range substraction.

Parameters
ddifference_type
Returns
a const_iterator2d_range reference
Precondition
All the iterators between the current iterator i and i - d must be dereferenceable.

Definition at line 1036 of file iterator2d_range.hpp.

template<class T >
self& slip::const_iterator2d_range< T >::operator-- ( )
inline

Predecrement a const_iterator2d_range. Iterate to the previous location inside the Range2d.

Definition at line 829 of file iterator2d_range.hpp.

template<class T >
self slip::const_iterator2d_range< T >::operator-- ( int  )
inline

Postdecrement a const_iterator2d_range. Iterate to the previous location inside the Range2d.

Definition at line 862 of file iterator2d_range.hpp.

template<class T >
self& slip::const_iterator2d_range< T >::operator-= ( const difference_type d)
inline

const_iterator2d_range substraction.

Parameters
ddifference_type
Returns
a const_iterator2d_range reference
Precondition
All the iterators between the current iterator i and i - d must be dereferenceable.

Definition at line 1005 of file iterator2d_range.hpp.

template<class T >
pointer slip::const_iterator2d_range< T >::operator-> ( ) const
inline

Definition at line 757 of file iterator2d_range.hpp.

template<class T >
self& slip::const_iterator2d_range< T >::operator= ( const self o)
inline

Assign a const_iterator2d_range.

Assign elements of const_iterator2d_range in o.

Parameters
oconst_iterator2d_range to get the values from.
Returns
a const_iterator2d_range reference.

Definition at line 728 of file iterator2d_range.hpp.

template<class T >
reference slip::const_iterator2d_range< T >::operator[] ( difference_type  d) const
inline

const_iterator2d_range element assignment operator. Equivalent to *(i + d).

Parameters
ddifference_type.
Returns
a const reference to the 2d container elements
Precondition
(i + d) exists and is dereferenceable.

Definition at line 1073 of file iterator2d_range.hpp.

template<class T >
Container2D::const_row_range_iterator slip::const_iterator2d_range< T >::row_begin ( size_type  row) const
inline

const_iterator2d_range element assignment operator.

Parameters
rowoffset.
Returns
a const_row_range_iterator to the first element of range at the row row of range
Todo:
add assert

Definition at line 1090 of file iterator2d_range.hpp.

template<class T >
Container2D::const_row_range_iterator slip::const_iterator2d_range< T >::row_end ( size_type  row) const
inline

const_iterator2d_range element assignment operator.

Parameters
rowoffset.
Returns
a const_row_range_iterator to the past-the-end element of range at the row row of range
Todo:
add assert

Definition at line 1104 of file iterator2d_range.hpp.

template<class T >
int slip::const_iterator2d_range< T >::x1 ( ) const
inline

Access to the first index of the current const_iterator2d_range.

Returns
the first index.

Definition at line 1152 of file iterator2d_range.hpp.

template<class T >
int slip::const_iterator2d_range< T >::x2 ( ) const
inline

Access to the second index of the current const_iterator2d_range.

Returns
the second index.

Definition at line 1170 of file iterator2d_range.hpp.

Friends And Related Function Documentation

template<class T >
bool operator!= ( const self i1,
const self i2 
)
friend

Inequality operator.

Parameters
i1first const_iterator2d_range.
i2second const_iterator2d_range.
Returns
true if !(i1 == i2)

Definition at line 898 of file iterator2d_range.hpp.

template<class T >
difference_type operator- ( const self i1,
const self i2 
)
friend

const_iterator2d_range difference operator.

Parameters
i1first const_iterator2d_range.
i2second const_iterator2d_range.
Returns
a difference_type d such that i1 = i2 + stride*d.
Precondition
Either i1 is reachable from i2, or i2 is reachable from i1.
Both strides must be equal

Definition at line 1052 of file iterator2d_range.hpp.

template<class T >
bool operator< ( const self i1,
const self i2 
)
friend

< operator.

Parameters
i1first iterator2d_box.
i2second iterator2d_box.
Returns
true i1.pos_ < i2_pos

Definition at line 917 of file iterator2d_range.hpp.

template<class T >
bool operator<= ( const self i1,
const self i2 
)
friend

<= operator.

Parameters
i1first iterator2d_box.
i2second iterator2d_box.
Returns
true if !(i2 < i1)

Definition at line 945 of file iterator2d_range.hpp.

template<class T >
bool operator== ( const self i1,
const self i2 
)
friend

Equality operator.

Parameters
i1first const_iterator2d_range.
i2second const_iterator2d_range.
Returns
true if i1 and i2 point to the same element of the 2d container

Definition at line 883 of file iterator2d_range.hpp.

template<class T >
bool operator> ( const self i1,
const self i2 
)
friend

operator.

Parameters
i1first iterator2d_box.
i2second iterator2d_box.
Returns
true i2 < i1

Definition at line 931 of file iterator2d_range.hpp.

template<class T >
bool operator>= ( const self i1,
const self i2 
)
friend

>= operator.

Parameters
i1first iterator2d_box.
i2second iterator2d_box.
Returns
true if !(i1 < i2)

Definition at line 959 of file iterator2d_range.hpp.


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