dune-common  2.5.0
Public Types | Public Member Functions | List of all members
Dune::RandomAccessIteratorFacade< T, V, R, D > Class Template Reference

Base class for stl conformant forward iterators. More...

#include <dune/common/iteratorfacades.hh>

Inheritance diagram for Dune::RandomAccessIteratorFacade< T, V, R, D >:
Inheritance graph

Public Types

typedef T DerivedType
 The type of derived iterator. More...
 
typedef V Value
 The type of value accessed through the iterator. More...
 
typedef V * Pointer
 The pointer to the Value. More...
 
typedef D DifferenceType
 The type of the difference between two positions. More...
 
typedef R Reference
 The type of the reference to the values accessed. More...
 

Public Member Functions

Reference operator* () const
 Dereferencing operator. More...
 
Pointer operator-> () const
 
Reference operator[] (DifferenceType n) const
 Get the element n positions from the current one. More...
 
DerivedTypeoperator++ ()
 Preincrement operator. More...
 
DerivedType operator++ (int)
 Postincrement operator. More...
 
DerivedTypeoperator+= (DifferenceType n)
 
DerivedType operator+ (DifferenceType n) const
 
DerivedTypeoperator-- ()
 Predecrement operator. More...
 
DerivedType operator-- (int)
 Postdecrement operator. More...
 
DerivedTypeoperator-= (DifferenceType n)
 
DerivedType operator- (DifferenceType n) const
 

Detailed Description

template<class T, class V, class R = V&, class D = std::ptrdiff_t>
class Dune::RandomAccessIteratorFacade< T, V, R, D >

Base class for stl conformant forward iterators.

Member Typedef Documentation

§ DerivedType

template<class T, class V, class R = V&, class D = std::ptrdiff_t>
typedef T Dune::RandomAccessIteratorFacade< T, V, R, D >::DerivedType

The type of derived iterator.

The iterator has to define following functions have to be present:

// Access the value referred to.
Reference dereference() const;
// Access the value at some other location
// Compare for equality with j
bool equals(j);
// position the iterator at the next element.
void increment()
// position the iterator at the previous element.
void decrement()
// advance the iterator by a number of positions-
void advance(DifferenceType n);
// calculate the distance to another iterator.
// One should incorporate an assertion whether
// the same containers are referenced
DifferenceType distanceTo(j) const;

For an elaborate explanation see the STL Documentation

§ DifferenceType

template<class T, class V, class R = V&, class D = std::ptrdiff_t>
typedef D Dune::RandomAccessIteratorFacade< T, V, R, D >::DifferenceType

The type of the difference between two positions.

§ Pointer

template<class T, class V, class R = V&, class D = std::ptrdiff_t>
typedef V* Dune::RandomAccessIteratorFacade< T, V, R, D >::Pointer

The pointer to the Value.

§ Reference

template<class T, class V, class R = V&, class D = std::ptrdiff_t>
typedef R Dune::RandomAccessIteratorFacade< T, V, R, D >::Reference

The type of the reference to the values accessed.

§ Value

template<class T, class V, class R = V&, class D = std::ptrdiff_t>
typedef V Dune::RandomAccessIteratorFacade< T, V, R, D >::Value

The type of value accessed through the iterator.

Member Function Documentation

§ operator*()

template<class T, class V, class R = V&, class D = std::ptrdiff_t>
Reference Dune::RandomAccessIteratorFacade< T, V, R, D >::operator* ( ) const
inline

Dereferencing operator.

§ operator+()

template<class T, class V, class R = V&, class D = std::ptrdiff_t>
DerivedType Dune::RandomAccessIteratorFacade< T, V, R, D >::operator+ ( DifferenceType  n) const
inline

§ operator++() [1/2]

template<class T, class V, class R = V&, class D = std::ptrdiff_t>
DerivedType& Dune::RandomAccessIteratorFacade< T, V, R, D >::operator++ ( )
inline

Preincrement operator.

§ operator++() [2/2]

template<class T, class V, class R = V&, class D = std::ptrdiff_t>
DerivedType Dune::RandomAccessIteratorFacade< T, V, R, D >::operator++ ( int  )
inline

Postincrement operator.

§ operator+=()

template<class T, class V, class R = V&, class D = std::ptrdiff_t>
DerivedType& Dune::RandomAccessIteratorFacade< T, V, R, D >::operator+= ( DifferenceType  n)
inline

§ operator-()

template<class T, class V, class R = V&, class D = std::ptrdiff_t>
DerivedType Dune::RandomAccessIteratorFacade< T, V, R, D >::operator- ( DifferenceType  n) const
inline

§ operator--() [1/2]

template<class T, class V, class R = V&, class D = std::ptrdiff_t>
DerivedType& Dune::RandomAccessIteratorFacade< T, V, R, D >::operator-- ( )
inline

Predecrement operator.

§ operator--() [2/2]

template<class T, class V, class R = V&, class D = std::ptrdiff_t>
DerivedType Dune::RandomAccessIteratorFacade< T, V, R, D >::operator-- ( int  )
inline

Postdecrement operator.

§ operator-=()

template<class T, class V, class R = V&, class D = std::ptrdiff_t>
DerivedType& Dune::RandomAccessIteratorFacade< T, V, R, D >::operator-= ( DifferenceType  n)
inline

§ operator->()

template<class T, class V, class R = V&, class D = std::ptrdiff_t>
Pointer Dune::RandomAccessIteratorFacade< T, V, R, D >::operator-> ( ) const
inline

§ operator[]()

template<class T, class V, class R = V&, class D = std::ptrdiff_t>
Reference Dune::RandomAccessIteratorFacade< T, V, R, D >::operator[] ( DifferenceType  n) const
inline

Get the element n positions from the current one.

Parameters
nThe distance to the element.
Returns
The element at that distance.

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