dune-istl  2.2.1
Public Member Functions | Friends | List of all members
Dune::ContainerWrapperIterator< C, T, R > Class Template Reference

Iterator class for sparse vector-like containers. More...

#include <dune/istl/diagonalmatrix.hh>

Inheritance diagram for Dune::ContainerWrapperIterator< C, T, R >:

Public Member Functions

 ContainerWrapperIterator ()
 
 ContainerWrapperIterator (CW containerWrapper, int position)
 
template<class OtherContainerWrapperIteratorType >
 ContainerWrapperIterator (OtherContainerWrapperIteratorType &other)
 
 ContainerWrapperIterator (const MyType &other)
 
 ContainerWrapperIterator (const MyConstType &other)
 
template<class OtherContainerWrapperIteratorType >
ContainerWrapperIteratoroperator= (OtherContainerWrapperIteratorType &other)
 
T * operator-> () const
 
bool equals (const MyType &other) const
 
bool equals (const MyConstType &other) const
 
dereference () const
 
void increment ()
 
void decrement ()
 
elementAt (int i) const
 
void advance (int n)
 
template<class OtherContainerWrapperIteratorType >
std::ptrdiff_t distanceTo (OtherContainerWrapperIteratorType &other) const
 
std::ptrdiff_t index () const
 

Friends

class ContainerWrapperIterator< CW, typename mutable_reference< T >::type, typename mutable_reference< R >::type >
 
class ContainerWrapperIterator< CW, typename const_reference< T >::type, typename const_reference< R >::type >
 

Detailed Description

template<class C, class T, class R>
class Dune::ContainerWrapperIterator< C, T, R >

Iterator class for sparse vector-like containers.

This class provides an iterator for sparse vector like containers. It contains a ContainerWrapper that must provide the translation from the position in the underlying container to the index in the sparse container.

The ContainerWrapper must be default and copy-constructable. Furthermore it must provide the methods:

bool identical(other) - check if this is identical to other (same container, not only equal) T* pointer(position) - get pointer to data at position in underlying container size_t realIndex(position) - get index in sparse container for position in underlying container

Notice that the iterator stores a ContainerWrapper. This allows to use proxy classes as underlying container and as returned reference type.

Template Parameters
CWThe container wrapper class
TThe contained type
RThe reference type returned by dereference

Constructor & Destructor Documentation

template<class C , class T , class R >
Dune::ContainerWrapperIterator< C, T, R >::ContainerWrapperIterator ( )
inline
template<class C , class T , class R >
Dune::ContainerWrapperIterator< C, T, R >::ContainerWrapperIterator ( CW  containerWrapper,
int  position 
)
inline
template<class C , class T , class R >
template<class OtherContainerWrapperIteratorType >
Dune::ContainerWrapperIterator< C, T, R >::ContainerWrapperIterator ( OtherContainerWrapperIteratorType &  other)
inline
template<class C , class T , class R >
Dune::ContainerWrapperIterator< C, T, R >::ContainerWrapperIterator ( const MyType other)
inline
template<class C , class T , class R >
Dune::ContainerWrapperIterator< C, T, R >::ContainerWrapperIterator ( const MyConstType other)
inline

Member Function Documentation

template<class C , class T , class R >
void Dune::ContainerWrapperIterator< C, T, R >::advance ( int  n)
inline
template<class C , class T , class R >
void Dune::ContainerWrapperIterator< C, T, R >::decrement ( )
inline
template<class C , class T , class R >
R Dune::ContainerWrapperIterator< C, T, R >::dereference ( ) const
inline
template<class C , class T , class R >
template<class OtherContainerWrapperIteratorType >
std::ptrdiff_t Dune::ContainerWrapperIterator< C, T, R >::distanceTo ( OtherContainerWrapperIteratorType &  other) const
inline
template<class C , class T , class R >
R Dune::ContainerWrapperIterator< C, T, R >::elementAt ( int  i) const
inline
template<class C , class T , class R >
bool Dune::ContainerWrapperIterator< C, T, R >::equals ( const MyType other) const
inline
template<class C , class T , class R >
bool Dune::ContainerWrapperIterator< C, T, R >::equals ( const MyConstType other) const
inline
template<class C , class T , class R >
void Dune::ContainerWrapperIterator< C, T, R >::increment ( )
inline
template<class C , class T , class R >
std::ptrdiff_t Dune::ContainerWrapperIterator< C, T, R >::index ( ) const
inline
template<class C , class T , class R >
T* Dune::ContainerWrapperIterator< C, T, R >::operator-> ( ) const
inline
template<class C , class T , class R >
template<class OtherContainerWrapperIteratorType >
ContainerWrapperIterator& Dune::ContainerWrapperIterator< C, T, R >::operator= ( OtherContainerWrapperIteratorType &  other)
inline

Friends And Related Function Documentation

template<class C , class T , class R >
friend class ContainerWrapperIterator< CW, typename const_reference< T >::type, typename const_reference< R >::type >
friend
template<class C , class T , class R >
friend class ContainerWrapperIterator< CW, typename mutable_reference< T >::type, typename mutable_reference< R >::type >
friend

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