Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  
Public Member Functions | Private Attributes

SgVectorPairIterator< T > Class Template Reference

Iterator to iterate through all possible pairs of vector elements. More...

#include <SgVector.h>

List of all members.

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

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 734 of file SgVector.h.


Constructor & Destructor Documentation

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

Definition at line 755 of file SgVector.h.

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

Definition at line 739 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 762 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 750 of file SgVector.h.

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

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

Definition at line 751 of file SgVector.h.

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

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

Definition at line 749 of file SgVector.h.

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


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


Sun Mar 13 2011 Doxygen 1.7.1