#include <genericiterator.hh>
If template parameter C has a const qualifier we are a const iterator, otherwise we are a mutable iterator.
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 (Container &cont, DifferenceType pos) | |
Constructor. | |
GenericIterator (const MutableIterator &other) | |
Copy constructor. | |
GenericIterator (const ConstIterator &other) | |
Copy constructor. |
typedef C Dune::GenericIterator< C, T, R, D, IteratorFacade >::Container |
The type of container we are an iterator for.
The container type must provide a operator[] method.
If C has a const qualifier we are a const iterator, otherwise we are a mutable iterator.
typedef T Dune::GenericIterator< C, T, R, D, IteratorFacade >::Value |
The value type of the iterator.
This is the return type of the iterator returned when derefencing.
Dune::GenericIterator< C, T, R, D, IteratorFacade >::GenericIterator | ( | Container & | cont, | |
DifferenceType | pos | |||
) | [inline] |
Constructor.
cont | Reference to the container we are an iterator for. | |
pos | The postion the Iterator will be positioned to. (e. g. 0 for an iterator return by Container::begin() or the sizeof the container for an iterator returned by Container::end() |
Dune::GenericIterator< C, T, R, D, IteratorFacade >::GenericIterator | ( | const MutableIterator & | other | ) | [inline] |
Copy constructor.
This is somehow hard to understand, therefore play with the cases: 1. if we are mutable this is the only valid copy constructor, as the arguments is a mutable iterator 2. if we are a const iterator the argument is a mutable iterator => This is the needed conversion to initialize a const iterator form a mutable one.
Dune::GenericIterator< C, T, R, D, IteratorFacade >::GenericIterator | ( | const ConstIterator & | other | ) | [inline] |
Copy constructor.