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

DbFederation.h

Go to the documentation of this file.
00001 //====================================================================
00002 //      DbFederation and related class definitions
00003 //--------------------------------------------------------------------
00004 //
00005 //      Package    : DbCnv ( The LHCb Offline System)
00006 //      Author     : M.Frank
00007 //====================================================================
00008 #ifndef DBCNV_DBFEDERATION_H
00009 #define DBCNV_DBFEDERATION_H
00010 
00011 // Framework include files
00012 #ifndef DBCNV_DBSESSION_H
00013 #include "GaudiDb/DbSession.h"
00014 #endif // DBCNV_DBSESSION_H
00015 #ifndef DBCNV_DBDATABASE_H
00016 #include "GaudiDb/DbDataBase.h"
00017 #endif // DBCNV_DBDATABASE_H
00018 
00019 // Forward declarations
00020 class DbSession;
00021 class DbDataBase;
00022 class DbFederationImpl;
00023 class IDbFederation;
00024 template <class T> class dbHandle;
00025 
00046 template <> class dbHandle<DbFederation> : public dbHandleBase<DbFederation> {
00047 public:
00049   friend class DbFederation;
00050   friend class DbFederationImplementation;
00051 private:
00053   mutable std::string  m_name;
00055   mutable DbAccessMode m_mode;
00056 private:
00058   dbHandle(DbFederation* fed);
00060   void switchPtr(_DataType* obj)  const;
00062   IDbFederation* info()  const;
00063 public:
00065   dbHandle() : m_mode(DbOOMs::READ)   {
00066   }
00068   dbHandle(unsigned char type)
00069   : m_mode(DbOOMs::READ)   {
00070     m_type = type;
00071   }
00073   dbHandle(const dbHandle<DbFederation>& copy)      
00074   : dbHandleBase<DbFederation>()
00075   {
00076     *this = copy;
00077   }
00079   virtual ~dbHandle()       {
00080     switchPtr( 0 );
00081   }
00083   dbHandle& operator=(const dbHandle<DbFederation>& copy)   {
00084     switchPtr( copy.m_ptr );
00085     m_name = copy.m_name;
00086     m_mode = copy.m_mode;
00087     m_type = copy.m_type;
00088     return *this;
00089   }
00091   DbAccessMode openMode()   const   {
00092     return m_mode;
00093   }
00095   const std::string& name()  const   {
00096     return m_name;
00097   }
00099   const char* typeName()    const;
00101   bool exist(const dbHandle<DbSession>& sessionH, const std::string& name)  const;
00103   DbResult open(const dbHandle<DbSession>& sessionH, const std::string& name, DbAccessMode mode)  const;
00105   DbResult close()   const;
00107   dbHandle<DbSession> containedIn()    const;
00109   long addRef()  const;
00111   long release()  const;
00113   bool existsDbase( const std::string& name )   const;
00115   DbResult add(const std::string& name, DbDataBase* db)  const;
00117   DbDataBase* find(const std::string& name)  const;
00119   DbResult remove(DbDataBase* db)  const;
00121   IOODataBase* db();
00123   IMessageSvc* msgSvc();
00124 };
00125 
00126 #endif // DBCNV_DBFEDERATION_H

Generated at Wed Nov 21 12:22:19 2001 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000