CLHEP VERSION Reference Documentation
   
CLHEP Home Page     CLHEP Documentation     CLHEP Bug Reports

RefCount/CLHEP/RefCount/ZMhandleTo.h
Go to the documentation of this file.
1 #ifndef ZMHANDLETO_H
2 #define ZMHANDLETO_H
3 
4 
5 // ----------------------------------------------------------------------
6 //
7 // ZMhandleTo.h - generic handle class for objects that need to be
8 // reference-counted
9 //
10 // History:
11 // 19-Sep-1997 WEB Design stolen, and code adapted, from
12 // Stroustrup: "The C++ Programming Language, 3rd edition" (1997), p 783
13 // Koenig & Moo: "Ruminations on C++" (1996), ch 7
14 //
15 // ----------------------------------------------------------------------
16 
17 
18 #ifndef ZMUSECOUNT_H
19 #include "CLHEP/RefCount/ZMuseCount.h"
20 #endif
21 
22 
23 template< class T >
24 class ZMhandleTo {
25 
26 public:
27 
28  ZMhandleTo();
29  ZMhandleTo( const ZMhandleTo & h );
30  ~ZMhandleTo();
31 
32  ZMhandleTo & operator=( const ZMhandleTo & rhs );
33 
34 protected:
35  ZMhandleTo( const T & t );
36  ZMhandleTo( const T * t );
37 
38  ZMuseCount u_;
39  T * rep_;
40 
41 
42 }; // ZMhandleTo<>
43 
44 
45 #include "CLHEP/RefCount/ZMhandleTo.icc"
46 
47 
48 #endif // ZMHANDLETO_H