ESyS-Particle  2.3.4
handle.h
Go to the documentation of this file.
1 // //
3 // Copyright (c) 2003-2017 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.apache.org/licenses/LICENSE-2.0 //
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_Handle::m_count
int * m_count
Definition: handle.h:30
T_Handle::~T_Handle
~T_Handle()
Definition: handle.hpp:24
T_Handle::operator*
T & operator*()
Definition: handle.h:39
T_Handle::T_Handle
T_Handle(T *)
Definition: handle.hpp:14
T_Handle::m_rep
T * m_rep
Definition: handle.h:29
T_Handle::operator->
T * operator->()
Definition: handle.h:38
T_Handle
Template class for a handle/ref. counted pointer.
Definition: handle.h:27
handle_exception.h
handle.hpp
T_Handle::operator=
T_Handle & operator=(const T_Handle &)
Definition: handle.hpp:33