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

DbDataBase.h

Go to the documentation of this file.
00001 //====================================================================
00002 //      DbDataBase and related class definitions
00003 //--------------------------------------------------------------------
00004 //
00005 //      Package    : DbCnv ( The LHCb Offline System)
00006 //      Author     : M.Frank
00007 //====================================================================
00008 #ifndef DBCNV_DBDATABASE_H
00009 #define DBCNV_DBDATABASE_H
00010 
00011 // STL include files
00012 
00013 // Framework include files
00014 #include "GaudiDb/DbBase.h"
00015 
00016 // Forward declarations
00017 class DbDataBase;
00018 class StreamBuffer;
00019 class DbDataBaseImpl;
00020 class IDbDataBase;
00021 class GenericLinkBase;
00022 template <class T> class dbHandle;
00023 
00044 template <> class dbHandle<DbDataBase> : public dbHandleBase<DbDataBase> {
00046   friend class DbDataBase;
00047   friend class DbDataBaseImplementation;
00049   mutable std::string  m_name;
00051   mutable DbAccessMode m_mode;
00053   void switchPtr(DbDataBase* obj)  const;
00055   dbHandle(DbDataBase* obj);
00056   // Let the implementation access the internals
00057   IDbDataBase* info()  const;
00058 public:
00060   dbHandle() 
00061   : dbHandleBase<DbDataBase>(), m_mode(DbOOMs::READ)  {
00062   }
00064   dbHandle(unsigned char type) 
00065   : dbHandleBase<DbDataBase>(), m_mode(DbOOMs::READ)   {
00066     m_type = type;
00067   }
00069   dbHandle(const dbHandle<DbDataBase>& copy)
00070     : dbHandleBase<DbDataBase>()
00071   {
00072     *this = copy;
00073   }
00075   virtual ~dbHandle() {
00076     switchPtr( 0 );
00077   }
00079   dbHandle& operator=(const dbHandle<DbDataBase>& copy) {
00080     switchPtr( copy.m_ptr );
00081     m_name = copy.m_name;
00082     m_mode = copy.m_mode;
00083     return *this;
00084   }
00086   DbAccessMode openMode()   const {
00087     return m_mode;
00088   }
00090   const std::string& name()  const {
00091     return m_name;
00092   }
00094   const std::string& fileName()  const {
00095     return m_name;
00096   }
00098   const std::string& pathName()  const {
00099     return m_name;
00100   }
00101   // Object type name
00102   const char* typeName()    const {
00103     return "DbDataBase";
00104   }
00106   IOODataBase* db();
00108   IMessageSvc* msgSvc();
00110   long addRef()  const;
00112   long release()  const;
00114   DbResult add(const std::string& name, DbContainer* cntH)  const;
00116   DbContainer* find(const std::string& name)  const;
00118   DbResult remove(DbContainer* cntH);
00120   dbHandle<DbFederation> containedIn()    const;
00122   bool exist(const dbHandle<DbFederation>& fedH, const std::string& name)  const;
00124   DbResult open(const dbHandle<DbFederation>& fedH, const std::string& name, DbAccessMode mode = DbOOMs::READ)   const;
00126   DbResult close()    const;
00128   long numAssocEntries()  const;
00130   DbResult assocEntry(long count, dbHandle<DbLink>& link, std::string& db, std::string& cnt, std::string& obj)  const;
00132   DbResult assocEntry(const dbHandle<DbLink>& which, std::string& db, std::string& cnt, std::string& obj)  const;
00134   DbResult addAssocEntry(const std::string& db, const std::string& cnt, const std::string& obj, dbHandle<DbLink>& to);
00136   long numObjTypes()  const;
00138   const DbTypeInfo* objType(long which)  const;
00140   const DbTypeInfo* objType(const std::string& name) const;
00142   DbResult addType (const std::string& cntName, const DbTypeInfo& pType);
00143 };
00144 #endif // DBCNV_DBDATABASE_H

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