![]() |
Dune-Fufem 2.11-git
|
An indexed iterator over a slice. More...
#include <dune/fufem/indexedsliceiterator.hh>

Public Types | |
| typedef std::size_t | size_type |
| typedef std::forward_iterator_tag | iterator_category |
| typedef typename std::remove_const< V >::type | value_type |
| typedef D | difference_type |
| typedef V * | pointer |
| typedef R | reference |
| typedef T | DerivedType |
| typedef V | Value |
| typedef V * | Pointer |
| typedef D | DifferenceType |
| typedef R | Reference |
Public Member Functions | |
| IndexedSliceIterator () | |
| IndexedSliceIterator (const BaseIterator &it, size_type index, size_type itStride=1, size_type indexStride=1) | |
| Construct from value and index. | |
| Base::Reference | dereference () const |
| bool | equals (const IndexedSliceIterator &other) const |
| void | increment () |
| size_type | index () const |
| Get index of iterator. | |
| constexpr Reference | operator* () const |
| constexpr Pointer | operator-> () const |
| constexpr DerivedType & | operator++ () |
| constexpr DerivedType | operator++ (int) |
Protected Attributes | |
| BaseIterator | it_ |
| size_type | itStride_ |
| size_type | index_ |
| size_type | indexStride_ |
Detailed Description
class IndexedSliceIterator< BaseIterator, Value >
An indexed iterator over a slice.
This class provides an iterator over a slice given by a base iterator and an index() method. Both, the base iterator and the index are incremented by a configurable stride value on incrementing the iterator.
This is not a random access iterator. And indices are in general not consecutive. Instead this can be considered as an iterator over a sparse data set.
- Template Parameters
-
BaseIterator Type of base iterator. Has to provide operator* and prefix operator++. May be a raw pointer. Value Type of values the iterator iterates over.
Member Typedef Documentation
◆ size_type
| typedef std::size_t IndexedSliceIterator< BaseIterator, Value >::size_type |
Constructor & Destructor Documentation
◆ IndexedSliceIterator() [1/2]
|
inline |
◆ IndexedSliceIterator() [2/2]
|
inline |
Construct from value and index.
An end iterator is created by specifying an appropriate base iterator or index. If itStride is zero to iterators are considered equal if the indices coincide. Otherwise they are considered equal if the base iterators coincide.
- Parameters
-
it Underlying base iterator index Initial index itStride On incrementing the iterator the base iterator is incremented itStride times. indexStride On incrementing the iterator the index is incremented indexStride times.
Member Function Documentation
◆ dereference()
|
inline |
◆ equals()
|
inline |
◆ increment()
|
inline |
◆ index()
|
inline |
Get index of iterator.
While the indices are strictly increasing but not necessarily consecutive.
Member Data Documentation
◆ index_
|
protected |
◆ indexStride_
|
protected |
◆ it_
|
protected |
◆ itStride_
|
protected |
The documentation for this class was generated from the following file:
