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::iterator2d_box< T > Class Template Reference

This is some iterator to iterate a 2d container into a slip::Box2d area defined by the indices 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::pointer pointer
 
typedef Container2D::reference reference
 
typedef iterator2d_box self
 
typedef Container2D::size_type size_type
 

Public Member Functions

reference operator* ()
 Dereference assignment operator. Returns the element that the current iterator2d_box i point to. More...
 
pointer operator-> ()
 
Constructors & Destructors
 iterator2d_box ()
 Constructs a iterator2d_box. More...
 
 iterator2d_box (Container2D *c, const Box2d< int > &b)
 Constructs a iterator2d_box. More...
 
 iterator2d_box (const self &o)
 Constructs a copy of the iterator2d_box o. More...
 
Assignment operators and methods
selfoperator= (const self &o)
 Assign a iterator2d_box. More...
 
Forward operators addons
selfoperator++ ()
 Preincrement a iterator2d_box. Iterate to the next location inside the Box2d. More...
 
self operator++ (int)
 Postincrement a iterator2d_box. Iterate to the next location inside the Box2d. More...
 
Bidirectional operators addons
selfoperator-- ()
 Predecrement a iterator2d_box. Iterate to the previous location inside the Box2d. More...
 
self operator-- (int)
 Postdecrement a iterator2d_box. Iterate to the previous location inside the Box2d. More...
 
Indices accessors
int x1 () const
 Access to the first index of the current iterator2d_box. More...
 
int i () const
 Access to the first index of the current iterator2d_box. More...
 
int x2 () const
 Access to the second index of the current iterator2d_box. More...
 
int j () const
 Access to the second index of the current iterator2d_box. 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...
 

iterator2d_box operators addons

selfoperator+= (const difference_type &d)
 iterator2d_box addition. More...
 
selfoperator-= (const difference_type &d)
 iterator2d_box substraction. More...
 
self operator+ (const difference_type &d)
 iterator2d_box addition. More...
 
self operator- (const difference_type &d)
 iterator2d_box substraction. More...
 
reference operator[] (difference_type d)
 iterator2d_box element assignment operator. Equivalent to *(i + d) = t. More...
 
Container2D::row_iterator row_begin (size_type row)
 iterator2d_box element assignment operator. More...
 
Container2D::row_iterator row_end (size_type row)
 iterator2d_box element assignment operator. More...
 
Container2D::reverse_row_iterator row_rbegin (size_type row)
 iterator2d_box element assignment operator. More...
 
Container2D::reverse_row_iterator row_rend (size_type row)
 iterator2d_box element assignment operator. More...
 
Container2D::col_iterator col_begin (size_type col)
 iterator2d_box element assignment operator. More...
 
Container2D::col_iterator col_end (size_type col)
 iterator2d_box element assignment operator. More...
 
Container2D::reverse_col_iterator col_rbegin (size_type col)
 iterator2d_box element assignment operator. More...
 
Container2D::reverse_col_iterator col_rend (size_type col)
 iterator2d_box element assignment operator. More...
 
Container2D::row_range_iterator row_begin (size_type row, const slip::Range< int > &range)
 iterator2d_box element assignment operator. More...
 
Container2D::row_range_iterator row_end (size_type row, const slip::Range< int > &range)
 iterator2d_box element assignment operator. More...
 
Container2D::col_range_iterator col_begin (size_type col, const slip::Range< int > &range)
 iterator2d_box element assignment operator. More...
 
Container2D::col_range_iterator col_end (size_type col, const slip::Range< int > &range)
 iterator2d_box element assignment operator. More...
 
difference_type operator- (const self &i1, const self &i2)
 iterator2d_box difference operator. More...
 

Detailed Description

template<class T>
class slip::iterator2d_box< T >

This is some iterator to iterate a 2d container into a slip::Box2d area defined by the indices of the 2d container.

Author
Benoit Tremblais <tremblais_AT_sic.univ-poitiers.fr>
Julien Dombre <dombre_AT_sic.univ-poitiers.fr>
Version
0.0.4
Date
18/12/2007
Parameters
Container2DType of 2d container in the iterator2d_box
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 box 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 116 of file Array2d.hpp.

