yat
0.14.5pre
|
#include <yat/utility/WeightedIterator.h>
Public Types | |
typedef DataIterator | data_iterator |
DataIterator. | |
typedef WeightIterator | weight_iterator |
DataIterator. | |
Public Member Functions | |
WeightedIterator (void) | |
Default Constructor. More... | |
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. More... | |
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 More... | |
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
. As a proxy is used, which is not allowed in a Forward Iterator, WeightedIterator is a Input Iterator.
Although WeightedIterator is tagged a Input Iterator, more advanced traversal is implemented if supported by underlying iterators. If underlying iterators support random access traversal, e.g., WeightedIterator supports it as well and boost::iterator_traversal<T>::type is set appropriately (see Random Access Traversal Iterator).
Type Requirements:
DataWeightProxy<DataIterator, WeightIterator>
is a valid expression.
|
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.