yat  0.21pre
Public Member Functions | Friends | List of all members
theplu::yat::utility::WeightedIteratorArchetype< AccessCategory, TraversalCategory > Class Template Reference

#include <yat/utility/WeightedIteratorArchetype.h>

Inheritance diagram for theplu::yat::utility::WeightedIteratorArchetype< AccessCategory, TraversalCategory >:

Public Member Functions

 WeightedIteratorArchetype (void)
 Default Constructor. More...
 
 WeightedIteratorArchetype (WeightedIteratorArchetype_ctor_arg arg)
 Constructor. More...
 
 WeightedIteratorArchetype (const WeightedIteratorArchetype< boost::iterator_archetypes::readable_writable_iterator_t, TraversalCategory > &other)
 

Friends

class boost::iterator_core_access
 

Detailed Description

template<typename AccessCategory, typename TraversalCategory>
class theplu::yat::utility::WeightedIteratorArchetype< AccessCategory, TraversalCategory >

The purpose of this class is to complement boost::iterator_archetype, which doesn't work well when the value_type is DataWeight (weighted iterator) and reference is not DataWeight&. In that case boost::iterator_archetype creates a proxy class that doesn't work well with yat's machinery to detect whether an iterator is weighted or not. This class returns DataWeightProxy from operator* and works as intended.

Template arguments:

AccessCategory: either boost::iterator_archetypes::readable_iterator_t (for const iterator) or boost::iterator_archetypes::readable_writable_iterator_t (for mutable iterator)

Only writable iterators are not allowed because a weighted iterator must be readable in order to ensure that value_type is defined.

TraversalCategory is one of the boost categories: boost::single_pass_traversal_tag boost::forward_traversal_tag boost::bidirectional_traversal_tag boost::random_access_traversal_tag

Since
New in yat 0.14

Constructor & Destructor Documentation

◆ WeightedIteratorArchetype() [1/3]

template<typename AccessCategory, typename TraversalCategory>
theplu::yat::utility::WeightedIteratorArchetype< AccessCategory, TraversalCategory >::WeightedIteratorArchetype ( void  )
inline

Default Constructor.

Only implemented for single pass iterators (not for e.g. output iterator).

◆ WeightedIteratorArchetype() [2/3]

template<typename AccessCategory, typename TraversalCategory>
theplu::yat::utility::WeightedIteratorArchetype< AccessCategory, TraversalCategory >::WeightedIteratorArchetype ( WeightedIteratorArchetype_ctor_arg  arg)
inlineexplicit

Constructor.

If iterator is not default constructible (e.g. output iterator), this is only way to create an iterator.

◆ WeightedIteratorArchetype() [3/3]

template<typename AccessCategory, typename TraversalCategory>
theplu::yat::utility::WeightedIteratorArchetype< AccessCategory, TraversalCategory >::WeightedIteratorArchetype ( const WeightedIteratorArchetype< boost::iterator_archetypes::readable_writable_iterator_t, TraversalCategory > &  other)
inline

Create an iterator from a mutable iterator, i.e., this is a copy constructor if mutable, otherwise conversion from mutable to const iterator.


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

Generated on Wed Jan 25 2023 03:34:30 for yat by  doxygen 1.8.14