yat  0.13.2pre
Public Member Functions | List of all members
theplu::yat::utility::DataWeightProxy< DataIterator, WeightIterator > Class Template Reference

Proxy class for DataWeight. More...

#include <yat/utility/DataWeightProxy.h>

Public Member Functions

 DataWeightProxy (DataIterator data, WeightIterator weight)
 Constructor. More...
 
std::iterator_traits
< DataIterator >::reference 
data (void)
 
const double & data (void) const
 
std::iterator_traits
< WeightIterator >::reference 
weight (void)
 
const double & weight (void) const
 
DataWeightProxyoperator= (const DataWeightProxy &rhs)
 assignment operator More...
 
DataWeightProxyoperator= (const DataWeight &rhs)
 assignment operator
 
 operator DataWeight () const
 Conversion to DataWeight.
 

Detailed Description

template<typename DataIterator, typename WeightIterator>
class theplu::yat::utility::DataWeightProxy< DataIterator, WeightIterator >

Proxy class for DataWeight.

Class is used in WeightedIterator

Type Requirements:

Constructor & Destructor Documentation

template<typename DataIterator, typename WeightIterator>
theplu::yat::utility::DataWeightProxy< DataIterator, WeightIterator >::DataWeightProxy ( DataIterator  data,
WeightIterator  weight 
)
inline

Constructor.

Parameters
dataiterator pointing to data to hold
weightiterator pointing to weight to hold

Member Function Documentation

template<typename DataIterator, typename WeightIterator>
std::iterator_traits<DataIterator>::reference theplu::yat::utility::DataWeightProxy< DataIterator, WeightIterator >::data ( void  )
inline
Returns
reference to data

This function requires that reference type of data_iterator is convertible to double. This function is typically used as left-hand side in an assignment and thus expected to being able to change the underlying data such as a double& can change the underlying double. But it is not required that return type is a double& as a Proxy class can do the job too.

template<typename DataIterator, typename WeightIterator>
const double& theplu::yat::utility::DataWeightProxy< DataIterator, WeightIterator >::data ( void  ) const
inline
Returns
const reference to data
template<typename DataIterator, typename WeightIterator>
DataWeightProxy& theplu::yat::utility::DataWeightProxy< DataIterator, WeightIterator >::operator= ( const DataWeightProxy< DataIterator, WeightIterator > &  rhs)
inline

assignment operator

This function uses non-const function data(void) and weight(void) and consequently requires that reference type of both data_iterator and weight_iterator are convertible to double.

template<typename DataIterator, typename WeightIterator>
std::iterator_traits<WeightIterator>::reference theplu::yat::utility::DataWeightProxy< DataIterator, WeightIterator >::weight ( void  )
inline
Returns
reference to weight

This function requires that reference type of weight_iterator is convertible to double. This function is typically used as left-hand side in an assignment and thus expected to being able to change the underlying data such as a double& can change the underlying double. But it is not required that return type is a double& as a Proxy class can do the job too.

template<typename DataIterator, typename WeightIterator>
const double& theplu::yat::utility::DataWeightProxy< DataIterator, WeightIterator >::weight ( void  ) const
inline
Returns
const reference to weight

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

Generated on Wed Jan 4 2017 02:23:08 for yat by  doxygen 1.8.5