Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

CdbBdbShared.cc

Go to the documentation of this file.
00001 // File and Version Information:
00002 //      $Id: CdbBdbShared.cc,v 1.6 2004/05/24 18:19:29 gapon Exp $
00003 
00004 /// The implementation of the CdbBdbShared singleton.
00005 /**
00006   * @see CdbBdbShared
00007   */
00008 
00009 #include "BaBar/BaBar.hh"
00010 
00011 #include "CdbBdbShared/CdbBdbShared.hh"
00012 #include "CdbBdbShared/CdbBdbSCdb.hh"
00013 
00014 #include "CdbBdb/CdbBdb.hh"
00015 
00016 namespace {
00017 
00018     const CdbBdbSCdb*
00019     instantiate_Cdb( )
00020     {
00021       // The constructor will register a smart pointer onto itself
00022       // into the Registry. This is why we're having a sort of "memory leak" here.
00023 
00024         static CdbBdbSCdb* ptr = 0;
00025         if( 0 == ptr ) ptr = new CdbBdbSCdb( );
00026         return ptr;
00027     }
00028 };
00029 
00030 void
00031 CdbBdbShared::forceLoad( )
00032 {
00033   // WARNING: We should never mess with smart pointers onto this object because
00034   //          they may destroy the object, which is still in the registry.
00035 
00036     // const Cdb* cdb = 
00037     instantiate_Cdb( );
00038 }
00039 
00040 const char*
00041 CdbBdbShared::technology( )
00042 {
00043     return CdbBdb::technology( );
00044 }
00045 
00046 const char*
00047 CdbBdbShared::implementation( )
00048 {
00049     return "Shared";
00050 }
00051 
00052 /////////////////
00053 // End Of File //
00054 /////////////////

Generated on Mon Dec 5 18:22:02 2005 for CDB by doxygen1.3-rc3