CLHEP VERSION Reference Documentation
CLHEP Home Page CLHEP Documentation CLHEP Bug Reports |
00001 #ifndef ZMHANDLETO_H 00002 #define ZMHANDLETO_H 00003 00004 00005 // ---------------------------------------------------------------------- 00006 // 00007 // ZMhandleTo.h - generic handle class for objects that need to be 00008 // reference-counted 00009 // 00010 // History: 00011 // 19-Sep-1997 WEB Design stolen, and code adapted, from 00012 // Stroustrup: "The C++ Programming Language, 3rd edition" (1997), p 783 00013 // Koenig & Moo: "Ruminations on C++" (1996), ch 7 00014 // 00015 // ---------------------------------------------------------------------- 00016 00017 00018 #ifndef ZMUSECOUNT_H 00019 #include "CLHEP/RefCount/ZMuseCount.h" 00020 #endif 00021 00022 00023 template< class T > 00024 class ZMhandleTo { 00025 00026 public: 00027 00028 ZMhandleTo(); 00029 ZMhandleTo( const ZMhandleTo & h ); 00030 ~ZMhandleTo(); 00031 00032 ZMhandleTo & operator=( const ZMhandleTo & rhs ); 00033 00034 protected: 00035 ZMhandleTo( const T & t ); 00036 ZMhandleTo( const T * t ); 00037 00038 ZMuseCount u_; 00039 T * rep_; 00040 00041 00042 }; // ZMhandleTo<> 00043 00044 00045 #include "CLHEP/RefCount/ZMhandleTo.icc" 00046 00047 00048 #endif // ZMHANDLETO_H