GCpp general purpose C++ library  version 1.0
GPointer.hh
Go to the documentation of this file.
1 //======================================================================
2 /*! \file GPointer.hh
3  *
4  * Include file for class GPointer, containing a pointer of any type.
5  */
6 //======================================================================
7 
8 #ifndef G_POINTER_HH
9 #define G_POINTER_HH
10 
11 #include "GGlobal.hh"
12 
13 /*! \class GPointer
14  *
15  * This class defines a pointer on any kind of object.
16  * It is used as an interface for collections, that does not accept
17  * base type pointers (that does not contain the GObject functions).
18  */
19 
20 class GPointer
21 {
22  //------------------------------------------------------------
23  /* \object_doc */
25  //------------------------------------------------------------
26 
27  protected:
28  void * pointer; ///< Pointer on user data
29 
30  public:
31 
32  //------------------------------------------------------------
33  // Constructor / Destructor / Affectation
34  GPointer ( void *ptr = NULL );
35  GPointer ( const GPointer &original );
36 
37  virtual ~GPointer ( );
38 
39  GPointer & operator = ( const GPointer &original );
40 
41  //----------------------------------------------------------
42  // Comparison operators
43  virtual bool operator == ( const GPointer &ptr );
44 
45  //----------------------------------------------------------
46  // Get / Set functions
47  void * GetPointer ( ) const;
48  void SetPointer ( void * ptr );
49 
50 };
51 
52 //----------------------------------------------------------------------
53 // Inline functions
54 #include "icc/GPointer.icc"
55 
56 //======================================================================
57 #endif
Definition: GPointer.hh:20
virtual bool operator==(const GPointer &ptr)
Definition: GPointer.icc:51
void * pointer
Pointer on user data.
Definition: GPointer.hh:28
virtual ~GPointer()
Definition: GPointer.icc:25
void SetPointer(void *ptr)
Definition: GPointer.icc:42
#define GObject(T)
Definition: GClassDefine.hh:65
void * GetPointer() const
Definition: GPointer.icc:36
GPointer & operator=(const GPointer &original)
Definition: GPointer.icc:30
GPointer(void *ptr=NULL)
Definition: GPointer.icc:15