Iterator to iterate through all possible pairs of vector elements. More...
#include <SgVector.h>
Public Member Functions | |
SgVectorPairIterator (const SgVector< T > &vector) | |
virtual | ~SgVectorPairIterator () |
bool | NextPair (T &elt1, T &elt2) |
Find the next pair of data elements. | |
Private Attributes | |
const SgVector< T > & | m_vector |
int | m_index1 |
int | m_index2 |
Iterator to iterate through all possible pairs of vector elements.
Each pair is returned exactly once, i.e. with
vector = e1, e2, ... en
the returned pairs are (in order):
(e1, e2), (e1, e3), ... (e1, en), (e2,e3), ... (e(n - 1), en)
Definition at line 734 of file SgVector.h.
SgVectorPairIterator< T >::SgVectorPairIterator | ( | const SgVector< T > & | vector | ) |
Definition at line 755 of file SgVector.h.
virtual SgVectorPairIterator< T >::~SgVectorPairIterator | ( | ) | [virtual] |
Definition at line 739 of file SgVector.h.
bool SgVectorPairIterator< T >::NextPair | ( | T & | elt1, | |
T & | elt2 | |||
) |
Find the next pair of data elements.
Return true
and change elt1
and elt2
if not reached the end of the vector; return false
and don't touch the parameters if at the end of the vector.
Definition at line 762 of file SgVector.h.
References SgVectorPairIterator< T >::m_index1, SgVectorPairIterator< T >::m_index2, and SgVectorPairIterator< T >::m_vector.
int SgVectorPairIterator< T >::m_index1 [private] |
Definition at line 750 of file SgVector.h.
Referenced by SgVectorPairIterator< T >::NextPair().
int SgVectorPairIterator< T >::m_index2 [private] |
Definition at line 751 of file SgVector.h.
Referenced by SgVectorPairIterator< T >::NextPair().
const SgVector<T>& SgVectorPairIterator< T >::m_vector [private] |
Definition at line 749 of file SgVector.h.
Referenced by SgVectorPairIterator< T >::NextPair().