Member Typedef Documentation

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

Definition at line 126 of file iterator2d_box.hpp.

Definition at line 124 of file iterator2d_box.hpp.

template<class T >
typedef Container2D::pointer slip::iterator2d_box< T >::pointer

Definition at line 127 of file iterator2d_box.hpp.

template<class T >
typedef Container2D::reference slip::iterator2d_box< T >::reference

Definition at line 128 of file iterator2d_box.hpp.

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

Definition at line 130 of file iterator2d_box.hpp.

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

Definition at line 132 of file iterator2d_box.hpp.

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

Definition at line 125 of file iterator2d_box.hpp.

Constructor & Destructor Documentation

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

Constructs a iterator2d_box.

The box to iterate is in this case the full container

Definition at line 142 of file iterator2d_box.hpp.

template<class T >
slip::iterator2d_box< T >::iterator2d_box ( Container2D *  c,
const Box2d< int > &  b 
)
inline

Constructs a iterator2d_box.

Parameters
cpointer to an existing 2d container
bBox2d<int> defining the range of indices to iterate
Precondition
box indices must be inside those of the 2d container

Definition at line 152 of file iterator2d_box.hpp.

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

Constructs a copy of the iterator2d_box o.

Parameters
oiterator2d_box to copy.

Definition at line 162 of file iterator2d_box.hpp.

Member Function Documentation

template<class T >
Container2D::col_iterator slip::iterator2d_box< T >::col_begin ( size_type  col)
inline

iterator2d_box element assignment operator.

Parameters
coloffset.
Returns
a col_iterator to the first element of the col col of the box

Definition at line 579 of file iterator2d_box.hpp.

template<class T >
Container2D::col_range_iterator slip::iterator2d_box< T >::col_begin ( size_type  col,
const slip::Range< int > &  range 
)
inline

iterator2d_box element assignment operator.

Parameters
coloffset.
rangeRange of the col to iterate.
Returns
a col_iterator to the first element of the range of col of the box

Definition at line 659 of file iterator2d_box.hpp.

template<class T >
Container2D::col_iterator slip::iterator2d_box< T >::col_end ( size_type  col)
inline

iterator2d_box element assignment operator.

Parameters
coloffset.
Returns
a col_iterator to the first element of the col col of the box

Definition at line 593 of file iterator2d_box.hpp.

template<class T >
Container2D::col_range_iterator slip::iterator2d_box< T >::col_end ( size_type  col,
const slip::Range< int > &  range 
)
inline

iterator2d_box element assignment operator.

Parameters
coloffset.
rangeRange of the col to iterate.
Returns
a col_iterator to the first element of the range of col of the box

Definition at line 674 of file iterator2d_box.hpp.

template<class T >
Container2D::reverse_col_iterator slip::iterator2d_box< T >::col_rbegin ( size_type  col)
inline

iterator2d_box element assignment operator.

Parameters
coloffset.
Returns
a reverse_col_iterator to the last element of the column col of the box

Definition at line 606 of file iterator2d_box.hpp.

template<class T >
Container2D::reverse_col_iterator slip::iterator2d_box< T >::col_rend ( size_type  col)
inline

iterator2d_box element assignment operator.

Parameters
coloffset.
Returns
a reverse_col_iterator to one previous the first element of the column col of the box

Definition at line 618 of file iterator2d_box.hpp.

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

Access to the first index of the current iterator2d_box.

Returns
the first index.

Definition at line 700 of file iterator2d_box.hpp.

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

Access to the second index of the current iterator2d_box.

Returns
the second index.

Definition at line 718 of file iterator2d_box.hpp.

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

Dereference assignment operator. Returns the element that the current iterator2d_box i point to.

Returns
a iterator2d_box reference.

Definition at line 201 of file iterator2d_box.hpp.

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

iterator2d_box addition.

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

Definition at line 461 of file iterator2d_box.hpp.

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

Preincrement a iterator2d_box. Iterate to the next location inside the Box2d.

Definition at line 223 of file iterator2d_box.hpp.

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

Postincrement a iterator2d_box. Iterate to the next location inside the Box2d.

Definition at line 255 of file iterator2d_box.hpp.

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

