ATLAS Offline Software
DbStorageSvc.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // $Header: /cvs/PF/pool/StorageSvc/src/DbStorageSvc.h,v 1.36 2008/03/04 18:34:59 frankb Exp $
6 #ifndef POOL_DBSTORAGESVC_H
7 #define POOL_DBSTORAGESVC_H
8 
9 // Framework include files
10 #include "StorageSvc/DbSession.h"
11 #include "StorageSvc/DbDomain.h"
12 #include "StorageSvc/IStorageSvc.h"
13 #include "POOLCore/DbPrint.h"
14 
15 /*
16  * POOL namespace declaration
17  */
18 namespace pool {
19 
20  // Forward declarations
21  class DbStorageExplorer;
22  class DbOption;
23 
39  class DbStorageSvc : virtual public IStorageSvc, virtual public APRMessaging
40  {
41  typedef std::vector<const Token*> TokenVec;
42  private:
44  std::string m_name;
46  unsigned int m_refCount;
57  public:
58 
61 
63  explicit DbStorageSvc(const std::string& name);
64 
66  virtual ~DbStorageSvc();
67 
68  DbStorageSvc (const DbStorageSvc&) = delete;
70 
72  static const char* catalogLabel() { return "pool_DbStorageSvc"; }
73 
75  DbSession& sessionHdl() { return m_sesH; }
77  DbDomain& domainHdl() { return m_domH; }
78 
80  virtual DbStatus queryInterface(const Guid& riid, void** ppvUnknown);
81 
83  virtual unsigned int addRef();
84 
86  virtual unsigned int release();
87 
90  virtual DbStatus initialize();
92 
94  virtual DbStatus finalize();
95 
97  virtual const std::string& name() const { return m_name; }
98 
101 
114  const std::string& refCont,
115  int technology,
116  const void* object,
117  ShapeH shapeH,
118  Token*& refpTok);
119 
121 
129  virtual DbStatus read( const FileDescriptor& refDB,
130  const Token& persToken,
131  ShapeH shapeH,
132  void** object);
133 
135 
140  virtual std::string getContName(FileDescriptor& refDB,
141  Token& persToken);
142 
144 
157  const Guid& objType,
158  ShapeH& shapeH);
159 
161 
172  virtual DbStatus createShape( const FileDescriptor& refDB,
173  const std::string& cntName,
174  const Guid& shapeID,
175  ShapeH& shapeH);
176 
178 
196  int tech,
197  SessionH& session);
198 
200 
212  virtual DbStatus endSession( const SessionH session);
213 
215 
226  virtual DbStatus existsConnection(const SessionH sessionH,
227  int mode,
228  const FileDescriptor& refDB);
229 
231 
246  virtual DbStatus connect( const SessionH sessionH,
247  int mode,
248  FileDescriptor& refDB);
249 
251 
265 
267 
274  int& mode );
275 
276 
278 
294  Transaction::Action typ);
295 
297 
308  virtual DbStatus getDomainOption(const SessionH sessionH,
309  DbOption& opt);
310 
312 
323  virtual DbStatus setDomainOption(const SessionH sessionH,
324  const DbOption& opt);
325  };
326 } // End namespace pool
327 #endif // POOL_DBSTORAGESVC_H
pool::ConnectionH
class DatabaseConnection * ConnectionH
Definition: FileDescriptor.h:28
checkCorrelInHIST.conn
conn
Definition: checkCorrelInHIST.py:25
pool::DbStorageSvc::allocate
virtual DbStatus allocate(FileDescriptor &refDB, const std::string &refCont, int technology, const void *object, ShapeH shapeH, Token *&refpTok)
Register object for write.
pool::DbStatus
Definition: DbStatus.h:67
make_coralServer_rep.opt
opt
Definition: make_coralServer_rep.py:19
pool::DbStorageSvc::TokenVec
std::vector< const Token * > TokenVec
Definition: DbStorageSvc.h:41
pool::DbStorageSvc::~DbStorageSvc
virtual ~DbStorageSvc()
Standard destructor.
pool::DbStorageSvc::operator=
DbStorageSvc & operator=(const DbStorageSvc &)=delete
pool::DbStorageSvc::name
virtual const std::string & name() const
IService implementation: Retrieve name of the service
Definition: DbStorageSvc.h:97
pool::DbStorageSvc::connect
virtual DbStatus connect(const SessionH sessionH, int mode, FileDescriptor &refDB)
Connect to a logical Database unit.
pool::DbStorageSvc::m_refCount
unsigned int m_refCount
Reference counter
Definition: DbStorageSvc.h:46
pool::DbStorageSvc::existsConnection
virtual DbStatus existsConnection(const SessionH sessionH, int mode, const FileDescriptor &refDB)
Check the existence of a logical Database unit.
pool
pool namespace
Definition: libname.h:15
pool::DbStorageSvc::finalize
virtual DbStatus finalize()
IService implementation override: Finalize Service
pool::DbStorageSvc::disconnect
virtual DbStatus disconnect(FileDescriptor &refDB)
Disconnect from a logical Database unit.
pool::DbSession
Db objects: class DbSession.
Definition: DbSession.h:43
pool::DbStorageSvc::read
virtual DbStatus read(const FileDescriptor &refDB, const Token &persToken, ShapeH shapeH, void **object)
Read a persistent object from the medium.
pool::SessionH
class Session * SessionH
Definition: IStorageExplorer.h:35
pool::FileDescriptor
Definition: FileDescriptor.h:41
pool::DbStorageSvc::m_domH
DbDomain m_domH
Database domain handle.
Definition: DbStorageSvc.h:50
pool::APRMessaging
AthMessaging wrapper to set the output level in APR components.
Definition: DbPrint.h:35
DbSession.h
pool::DbStorageSvc::getContName
virtual std::string getContName(FileDescriptor &refDB, Token &persToken)
Get container name for object.
DbDomain.h
Token
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition: Token.h:21
DbPrint.h
pool::ShapeH
const class Shape * ShapeH
Definition: DbContainerObj.h:27
pool::DbStorageSvc::domainHdl
DbDomain & domainHdl()
Database domain handle.
Definition: DbStorageSvc.h:77
pool::DbType
Definition: DbType.h:30
pool::DbStorageSvc::openMode
virtual DbStatus openMode(FileDescriptor &refDB, int &mode)
Query the access mode of a Database unit.
pool::DbOption
Definition: DbOption.h:36
pool::DbStorageSvc::DbStorageSvc
DbStorageSvc(const DbStorageSvc &)=delete
pool::DbStorageSvc::m_ageLimit
int m_ageLimit
Property: AgeLimit indicating the maximal allowed age of files.
Definition: DbStorageSvc.h:52
pool::DbStorageSvc::getShape
virtual DbStatus getShape(FileDescriptor &refDB, const Guid &objType, ShapeH &shapeH)
Retrieve persistent shape from Storage manager.
pool::DbStorageSvc::createShape
virtual DbStatus createShape(const FileDescriptor &refDB, const std::string &cntName, const Guid &shapeID, ShapeH &shapeH)
Create a persistent shape a given Database container location.
Preparation.mode
mode
Definition: Preparation.py:107
pool::DbStorageSvc::sessionHdl
DbSession & sessionHdl()
Database session handle.
Definition: DbStorageSvc.h:75
pool::DbStorageSvc::getDomainOption
virtual DbStatus getDomainOption(const SessionH sessionH, DbOption &opt)
Access options for a given database domain.
pool::DbStorageSvc::addRef
virtual unsigned int addRef()
IInterface implementation: Reference Interface instance
pool::IStorageSvc
Definition: IStorageSvc.h:56
pool::DbStorageSvc::m_explorer
DbStorageExplorer * m_explorer
Reference to storage explorer object.
Definition: DbStorageSvc.h:56
pool::Transaction::Action
Action
Definition: Transaction.h:34
IStorageSvc.h
pool::DbStorageSvc::endSession
virtual DbStatus endSession(const SessionH session)
End the Database session.
pool::DbStorageSvc::startSession
virtual DbStatus startSession(int mode, int tech, SessionH &session)
Start a new Database Session.
pool::DbDomain
Definition: DbDomain.h:47
pool::DbStorageSvc::setDomainOption
virtual DbStatus setDomainOption(const SessionH sessionH, const DbOption &opt)
Set options for a given database domain.
Guid
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
Definition: Guid.h:25
pool::DbStorageExplorer
Definition: DbStorageExplorer.h:36
pool::DbStorageSvc::DbStorageSvc
DbStorageSvc(const std::string &name)
Initializing Constructor: Constructs an object of type DbStorageSvc.
pool::DbStorageSvc::queryInterface
virtual DbStatus queryInterface(const Guid &riid, void **ppvUnknown)
IInterface implementation: Query interfaces of Interface.
pool::DbStorageSvc::catalogLabel
static const char * catalogLabel()
Label of the specific class.
Definition: DbStorageSvc.h:72
pool::DbStorageSvc::m_name
std::string m_name
Service Name
Definition: DbStorageSvc.h:44
pool::DbStorageSvc::endTransaction
virtual DbStatus endTransaction(ConnectionH conn, Transaction::Action typ)
End/Finish an existing Transaction sequence.
pool::DbStorageSvc::release
virtual unsigned int release()
IInterface implementation: Release Interface instance
pool::DbStorageSvc::m_type
DbType m_type
Technology type.
Definition: DbStorageSvc.h:54
pool::DbStorageSvc::m_sesH
DbSession m_sesH
Database session handle.
Definition: DbStorageSvc.h:48
pool::DbStorageSvc
Definition: DbStorageSvc.h:40
pool::DbStorageSvc::initialize
virtual DbStatus initialize()
IService implementation override: Initilize Service.
pool::DbStorageSvc::DbStorageSvc
DbStorageSvc()
Standard Constructor: Constructs an object of type DbStorageSvc.