GCpp general purpose C++ library  version 1.0
GListIterT.hh
Go to the documentation of this file.
1 //======================================================================
2 /*! \file GListIterT.hh
3  *
4  * Include file for GListIterT template class.
5  */
6 //======================================================================
7 
8 #ifndef G_LIST_ITER_T_HH
9 #define G_LIST_ITER_T_HH
10 
11 #include "GIterT.hh"
12 
13 template < class T > class GListT;
14 
15 //======================================================================
16 /*! \class GListIterT
17  *
18  * The template class GListIterT defines the list collections
19  * iterator.
20  */
21 template < class T > class GListIterT : public GIterT<T>
22 {
23  //------------------------------------------------------------
24  /*! \object_doc */
26  //------------------------------------------------------------
27 
28  friend class GListT<T>;
29 
30  protected:
31  GListIterT<T> * previous_item; ///< Pointer on the list iterator of previous item
32  GListIterT<T> * next_item; ///< Pointer on the list iterator of next item
33 
34  public:
35 
36  //------------------------------------------------------------
37  // Constructor / Destructor / Affectation
38  GListIterT ( );
39  GListIterT ( const GListIterT<T> & p );
40  virtual ~GListIterT ( );
41  GListIterT<T> & operator = ( const GListIterT<T> & p );
42 
43  //------------------------------------------------------------
44  void SetPreviousIterPtr ( GListIterT<T> * iter_ptr );
45  void SetNextIterPtr ( GListIterT<T> * iter_ptr );
46 
47  //------------------------------------------------------------
48  // Cast, reference and dereference
49 
50  //------------------------------------------------------------
51  // Comparison operators
52  virtual bool operator == ( const GListIterT<T> & p ) const;
53  virtual bool operator != ( const GListIterT<T> & p ) const;
54 
55  //------------------------------------------------------------
56  // Incrementation / decrementation
57  GListIterT<T> & operator ++ ( void );
58  GListIterT<T> & operator -- ( void );
59  GListIterT<T> operator ++ ( int );
60  GListIterT<T> operator -- ( int );
61 
62  //------------------------------------------------------------
63  const GListIterT<T> * PreviousIterPtr ( ) const;
64  const GListIterT<T> * NextIterPtr ( ) const;
65  GListIterT<T> * PreviousIterPtr ( );
66  GListIterT<T> * NextIterPtr ( );
67  GListIterT<T> Previous ( ) const;
68  GListIterT<T> Next ( ) const;
69 
70  //------------------------------------------------------------
71  virtual int Index ( );
72 };
73 
74 
75 //----------------------------------------------------------------------
76 // Inline and template functions
77 #include "icc/GListIterT.icc"
78 
79 
80 //======================================================================
81 #endif
Definition: GIterT.hh:21
GListIterT< T > Next() const
Definition: GListIterT.icc:139
Definition: GListIterT.hh:21
Definition: GListIterT.hh:13
GListIterT< T > * next_item
Pointer on the list iterator of next item.
Definition: GListIterT.hh:32
GListIterT< T > * previous_item
Pointer on the list iterator of previous item.
Definition: GListIterT.hh:31
const GListIterT< T > * NextIterPtr() const
Definition: GListIterT.icc:128
void SetPreviousIterPtr(GListIterT< T > *iter_ptr)
Definition: GListIterT.icc:48
#define GObject(T)
Definition: GClassDefine.hh:65
GListIterT< T > Previous() const
Definition: GListIterT.icc:132
virtual int Index()
Definition: GListIterT.icc:148
const GListIterT< T > * PreviousIterPtr() const
Definition: GListIterT.icc:123
void SetNextIterPtr(GListIterT< T > *iter_ptr)
Definition: GListIterT.icc:54