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 
14 /*
15  * POOL namespace declaration
16  */
17 namespace pool {
18 
19  // Forward declarations
20  class DbStorageExplorer;
21  class DbClassMap;
22  class DbModule;
23  class DbOption;
24  class DbSelect;
25 
41  class DbStorageSvc : virtual public IStorageSvc
42  {
43  typedef std::vector<const Token*> TokenVec;
44  private:
46  std::string m_name;
48  unsigned int m_refCount;
59  public:
60 
63 
65  DbStorageSvc(const std::string& name);
66 
68  virtual ~DbStorageSvc();
69 
70  DbStorageSvc (const DbStorageSvc&) = delete;
72 
74  static const char* catalogLabel() { return "pool_DbStorageSvc"; }
75 
77  DbSession& sessionHdl() { return m_sesH; }
79  DbDomain& domainHdl() { return m_domH; }
80 
82  virtual DbStatus queryInterface(const Guid& riid, void** ppvUnknown);
83 
85  virtual unsigned int addRef();
86 
88  virtual unsigned int release();
89 
92  virtual DbStatus initialize();
94 
96  virtual DbStatus finalize();
97 
99  virtual const std::string& name() const { return m_name; }
100 
103 
116  const std::string& refCont,
117  int technology,
118  const void* object,
119  ShapeH shapeH,
120  Token*& refpTok);
121 
123 
132  virtual DbStatus update( FileDescriptor& refDB,
133  const void* object,
134  ShapeH shapeH,
135  Token& refToken);
136 
138 
145  virtual DbStatus destroy( FileDescriptor& refDB,
146  Token& refToken);
147 
148 
150 
158  virtual DbStatus read( const FileDescriptor& refDB,
159  const Token& persToken,
160  ShapeH shapeH,
161  void** object);
162 
164 
169  virtual std::string getContName(FileDescriptor& refDB,
170  Token& persToken);
171 
173 
186  const Guid& objType,
187  ShapeH& shapeH);
188 
190 
201  virtual DbStatus createShape( const FileDescriptor& refDB,
202  const std::string& cntName,
203  const Guid& shapeID,
204  ShapeH& shapeH);
205 
207 
225  int tech,
226  SessionH& session);
227 
229 
241  virtual DbStatus endSession( const SessionH session);
242 
244 
255  virtual DbStatus existsConnection(const SessionH sessionH,
256  int mode,
257  const FileDescriptor& refDB);
258 
260 
275  virtual DbStatus connect( const SessionH sessionH,
276  int mode,
277  FileDescriptor& refDB);
278 
280 
291  int mode );
292 
294 
308 
310 
318  int& mode );
319 
320 
322 
338  Transaction::Action typ);
339 
341 
352  virtual DbStatus getDomainOption(const SessionH sessionH,
353  DbOption& opt);
354 
356 
367  virtual DbStatus setDomainOption(const SessionH sessionH,
368  const DbOption& opt);
369  };
370 } // End namespace pool
371 #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:43
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:99
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:48
pool::DbStorageSvc::existsConnection
virtual DbStatus existsConnection(const SessionH sessionH, int mode, const FileDescriptor &refDB)
Check the existence of a logical Database unit.
pool::DbStorageSvc::destroy
virtual DbStatus destroy(FileDescriptor &refDB, Token &refToken)
Destroy an existing persistent object.
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:52
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
pool::ShapeH
const class Shape * ShapeH
Definition: DbContainerObj.h:27
pool::DbStorageSvc::domainHdl
DbDomain & domainHdl()
Database domain handle.
Definition: DbStorageSvc.h:79
pool::DbType
Definition: DbType.h:31
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:54
pool::DbStorageSvc::getShape
virtual DbStatus getShape(FileDescriptor &refDB, const Guid &objType, ShapeH &shapeH)
Retrieve persistent shape from Storage manager.
pool::DbStorageSvc::update
virtual DbStatus update(FileDescriptor &refDB, const void *object, ShapeH shapeH, Token &refToken)
In place update of an existing object.
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:94
pool::DbStorageSvc::sessionHdl
DbSession & sessionHdl()
Database session handle.
Definition: DbStorageSvc.h:77
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::reconnect
virtual DbStatus reconnect(FileDescriptor &refDB, int mode)
Reconnect to a logical Database unit with different access mode.
pool::DbStorageSvc::m_explorer
DbStorageExplorer * m_explorer
Reference to storage explorer object.
Definition: DbStorageSvc.h:58
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:20
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:74
pool::DbStorageSvc::m_name
std::string m_name
Service Name
Definition: DbStorageSvc.h:46
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:56
pool::DbStorageSvc::m_sesH
DbSession m_sesH
Database session handle.
Definition: DbStorageSvc.h:50
pool::DbStorageSvc
Definition: DbStorageSvc.h:42
pool::DbStorageSvc::initialize
virtual DbStatus initialize()
IService implementation override: Initilize Service.
pool::DbStorageSvc::DbStorageSvc
DbStorageSvc()
Standard Constructor: Constructs an object of type DbStorageSvc.