dune-common 2.9.1
|
Generic class for stl-conforming iterators for container classes with operator[]. More...
#include <dune/common/genericiterator.hh>
Public Types | |
typedef C | Container |
The type of container we are an iterator for. | |
typedef T | Value |
The value type of the iterator. | |
typedef D | DifferenceType |
The type of the difference between two positions. | |
typedef R | Reference |
The type of the reference to the values accessed. | |
Public Member Functions | |
GenericIterator () | |
GenericIterator (Container &cont, DifferenceType pos) | |
Constructor. | |
GenericIterator (const MutableIterator &other) | |
Copy constructor. | |
GenericIterator (const ConstIterator &other) | |
Copy constructor. | |
bool | equals (const MutableIterator &other) const |
bool | equals (const ConstIterator &other) const |
Reference | dereference () const |
void | increment () |
void | decrement () |
Reference | elementAt (DifferenceType i) const |
void | advance (DifferenceType n) |
DifferenceType | distanceTo (const MutableIterator &other) const |
DifferenceType | distanceTo (const ConstIterator &other) const |
Generic class for stl-conforming iterators for container classes with operator[].
If template parameter C has a const qualifier we are a const iterator, otherwise we are a mutable iterator.
typedef C Dune::GenericIterator< C, T, R, D, IteratorFacade >::Container |
The type of container we are an iterator for.
The container type must provide an operator[] method.
If C has a const qualifier we are a const iterator, otherwise we are a mutable iterator.
typedef D Dune::GenericIterator< C, T, R, D, IteratorFacade >::DifferenceType |
The type of the difference between two positions.
typedef R Dune::GenericIterator< C, T, R, D, IteratorFacade >::Reference |
The type of the reference to the values accessed.
typedef T Dune::GenericIterator< C, T, R, D, IteratorFacade >::Value |
The value type of the iterator.
This is the return type when dereferencing the iterator.
|
inline |
|
inline |
Constructor.
cont | Reference to the container we are an iterator for |
pos | The position the iterator will be positioned to (e.g. 0 for an iterator returned by Container::begin() or the size of the container for an iterator returned by Container::end() |
|
inline |
Copy constructor.
This is somehow hard to understand, therefore play with the cases:
|
inline |
Copy constructor.
This is somehow hard to understand, therefore play with the cases:
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |