00001 #ifndef CDB_CPTR_BASE_HH 00002 #define CDB_CPTR_BASE_HH 00003 00004 // File and Version Information: 00005 // $Id: CdbCPtrBase.hh,v 1.2 2002/09/23 22:33:31 gapon Exp $ 00006 00007 #include "CdbBase/CdbCommon.hh" 00008 00009 /// A base class for the counted smart pointer class. 00010 /** 00011 * The only role of this utility class is to provide "trusted" destruction of 00012 * an object of the specific parameter class. We do this operation in the 00013 * dedicated class in order to increase the flexibility in the actual 00014 * implementation of the derived smart pointers. 00015 */ 00016 template < class P > 00017 class CdbCPtrBase { 00018 00019 protected: 00020 00021 /// The destructor of pointed objects 00022 /** 00023 * We're assuming that the current class has access to the destructor 00024 * of the pointed object. Note, that the passed pointer will also be 00025 * reset to 0 upon the completion of this method. 00026 */ 00027 static void deleteObject( P*& ptr ); 00028 }; 00029 00030 #ifdef BABAR_COMP_INST 00031 #include "CdbBase/CdbCPtrBase.cc" 00032 #endif // BABAR_COMP_INST 00033 00034 #endif // CDB_CPTR_BASE_HH 00035
1.3-rc3