yat
0.11.3pre
|
#include <yat/utility/WeightedIterator.h>
Public Types | |
typedef DataIterator | data_iterator |
DataIterator. | |
typedef WeightIterator | weight_iterator |
DataIterator. | |
Public Member Functions | |
WeightedIterator (void) | |
Default Constructor. | |
WeightedIterator (DataIterator d, WeightIterator w) | |
Constructor. | |
const DataIterator & | data_base (void) const |
const WeightIterator & | weight_base (void) const |
DataWeightProxy< DataIterator, WeightIterator > | operator[] (int n) const |
element operator | |
template<typename D2 , typename W2 > | |
WeightedIterator (WeightedIterator< D2, W2 > other, typename boost::enable_if_convertible< D2, DataIterator >::type *=0, typename boost::enable_if_convertible< W2, WeightIterator >::type *=0) | |
Conversion constructor. | |
Friends | |
class | boost::iterator_core_access |
Related Functions | |
(Note that these are not member functions.) | |
template<typename DataIterator , typename WeightIterator > | |
WeightedIterator< DataIterator, WeightIterator > | weighted_iterator (DataIterator data, WeightIterator weight) |
convenient function to create WeightedIterator | |
Adaptor enabling to make two unweighted iterators to behave like a Weighted Iterator. The data part corresponds to the data_iterator and the weight corresponds to the weight_iterator.
WeightedIterator
is a weighted iterator and its value_type
is DataWeight
. However due to the nature of this adaptor there are no physical DataWeight
in memory that WeightedIterator
points to, so its reference_type
is not DataWeight&
but a DataWeightProxy
. Therefore DataWeightProxy<DataIterator
, WeightIterator> must be a valid expression.
WeightedIterator inherits most its features from data_iterator
and weight_iterator
. WeightedIterator
is mutable, for example, if both underlying iterators are mutable and likewise it is a random access iterator if both underlying iterators are random access iterators.
|
inline |
Default Constructor.
Created iterator is not dereferencable
|
inline |
Conversion constructor.
Create a WeightIterator<Base> from a WeightIterator<B2>. Possible if B2 is convertible to a Base. Constructor allows implicit conversions such as iterator to const_iterator.
|
inline |
|
inline |
|
related |
convenient function to create WeightedIterator
Convenient function in same fashion as std::make_pair.