ESyS-Particle  2.3
handle.h
Go to the documentation of this file.
1 // //
3 // Copyright (c) 2003-2014 by The University of Queensland //
4 // Centre for Geoscience Computing //
5 // http://earth.uq.edu.au/centre-geoscience-computing //
6 // //
7 // Primary Business: Brisbane, Queensland, Australia //
8 // Licensed under the Open Software License version 3.0 //
9 // http://www.opensource.org/licenses/osl-3.0.php //
10 // //
12 
13 #ifndef __HANDLE_H
14 #define __HANDLE_H
15 
16 //--- project includes ---
17 #include "handle_exception.h"
18 
25 template <typename T>
26 class T_Handle
27 {
28  private:
29  T* m_rep;
30  int* m_count;
31 
32  public:
33  T_Handle(T*);
34  T_Handle(const T_Handle&);
35  ~T_Handle();
36 
37  T_Handle& operator=(const T_Handle&);
38  inline T* operator->() {return m_rep;};
39  inline T& operator*(){return *m_rep;};
40  //void destroy();
41 };
42 
43 #include "handle.hpp"
44 
45 #endif // __HANDLE_H
T * m_rep
Definition: handle.h:29
int * m_count
Definition: handle.h:30
T & operator*()
Definition: handle.h:39
~T_Handle()
Definition: handle.hpp:24
T * operator->()
Definition: handle.h:38
T_Handle & operator=(const T_Handle &)
Definition: handle.hpp:33
T_Handle(T *)
Definition: handle.hpp:14
Template class for a handle/ref. counted pointer.
Definition: handle.h:26