1 #ifndef _theplu_yat_utility_data_weight_proxy_ 2 #define _theplu_yat_utility_data_weight_proxy_ 26 #include "DataWeight.h" 28 #include <boost/concept/assert.hpp> 29 #include <boost/iterator/iterator_concepts.hpp> 30 #include <boost/iterator/iterator_traits.hpp> 53 template<
typename DataIterator,
typename WeightIterator>
66 BOOST_CONCEPT_ASSERT((boost_concepts::ReadableIterator<DataIterator>));
67 BOOST_CONCEPT_ASSERT((boost_concepts::ReadableIterator<WeightIterator>));
69 using boost::Convertible;
71 BOOST_CONCEPT_ASSERT((Convertible<data_type, double>));
74 BOOST_CONCEPT_ASSERT((Convertible<weight_type, double>));
87 typename boost::iterator_reference<DataIterator>::type
data(
void)
95 const double&
data(
void)
const {
return *data_ ; }
107 typename boost::iterator_reference<WeightIterator>::type
weight(
void)
115 const double&
weight(
void)
const {
return *weight_; }
152 typedef typename boost::iterator_value<DataIterator>::type data_type;
153 typedef typename boost::iterator_reference<DataIterator>::type data_reference;
155 typedef typename boost::iterator_value<WeightIterator>::type weight_type;
157 typename boost::iterator_reference<WeightIterator>::type weight_reference;
boost::iterator_reference< DataIterator >::type data(void)
Definition: DataWeightProxy.h:87
The Department of Theoretical Physics namespace as we define it.
Holds a pair of data and associated weight.
Definition: DataWeight.h:39
Proxy class for DataWeight.
Definition: DataWeightProxy.h:54
DataIterator.
Definition: DataIterator.h:63
DataWeightProxy & operator=(const DataWeight &rhs)
assignment operator
Definition: DataWeightProxy.h:135
const double & weight(void) const
Definition: DataWeightProxy.h:115
const double & data(void) const
Definition: DataWeightProxy.h:95
DataWeightProxy & operator=(const DataWeightProxy &rhs)
assignment operator
Definition: DataWeightProxy.h:125
WeightIterator.
Definition: WeightIterator.h:64
boost::iterator_reference< WeightIterator >::type weight(void)
Definition: DataWeightProxy.h:107
DataWeightProxy(DataIterator data, WeightIterator weight)
Constructor.
Definition: DataWeightProxy.h:63