[ VIGRA Homepage | Class Index | Function Index | File Index | Main Page ]
![]() |
IteratorTraits Struct Template Reference | ![]() |
---|
Export associated information for each image iterator. More...
#include "vigra/iteratortraits.hxx"
Detailed Description |
The IteratorTraits class contains the following fields:
template <class T> struct IteratorTraits { typedef T Iterator; typedef Iterator iterator; typedef typename iterator::iterator_category iterator_category; typedef typename iterator::value_type value_type; typedef typename iterator::reference reference; typedef typename iterator::index_reference index_reference; typedef typename iterator::pointer pointer; typedef typename iterator::difference_type difference_type; typedef typename iterator::row_iterator row_iterator; typedef typename iterator::column_iterator column_iterator; typedef StandardAccessor<value_type> DefaultAccessor; typedef StandardAccessor<value_type> default_accessor; };
By (partially) specializing this template for an iterator class the defaults given above can be changed as approiate. 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:
template <class Iterator> void foo(Iterator i) { typedef typename IteratorTraits<Iterator>::DefaultAccessor Accessor; Accessor a; ... }
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.
#include "vigra/iteratortraits.hxx" Namespace: vigra
© Ullrich Köthe (koethe@informatik.uni-hamburg.de) |
html generated using doxygen and Python
|