yat  0.14.5pre
Classes | Public Member Functions | Friends | Related Functions | List of all members
theplu::yat::utility::MergeIterator< Base, Compare > Class Template Reference

Iterate over several ranges as if ranges have been merged. More...

#include <yat/utility/MergeIterator.h>

Inheritance diagram for theplu::yat::utility::MergeIterator< Base, Compare >:

Public Member Functions

 MergeIterator (void)
 
 MergeIterator (const std::vector< std::pair< Base, Base > > &vec)
 Create MergeIterator. More...
 
 MergeIterator (const std::vector< std::pair< Base, Base > > &vec, const Compare &comp)
 Creates MergeIterator using comp as compare object. More...
 

Friends

class boost::iterator_core_access
 

Related Functions

(Note that these are not member functions.)

template<typename Base >
MergeIterator< Base > make_merge_iterator (const std::vector< std::pair< Base, Base > > &vec)
 
template<typename Base , class Compare >
MergeIterator< Base, Compare > make_merge_iterator (const std::vector< std::pair< Base, Base > > &vec, const Compare &comp)
 

Detailed Description

template<typename Base, class Compare = std::less<typename std::iterator_traits<Base>::value_type>>
class theplu::yat::utility::MergeIterator< Base, Compare >

Iterate over several ranges as if ranges have been merged.

MergeIterator is an Input Iterator that is created from several ranges and will iterate over the elements in the ranges as if ranges have been merged. Input ranges have to be sorted (as defined by the Compare object) or behaviour is undefined. When incremented, the iterator looks at next element in each range, identifies the smallest element, and points at that.

Type Requirements:

Since
New in yat 0.11

Constructor & Destructor Documentation

template<typename Base, class Compare = std::less<typename std::iterator_traits<Base>::value_type>>
theplu::yat::utility::MergeIterator< Base, Compare >::MergeIterator ( void  )
inline

Creates an end-of-range iterator

template<typename Base, class Compare = std::less<typename std::iterator_traits<Base>::value_type>>
theplu::yat::utility::MergeIterator< Base, Compare >::MergeIterator ( const std::vector< std::pair< Base, Base > > &  vec)
inline

Create MergeIterator.

Create a MergeIterator that will iterate over ranges [vec[0].first, vec[0].second), [vec[1].first, vec[1].second), ...

See Also
make_merge_iterator(const std::vector<std::pair<Base, Base> >&)
template<typename Base, class Compare = std::less<typename std::iterator_traits<Base>::value_type>>
theplu::yat::utility::MergeIterator< Base, Compare >::MergeIterator ( const std::vector< std::pair< Base, Base > > &  vec,
const Compare &  comp 
)
inline

Creates MergeIterator using comp as compare object.

Same as MergeIterator(2) but using comp rather than using a default constructed Compare object.

See Also
make_merge_iterator(const std::vector<std::pair<Base, Base> >&, const Compare&)

Friends And Related Function Documentation

template<typename Base >
MergeIterator< Base > make_merge_iterator ( const std::vector< std::pair< Base, Base > > &  vec)
related

Creates a MergeIterator that iterates over ranges defined in vec.

template<typename Base , class Compare >
MergeIterator< Base, Compare > make_merge_iterator ( const std::vector< std::pair< Base, Base > > &  vec,
const Compare &  comp 
)
related

Creates a MergeIterator that iterates over ranges defined in vec, using comp to compare elements.


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

Generated on Tue Sep 26 2017 02:33:31 for yat by  doxygen 1.8.5