GCpp general purpose C++ library  version 1.0
GVectIterT.hh
Go to the documentation of this file.
1 //======================================================================
2 /*! \file GVectIterT.hh
3  *
4  * Include file for GVectIterT template class.
5  */
6 //======================================================================
7 
8 #ifndef G_VECT_ITER_T_HH
9 #define G_VECT_ITER_T_HH
10 
11 #include "GIterT.hh"
12 
13 template < class T > class GVectT;
14 
15 //======================================================================
16 /*! \class GVectIterT
17  *
18  * The template class GVectIterT defines the vector collections
19  * iterator.
20  */
21 template < class T > class GVectIterT : public GIterT<T>
22 {
23  //------------------------------------------------------------
24  /*! \object_doc */
26  //------------------------------------------------------------
27 
28  friend class GVectT<T>;
29 
30  protected:
31  GVectT<T> * vector_ptr; ///< Vector the iterator points to
32  int index; ///< Index in the vector array
33 
34  //------------------------------------------------------------
35  // Constructor / Destructor / Affectation
36  public:
37  GVectIterT ( );
38  GVectIterT ( const GVectIterT<T> & p );
39  protected:
40  GVectIterT ( const GVectT<T> * vect, int ind );
41  public:
42  virtual ~GVectIterT ( );
43  GVectIterT<T> & operator = ( const GVectIterT<T> & p );
44 
45  //------------------------------------------------------------
46  const GVectT<T> * GetVectorPtr( ) const;
47  GVectT<T> * GetVectorPtr( );
48 
49  //------------------------------------------------------------
50  // Cast, reference and dereference
51 
52  //------------------------------------------------------------
53  // Comparison operators
54  virtual bool operator == ( const GVectIterT<T> & p ) const;
55  virtual bool operator != ( const GVectIterT<T> & p ) const;
56 
57  virtual bool operator == ( const T * p ) const;
58  virtual bool operator != ( const T * p ) const;
59 
60  //------------------------------------------------------------
61  // Incrementation / decrementation
62  GVectIterT<T> & operator ++ ( void );
63  GVectIterT<T> & operator -- ( void );
64  GVectIterT<T> operator ++ ( int );
65  GVectIterT<T> operator -- ( int );
66 
67  //------------------------------------------------------------
68  virtual int Index ( ) const;
69 };
70 
71 
72 //----------------------------------------------------------------------
73 // Inline functions
74 #include "icc/GVectIterT.icc"
75 
76 
77 //======================================================================
78 #endif
Definition: GIterT.hh:21
GVectT< T > * vector_ptr
Vector the iterator points to.
Definition: GVectIterT.hh:31
virtual int Index() const
Definition: GVectIterT.icc:174
const GVectT< T > * GetVectorPtr() const
Definition: GVectIterT.icc:66
Definition: GVectIterT.hh:13
#define GObject(T)
Definition: GClassDefine.hh:65
int index
Index in the vector array.
Definition: GVectIterT.hh:32
Definition: GVectIterT.hh:21