Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

SgVectorPairIterator< T > Class Template Reference

#include <SgVector.h>

List of all members.


Detailed Description

template<typename T>
class SgVectorPairIterator< T >

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)
    
Todo:
use standard iterator format.

Definition at line 757 of file 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


Constructor & Destructor Documentation

template<typename T>
SgVectorPairIterator< T >::SgVectorPairIterator ( const SgVector< T > &  vector  ) 

Definition at line 779 of file SgVector.h.

template<typename T>
virtual SgVectorPairIterator< T >::~SgVectorPairIterator (  )  [virtual]

Definition at line 762 of file SgVector.h.


Member Function Documentation

template<typename T>
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 786 of file SgVector.h.

References SgVectorPairIterator< T >::m_index1, SgVectorPairIterator< T >::m_index2, and SgVectorPairIterator< T >::m_vector.


Member Data Documentation

template<typename T>
int SgVectorPairIterator< T >::m_index1 [private]

Definition at line 774 of file SgVector.h.

Referenced by SgVectorPairIterator< T >::NextPair().

template<typename T>
int SgVectorPairIterator< T >::m_index2 [private]

Definition at line 775 of file SgVector.h.

Referenced by SgVectorPairIterator< T >::NextPair().

template<typename T>
const SgVector<T>& SgVectorPairIterator< T >::m_vector [private]

Definition at line 773 of file SgVector.h.

Referenced by SgVectorPairIterator< T >::NextPair().


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


17 Jun 2010 Doxygen 1.4.7