4 #ifndef DUNE_GENERICITERATOR_HH
5 #define DUNE_GENERICITERATOR_HH
148 template<
class C,
class T,
class R=T&,
class D = std::ptrdiff_t,
151 public IteratorFacade<GenericIterator<C,T,R,D,IteratorFacade>,T,R,D>
154 friend class
GenericIterator<const typename remove_const<C>::type, const typename remove_const<T>::type, typename const_reference<R>::type, D, IteratorFacade>;
156 typedef
GenericIterator<typename remove_const<C>::type, typename remove_const<T>::type, typename mutable_reference<R>::type, D, IteratorFacade>
MutableIterator;
157 typedef
GenericIterator<const typename remove_const<C>::type, const typename remove_const<T>::type, typename const_reference<R>::type, D, IteratorFacade>
ConstIterator;
200 : container_(&cont), position_(pos)
228 return position_ == other.position_ && container_ == other.container_;
233 return position_ == other.position_ && container_ == other.container_;
237 return container_->operator[](position_);
251 return container_->operator[](position_+i);
255 position_=position_+n;
260 assert(other.container_==container_);
261 return other.position_ - position_;
266 assert(other.container_==container_);
267 return other.position_ - position_;
void decrement()
Definition: genericiterator.hh:245
T Value
The value type of the iterator.
Definition: genericiterator.hh:176
R & type
Definition: genericiterator.hh:128
DifferenceType distanceTo(const MutableIterator &other) const
Definition: genericiterator.hh:258
const R type
Definition: genericiterator.hh:93
R type
Definition: genericiterator.hh:122
Base class for stl conformant forward iterators.
Definition: iteratorfacades.hh:425
D DifferenceType
The type of the difference between two positions.
Definition: genericiterator.hh:181
void increment()
Definition: genericiterator.hh:240
R & type
Definition: genericiterator.hh:134
void advance(DifferenceType n)
Definition: genericiterator.hh:254
This file implements iterator facade classes for writing stl conformant iterators.
R Reference
The type of the reference to the values accessed.
Definition: genericiterator.hh:186
bool equals(const MutableIterator &other) const
Definition: genericiterator.hh:226
GenericIterator(const MutableIterator &other)
Copy constructor.
Definition: genericiterator.hh:210
GenericIterator(const ConstIterator &other)
Copy constructor.
Definition: genericiterator.hh:222
std::size_t position_
The current position in the buffer.
Definition: variablesizecommunicator.hh:136
DifferenceType distanceTo(const ConstIterator &other) const
Definition: genericiterator.hh:264
C Container
The type of container we are an iterator for.
Definition: genericiterator.hh:169
const R type
Definition: genericiterator.hh:87
const R & type
Definition: genericiterator.hh:105
Generic class for stl-conforming iterators for container classes with operator[]. ...
Definition: genericiterator.hh:150
const R & type
Definition: genericiterator.hh:99
Get the 'const' version of a reference to a mutable object.
Definition: genericiterator.hh:85
bool equals(const ConstIterator &other) const
Definition: genericiterator.hh:231
Reference elementAt(DifferenceType i) const
Definition: genericiterator.hh:250
get the 'mutable' version of a reference to a const object
Definition: genericiterator.hh:114
R type
Definition: genericiterator.hh:116
Reference dereference() const
Definition: genericiterator.hh:236
Removes a const qualifier while preserving others.
Definition: typetraits.hh:175
GenericIterator(Container &cont, DifferenceType pos)
Constructor.
Definition: genericiterator.hh:199