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

CdbBdbWrapper.cc

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

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