ATLAS Offline Software
Loading...
Searching...
No Matches
DbStorageSvc.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef POOL_DBSTORAGESVC_H
6#define POOL_DBSTORAGESVC_H
7
8// Framework include files
10#include "StorageSvc/DbDomain.h"
12#include "POOLCore/DbPrint.h"
13
14/*
15 * POOL namespace declaration
16 */
17namespace pool {
18
19 // Forward declarations
20 class DbOption;
21
37 class DbStorageSvc : virtual public IStorageSvc, virtual public APRMessaging
38 {
39 typedef std::vector<const Token*> TokenVec;
40 private:
42 std::string m_name;
44 unsigned int m_refCount;
53 public:
54
57
59 explicit DbStorageSvc(const std::string& name);
60
62 virtual ~DbStorageSvc();
63
64 DbStorageSvc (const DbStorageSvc&) = delete;
66
68 static const char* catalogLabel() { return "pool_DbStorageSvc"; }
69
73 DbDomain& domainHdl() { return m_domH; }
74
76 virtual StatusCode queryInterface(const Guid& riid, void** ppvUnknown) override final;
77
79 virtual unsigned int addRef() override final;
80
82 virtual unsigned int release() override final;
83
85
87 virtual StatusCode initialize();
88
90 virtual StatusCode finalize();
91
93 virtual const std::string& name() const { return m_name; }
94
96
107 virtual StatusCode allocate( FileDescriptor& refDB,
108 const std::string& refCont,
109 int technology,
110 const void* object,
111 ShapeH shapeH,
112 Token*& refpTok) override final;
113
115
123 virtual StatusCode read( const FileDescriptor& refDB,
124 const Token& persToken,
125 ShapeH shapeH,
126 void** object) override final;
127
129
134 virtual std::string getContName(FileDescriptor& refDB,
135 Token& persToken) override final;
136
138
150 virtual StatusCode getShape( FileDescriptor& refDB,
151 const Guid& objType,
152 ShapeH& shapeH) override final;
153
155
160 virtual ShapeH createShape( const Guid& shapeID ) override final;
161
163
180 virtual StatusCode startSession(int mode,
181 int tech,
182 SessionH& session) override final;
183
185
197 virtual StatusCode endSession( const SessionH session) override final;
198
200
211 virtual StatusCode existsConnection(const SessionH sessionH,
212 int mode,
213 const FileDescriptor& refDB) override final;
214
216
231 virtual StatusCode connect( const SessionH sessionH,
232 int mode,
233 FileDescriptor& refDB) override final;
234
236
249 virtual StatusCode disconnect( FileDescriptor& refDB) override final;
250
252
258 virtual StatusCode openMode( FileDescriptor& refDB,
259 int& mode ) override final;
260
261
263
275 virtual StatusCode endTransaction( ConnectionH conn,
276 Transaction::Action typ) override final;
277
279
290 virtual StatusCode getDomainOption(const SessionH sessionH,
291 DbOption& opt) override final;
292
294
305 virtual StatusCode setDomainOption(const SessionH sessionH,
306 const DbOption& opt) override final;
307 };
308} // End namespace pool
309#endif // POOL_DBSTORAGESVC_H
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition Token.h:21
APRMessaging(const std::string &name)
Description:
Definition DbDomain.h:47
Description: Definition an option to be supplied to database objects.
Definition DbOption.h:37
Db objects: class DbSession.
Definition DbSession.h:44
virtual std::string getContName(FileDescriptor &refDB, Token &persToken) override final
Get container name for object.
virtual StatusCode getShape(FileDescriptor &refDB, const Guid &objType, ShapeH &shapeH) override final
Retrieve persistent shape from Storage manager.
virtual StatusCode endSession(const SessionH session) override final
End the Database session.
virtual StatusCode queryInterface(const Guid &riid, void **ppvUnknown) override final
IInterface implementation: Query interfaces of Interface.
virtual StatusCode initialize()
IService implementation override: Initilize Service.
virtual StatusCode getDomainOption(const SessionH sessionH, DbOption &opt) override final
Access options for a given database domain.
DbSession & sessionHdl()
Database session handle.
virtual StatusCode allocate(FileDescriptor &refDB, const std::string &refCont, int technology, const void *object, ShapeH shapeH, Token *&refpTok) override final
Register object for write.
virtual StatusCode finalize()
IService implementation override: Finalize Service.
int m_ageLimit
Property: AgeLimit indicating the maximal allowed age of files.
virtual unsigned int addRef() override final
IInterface implementation: Reference Interface instance.
DbDomain m_domH
Database domain handle.
virtual StatusCode openMode(FileDescriptor &refDB, int &mode) override final
Query the access mode of a Database unit.
virtual StatusCode disconnect(FileDescriptor &refDB) override final
Disconnect from a logical Database unit.
DbSession m_sesH
Database session handle.
virtual StatusCode startSession(int mode, int tech, SessionH &session) override final
Start a new Database Session.
virtual ShapeH createShape(const Guid &shapeID) override final
Create a Shape representation based on a ShapeID.
DbStorageSvc & operator=(const DbStorageSvc &)=delete
DbStorageSvc()
Standard Constructor: Constructs an object of type DbStorageSvc.
virtual StatusCode read(const FileDescriptor &refDB, const Token &persToken, ShapeH shapeH, void **object) override final
Read a persistent object from the medium.
std::string m_name
Service Name.
virtual unsigned int release() override final
IInterface implementation: Release Interface instance.
virtual StatusCode connect(const SessionH sessionH, int mode, FileDescriptor &refDB) override final
Connect to a logical Database unit.
virtual StatusCode existsConnection(const SessionH sessionH, int mode, const FileDescriptor &refDB) override final
Check the existence of a logical Database unit.
DbType m_type
Technology type.
DbDomain & domainHdl()
Database domain handle.
virtual ~DbStorageSvc()
Standard destructor.
DbStorageSvc(const DbStorageSvc &)=delete
DbStorageSvc(const std::string &name)
Initializing Constructor: Constructs an object of type DbStorageSvc.
unsigned int m_refCount
Reference counter.
virtual StatusCode endTransaction(ConnectionH conn, Transaction::Action typ) override final
End/Finish an existing Transaction sequence.
virtual StatusCode setDomainOption(const SessionH sessionH, const DbOption &opt) override final
Set options for a given database domain.
std::vector< const Token * > TokenVec
static const char * catalogLabel()
Label of the specific class.
virtual const std::string & name() const
IService implementation: Retrieve name of the service.
The IStorageSvc interface is able to handle user request for.
Definition IStorageSvc.h:56
pool namespace
Definition libname.h:15
class Session * SessionH
Definition IStorageSvc.h:28
class DatabaseConnection * ConnectionH
const class Shape * ShapeH
STL namespace.