shark::PairIterator< Value, Iterator1, Iterator2 > Class Template Reference

A Pair-Iterator which gives a unified view of two ranges. More...

#include <shark/Core/utility/ZipPair.h>

+ Inheritance diagram for shark::PairIterator< Value, Iterator1, Iterator2 >:

Public Member Functions

 PairIterator ()
 
template<class IteratorT1 , class IteratorT2 >
 PairIterator (IteratorT1 const &iterator1, IteratorT2 const &iterator2)
 Copy-Constructs this iterator from some other IndexedIterator convertible to this. More...
 
template<class V , class I1 , class I2 >
 PairIterator (PairIterator< V, I1, I2 > const &iterator)
 
Iterator1 first () const
 
Iterator2 second () const
 
std::pair< Iterator1, Iterator2 > iterators () const
 

Friends

template<class , class , class >
class PairIterator
 
class SHARK_ITERATOR_CORE_ACCESS
 

Detailed Description

template<class Value, class Iterator1, class Iterator2>
class shark::PairIterator< Value, Iterator1, Iterator2 >

A Pair-Iterator which gives a unified view of two ranges.

A Pair-Iterator is an iterator which zips two ranges together and returns the zipped result. This implementation allows the return type to be an arbirtrary Pair which is then constructed using Reference(*iter1,*iter2) when the iterator is dereferenced. This allows for more expressive element access instead of iter->first or iter->second.

Todo:
Both underlying Iterators must be random access iterators.

Definition at line 70 of file ZipPair.h.

Constructor & Destructor Documentation

§ PairIterator() [1/3]

template<class Value, class Iterator1, class Iterator2>
shark::PairIterator< Value, Iterator1, Iterator2 >::PairIterator ( )
inline

Definition at line 80 of file ZipPair.h.

§ PairIterator() [2/3]

template<class Value, class Iterator1, class Iterator2>
template<class IteratorT1 , class IteratorT2 >
shark::PairIterator< Value, Iterator1, Iterator2 >::PairIterator ( IteratorT1 const &  iterator1,
IteratorT2 const &  iterator2 
)
inline

Copy-Constructs this iterator from some other IndexedIterator convertible to this.

Definition at line 84 of file ZipPair.h.

§ PairIterator() [3/3]

template<class Value, class Iterator1, class Iterator2>
template<class V , class I1 , class I2 >
shark::PairIterator< Value, Iterator1, Iterator2 >::PairIterator ( PairIterator< V, I1, I2 > const &  iterator)
inline

Definition at line 88 of file ZipPair.h.

Member Function Documentation

§ first()

template<class Value, class Iterator1, class Iterator2>
Iterator1 shark::PairIterator< Value, Iterator1, Iterator2 >::first ( ) const
inline

Definition at line 91 of file ZipPair.h.

§ iterators()

template<class Value, class Iterator1, class Iterator2>
std::pair<Iterator1,Iterator2> shark::PairIterator< Value, Iterator1, Iterator2 >::iterators ( ) const
inline

Definition at line 99 of file ZipPair.h.

§ second()

template<class Value, class Iterator1, class Iterator2>
Iterator2 shark::PairIterator< Value, Iterator1, Iterator2 >::second ( ) const
inline

Definition at line 95 of file ZipPair.h.

Friends And Related Function Documentation

§ PairIterator

template<class Value, class Iterator1, class Iterator2>
template<class , class , class >
friend class PairIterator
friend

Definition at line 78 of file ZipPair.h.

§ SHARK_ITERATOR_CORE_ACCESS

template<class Value, class Iterator1, class Iterator2>
friend class SHARK_ITERATOR_CORE_ACCESS
friend

Definition at line 104 of file ZipPair.h.


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