VIGRA - Templatetype class Reference

[ VIGRA Homepage | Class Index | Function Index | File Index | Main Page ]

| type Class Template Reference |
--- | --- | ---

Base class for vigra::MultiIterator. More...

`#include "vigra/multi_iterator.hxx"`

Inheritance diagram for type:

## Public Types
typedef MultiIterator< N-1, T, REFERENCE, POINTER > | base_type
typedef T | value_type
typedef REFERENCE | reference
typedef POINTER | pointer
typedef ptrdiff_t | difference_type
typedef TinyVector< difference_type, N > | multi_difference_type
typedef MultiIterator< level, T, REFERENCE, POINTER > | next_type
typedef StridedMultiIterator< 1, T, REFERENCE, POINTER > | iterator
typedef multi_dimensional_traverser_tag | iterator_category
enum |
## Public Methods
| type ()
| type (pointer ptr, const difference_type *stride, const difference_type *shape)
void | operator++ ()
void | operator-- ()
type | operator++ (int)
type | operator-- (int)
type & | operator+= (difference_type n)
type & | operator+= (multi_difference_type const &d)
type & | operator-= (difference_type n)
type & | operator-= (multi_difference_type const &d)
difference_type | operator- (type const &d) const
reference | operator[] (difference_type n) const
reference | operator[] (multi_difference_type const &d) const
next_type | begin () const
next_type | end () const
iterator | iteratorForDimension (unsigned int d) const

## Detailed Description

### template<unsigned int N>
template<class T, class REFERENCE, class POINTER>
class vigra::MultiIteratorBase< N >::type< T, REFERENCE, POINTER >

Base class for vigra::MultiIterator.

This class implements the multi-iterator by means of the enclosed template class `type`. This design is necessary for compilers that do not support partial specialization (otherwise, MultiIterator could be specialized directly).

#include "vigra/multi_iterator.hxx"

Namespace: vigra

## Member Typedef Documentation

typedef MultiIterator<N-1, T, REFERENCE, POINTER> base_type

| the type of the parent in the inheritance hierarchy. Reimplemented from MultiIterator< N-1, T, REFERENCE, POINTER >.

typedef ptrdiff_t difference_type

| difference type (used for offsetting along one axis) Reimplemented from MultiIterator< N-1, T, REFERENCE, POINTER >.

typedef StridedMultiIterator<1, T, REFERENCE, POINTER> iterator

| the 1-dimensional iterator for this iterator hierarchy (result of iteratorForDimension()). Reimplemented from MultiIterator< N-1, T, REFERENCE, POINTER >.

typedef multi_dimensional_traverser_tag iterator_category

| the iterator tag (image traverser) Reimplemented from MultiIterator< N-1, T, REFERENCE, POINTER >.

typedef TinyVector<difference_type, N> multi_difference_type

| multi difference type (used for offsetting along all axes simultaneously) Reimplemented from MultiIterator< N-1, T, REFERENCE, POINTER >.

typedef MultiIterator<level, T, REFERENCE, POINTER> next_type

| the next type, this is a non-standard typedef denoting the type of the multi-iterator with the next-lower dimension. Reimplemented from MultiIterator< N-1, T, REFERENCE, POINTER >.

typedef POINTER pointer

| pointer type (result of operator->()) Reimplemented from MultiIterator< N-1, T, REFERENCE, POINTER >.

typedef REFERENCE reference

| reference type (result of operator[] and operator *()) Reimplemented from MultiIterator< N-1, T, REFERENCE, POINTER >.

typedef T value_type

| the iterator's value type Reimplemented from MultiIterator< N-1, T, REFERENCE, POINTER >.

## Member Enumeration Documentation

anonymous enum

| the iterator's level in the dimension hierarchy

## Constructor & Destructor Documentation

type | ( |  | ) | `[inline]`

| default constructor.

type | ( | pointer | ptr,
|  | const difference_type< T, REFERENCE, POINTER > * | stride,
|  | const difference_type< T, REFERENCE, POINTER > * | shape
| ) | `[inline]`

| construct from pointer, strides (offset of a sample to the next) for every dimension, and the shape.

## Member Function Documentation

next_type begin | ( |  | ) | const`[inline]`

| Return the (N-1)-dimensional multi-iterator that points to the first (N-1)-dimensional subarray of the N-dimensional array this iterator is referring to. The result is only valid if this iterator refers to location 0 in all dimensions below its current dimension N, otherwise it is undefined. Usage:
                    MultiIterator<2, int> outer = ...;  // this iterator

                    MultiIterator<2, int>::next_type inner = outer.begin();
                    for(; inner != outer.end(); ++inner)
                    {
                        // manipulate current 1D subimage
                    }

next_type end | ( |  | ) | const`[inline]`

| Return the (N-1)-dimensional multi-iterator that points beyond the last (N-1)-dimensional subarray of the N-dimensional array this iterator is referring to. The result is only valid if this iterator refers to location 0 in all dimensions below its current dimension N, otherwise it is undefined.

iterator iteratorForDimension | ( | unsigned int | d | ) | const`[inline]`

| Get a 1-dimensional, STL-compatible iterator for the given dimension, pointing to the current element of `this`. Usage:
                    MultiIterator<3, int> outer = ...;  // this iterator

                    MultiIterator<3, int>::iterator i = outer.iteratorForDimension(1);
                    MultiIterator<3, int>::iterator end = i + height;
                    for(; i != end; ++i)
                    {
                        // go down the current column starting at the location of 'outer'
                    }

type operator++ | ( | int |  | ) | `[inline]`

| postfix-increment the iterator in it's current dimension

void operator++ | ( |  | ) | `[inline]`

| prefix-increment the iterator in it's current dimension

type& operator+= | ( | multi_difference_type< T, REFERENCE, POINTER > const & | d | ) | `[inline]`

| increment the iterator in all dimensions by the given offset.

type& operator+= | ( | difference_type< T, REFERENCE, POINTER > | n | ) | `[inline]`

| increment the iterator in it's current dimension by the given value.

difference_type operator- | ( | type< T, REFERENCE, POINTER > const & | d | ) | const`[inline]`

| difference of two iterators in the current dimension. The result of this operation is undefined if the iterator doesn't point to element 0 in all dimensions below its current dimension.

type operator-- | ( | int |  | ) | `[inline]`

| postfix-decrement the iterator in it's current dimension

void operator-- | ( |  | ) | `[inline]`

| prefix-decrement the iterator in it's current dimension

type& operator-= | ( | multi_difference_type< T, REFERENCE, POINTER > const & | d | ) | `[inline]`

| decrement the iterator in all dimensions by the given offset.

type& operator-= | ( | difference_type< T, REFERENCE, POINTER > | n | ) | `[inline]`

| decrement the iterator in it's current dimension by the given value.

reference operator[] | ( | multi_difference_type< T, REFERENCE, POINTER > const & | d | ) | const`[inline]`

| access the array element at the given offset.

reference operator[] | ( | difference_type< T, REFERENCE, POINTER > | n | ) | const`[inline]`

| access the array element at the given offset in the current dimension.

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

- vigra/multi_iterator.hxx

© Ullrich Köthe (koethe@informatik.uni-hamburg.de) Cognitive Systems Group, University of Hamburg, Germany | html generated using doxygen and Python VIGRA 1.5.0 (7 Dec 2006)