iterator2d_box addition.

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

Definition at line 425 of file iterator2d_box.hpp.

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

iterator2d_box substraction.

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

Definition at line 478 of file iterator2d_box.hpp.

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

Predecrement a iterator2d_box. Iterate to the previous location inside the Box2d.

Definition at line 274 of file iterator2d_box.hpp.

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

Postdecrement a iterator2d_box. Iterate to the previous location inside the Box2d.

Definition at line 306 of file iterator2d_box.hpp.

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

iterator2d_box substraction.

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

Definition at line 443 of file iterator2d_box.hpp.

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

Definition at line 207 of file iterator2d_box.hpp.

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

Assign a iterator2d_box.

Assign elements of iterator2d_box in o.

Parameters
oiterator2d_box to get the values from.
Returns
a iterator2d_box reference.

Definition at line 180 of file iterator2d_box.hpp.

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

iterator2d_box element assignment operator. Equivalent to *(i + d) = t.

Parameters
ddifference_type.
Returns
a reference to the 2d container elements
Precondition
(i + d) exists and is dereferenceable.
Postcondition
i[d] is a copy of reference.

Definition at line 512 of file iterator2d_box.hpp.

template<class T >
Container2D::row_iterator slip::iterator2d_box< T >::row_begin ( size_type  row)
inline

iterator2d_box element assignment operator.

Parameters
rowoffset.
Returns
a row_iterator to the first element of the row row of the box

Definition at line 528 of file iterator2d_box.hpp.

template<class T >
Container2D::row_range_iterator slip::iterator2d_box< T >::row_begin ( size_type  row,
const slip::Range< int > &  range 
)
inline

iterator2d_box element assignment operator.

Parameters
rowoffset.
rangeRange of the row to iterate.
Returns
a row_range_iterator to the first element of the range of row of the box

Definition at line 632 of file iterator2d_box.hpp.

template<class T >
Container2D::row_iterator slip::iterator2d_box< T >::row_end ( size_type  row)
inline

iterator2d_box element assignment operator.

Parameters
rowoffset.
Returns
a row_iterator to the past-the-end element of the row row of the box

Definition at line 541 of file iterator2d_box.hpp.

template<class T >
Container2D::row_range_iterator slip::iterator2d_box< T >::row_end ( size_type  row,
const slip::Range< int > &  range 
)
inline

iterator2d_box element assignment operator.

Parameters
rowoffset.
rangeRange of the row to iterate.
Returns
a row_iterator to the past-the-end element of the range of row of the box

Definition at line 646 of file iterator2d_box.hpp.

template<class T >
Container2D::reverse_row_iterator slip::iterator2d_box< T >::row_rbegin ( size_type  row)
inline

iterator2d_box element assignment operator.

Parameters
rowoffset.
Returns
a reverse_row_iterator to the last element of the row row of the box

Definition at line 554 of file iterator2d_box.hpp.

template<class T >
Container2D::reverse_row_iterator slip::iterator2d_box< T >::row_rend ( size_type  row)
inline

iterator2d_box element assignment operator.

Parameters
rowoffset.
Returns
a reverse_row_iterator to one previois the first element of the row row of the box

Definition at line 566 of file iterator2d_box.hpp.

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

Access to the first index of the current iterator2d_box.

Returns
the first index.

Definition at line 691 of file iterator2d_box.hpp.

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

Access to the second index of the current iterator2d_box.

Returns
the second index.

Definition at line 709 of file iterator2d_box.hpp.

Friends And Related Function Documentation

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

Inequality operator.

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

Definition at line 342 of file iterator2d_box.hpp.

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

iterator2d_box difference operator.

Parameters
i1first iterator2d_box.
i2second iterator2d_box.
Returns
a difference_type d such that i1 = i2 + d.
Precondition
Either i1 is reachable from i2, or i2 is reachable from i1.

Definition at line 496 of file iterator2d_box.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 362 of file iterator2d_box.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 390 of file iterator2d_box.hpp.

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

Equality operator.

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

Definition at line 327 of file iterator2d_box.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 376 of file iterator2d_box.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 404 of file iterator2d_box.hpp.


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