[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]
IteratorTraits< T > Struct Template Reference |
Export associated information for each image iterator. More...
#include <vigra/iteratortraits.hxx>
Export associated information for each image iterator.
The IteratorTraits class contains the following fields:
By (partially) specializing this template for an iterator class the defaults given above can be changed as appropriate. For example, iterators for rgb images are associated with RGBAccessor<value_type>
instead of StandardAccessor<value_type>
. To get the accessor associated with a given iterator, use code like this:
This technique is, for example, used by the Iterator Based Argument Object Factories. The possibility to retrieve the default accessor by means of a traits class is especially important since this information is not contained in the iterator directly.
The member hasConstantStrides
is useful for certain optimizations: it helps to decide whether we can replace iterator operations such as iter++
or iter += n
with corresponding pointer operations (which may be faster), where the pointer is obtained as the address of iterator's pointee (the object the iterator currently refers to). This flag would be VigraFalseType
for a std::list<int>::iterator
, but is VigraTrueType
for most VIGRA iterators.
#include <vigra/iteratortraits.hxx> Namespace: vigra
© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) |
html generated using doxygen and Python
|