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

DbDataBaseObj.h

Go to the documentation of this file.
00001 //====================================================================
00002 //      DbDataBase object definition
00003 //--------------------------------------------------------------------
00004 //
00005 //      Package    : System ( The LHCb Offline System)
00006 //
00007 //  Description: Generic data persistency
00008 //
00009 //      Author     : M.Frank
00010 //  History    :
00011 // +---------+----------------------------------------------+---------
00012 // |    Date |                 Comment                      | Who     
00013 // +---------+----------------------------------------------+---------
00014 // | 11/07/99| Initial version                              | MF
00015 // +---------+----------------------------------------------+---------
00016 //====================================================================
00017 #ifndef DBCNV_DBDATABASEOBJ_H
00018 #define DBCNV_DBDATABASEOBJ_H 1
00019 
00020 // We need the definition of the federation for defining the database
00021 #include "GaudiDb/IOODataBase.h"
00022 #include "GaudiDb/DbAccessObj.h"
00023 #include "GaudiDb/DbFederation.h"
00024 #include "GaudiDb/DbDataBase.h"
00025 #include "GaudiDb/DbContainer.h"
00026 
00027 // STL include files
00028 #include <map>
00029 
00051 class DbDataBase    : public  DbAccessObj<std::string, DbContainer >  {
00053   friend IDbDataBase;
00054   friend DbFederation;
00055   friend DbDataBaseImpl;
00056   friend dbHandle<DbDataBase>;
00057 public:
00059   typedef IDbDataBase::Link Link;
00061   typedef IDbDataBase::Type Type;
00062 private:
00064   typedef std::map<std::string, Link*> LinkMap;
00066   typedef std::vector<Link*>                 LinkVector;
00068   typedef std::map<std::string, Type*> TypeMap;
00070   typedef std::vector<Type*>                 TypeVector;
00072   mutable dbHandle<DbFederation>    m_fed;
00074   mutable dbHandle<DbContainer>     m_links;
00076   mutable dbHandle<DbContainer>     m_types;
00078   IOODataBase*                      m_dbOOMs;
00080   IMessageSvc*                      m_msgSvc;
00082   mutable IDbDataBase*              m_info;
00084   mutable LinkMap                   m_linkMap;
00086   mutable LinkVector                m_linkVector;
00088   mutable TypeMap                   m_typeMap;
00090   mutable TypeVector                m_typeVector;
00091 
00092 private:
00094   DbDataBase(const dbHandle<DbFederation>& fed, const std::string& name, DbAccessMode mode=DbOOMs::READ);
00096   virtual ~DbDataBase();
00098   dbHandle<DbFederation>& federation();
00100   const dbHandle<DbFederation>& federation()  const;
00102   IDbDataBase* info()  const;
00104   IOODataBase* db();
00106   IMessageSvc* msgSvc();
00108   DbResult closeContainers()  const;
00110   DbResult open()   const;
00112   DbResult close()  const;
00114   long numAssocEntries()  const;
00116   DbResult assocEntry(long count, dbHandle<DbLink>& link, std::string& db, std::string& cnt, std::string& obj)  const;
00118   DbResult assocEntry(const dbHandle<DbLink>& which, std::string& db, std::string& cnt, std::string& obj)  const;
00120   DbResult addAssocEntry(const std::string& db, const std::string& cnt, const std::string& obj, dbHandle<DbLink>& to);
00122   long numObjTypes()  const;
00124   const DbTypeInfo* objType(long which)  const;
00126   const DbTypeInfo* objType(const std::string& name) const;
00128   DbResult addType (const std::string& cntName, const DbTypeInfo& pType);
00129 };
00130 
00131 // inline code
00132 
00133 inline IOODataBase* DbDataBase::db()   {
00134   return m_dbOOMs;
00135 }
00136 
00137 inline IDbDataBase* DbDataBase::info()  const  {
00138   return m_info;
00139 }
00140 
00141 inline IMessageSvc* DbDataBase::msgSvc()   {
00142   return m_msgSvc;
00143 }
00144 
00145 inline dbHandle<DbFederation>& DbDataBase::federation()    {
00146   return m_fed;
00147 }
00148 
00149 inline const dbHandle<DbFederation>& DbDataBase::federation()  const  {
00150   return m_fed;
00151 }
00152 
00153 #endif // DBCNV_DBDATABASEOBJ_H

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