theplu::yat::utility::iterator_traits< Iter > Struct Template Reference

#include <yat/utility/iterator_traits.h>

List of all members.

Public Types

typedef traits::data_reference data_reference
typedef traits::weight_reference weight_reference

Public Member Functions

data_reference data (Iter iter) const
weight_reference weight (Iter iter) const


Detailed Description

template<typename Iter>
struct theplu::yat::utility::iterator_traits< Iter >

The purpose of this class is to allow polymorphism between weighted and unweighted iterators. It allows to access data and weight for both weighted and unweighted iterators.

This class works for unweighted iterators as well as weighted iterators as long as they have reference type DataWeight& or const DataWeight&.

For others, such as WeightedIterator for which reference type is a proxy class, this class should be specialized. For adaptors that have an underlying iterator (e.g. StrideIterator), this class should be specialized, so the class also works when the underlying is an iterator that is not covered by this class e.g. WeightedIterator.


Member Typedef Documentation

data_reference (type returned by data(void) is determined by iterator_traits_detail

data_reference (type returned by data(void) is determined by iterator_traits_detail


Member Function Documentation

template<typename Iter>
data_reference theplu::yat::utility::iterator_traits< Iter >::data ( Iter  iter  )  const [inline]

Returns:
data

template<typename Iter>
weight_reference theplu::yat::utility::iterator_traits< Iter >::weight ( Iter  iter  )  const [inline]

Returns:
weight


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

Generated on Tue Jan 18 02:20:11 2011 for yat by  doxygen 1.5.5