ATLAS Offline Software
Loading...
Searching...
No Matches
DbStorageSvc.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 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
11#include "StorageSvc/DbPrint.h"
12
13/*
14 * POOL namespace declaration
15 */
16namespace pool {
17
18 // Forward declarations
19 class DbOption;
20 class IOODatabase;
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
54 public:
55
58
60 explicit DbStorageSvc(const std::string& name);
61
63 virtual ~DbStorageSvc();
64
65 DbStorageSvc (const DbStorageSvc&) = delete;
67
69 virtual unsigned int addRef() override final;
70
72 virtual unsigned int release() override final;
73
75
77 virtual StatusCode initialize();
78
80 virtual StatusCode finalize();
81
83 virtual const std::string& name() const { return m_name; }
84
86
97 virtual StatusCode allocate( FileDescriptor& refDB,
98 const std::string& refCont,
99 int technology,
100 const void* object,
101 ShapeH shapeH,
102 Token*& refpTok) override final;
103
105
113 virtual StatusCode read( const FileDescriptor& refDB,
114 const Token& persToken,
115 ShapeH shapeH,
116 void** object) override final;
117
119
124 virtual std::string getContName(FileDescriptor& refDB,
125 Token& persToken) override final;
126
128
140 virtual StatusCode getShape( FileDescriptor& refDB,
141 const Guid& objType,
142 ShapeH& shapeH) override final;
143
145
150 virtual ShapeH createShape( const Guid& shapeID ) override final;
151
153
167 virtual StatusCode startSession(int mode, int tech) override final;
168
170
177 virtual StatusCode endSession() override final
178 { return m_domH.close(); }
179
181
188 virtual StatusCode existsConnection(const FileDescriptor& refDB) override final;
189
191
205 virtual StatusCode connect(int mode, FileDescriptor& refDB) override final;
206
208
221 virtual StatusCode disconnect( FileDescriptor& refDB) override final;
222
224
230 virtual StatusCode openMode( FileDescriptor& refDB,
231 int& mode ) override final;
232
233
235
247 virtual StatusCode endTransaction( FileDescriptor& refDB,
248 Transaction::Action typ) override final;
249
251
261 virtual StatusCode getDomainOption(DbOption& opt) override final
262 { return m_domH.getOption(opt); }
263
265
275 virtual StatusCode setDomainOption(const DbOption& opt) override final
276 { return m_domH.setOption(opt); }
277
278 private:
281
282 };
283} // End namespace pool
284#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:36
virtual StatusCode connect(int mode, FileDescriptor &refDB) override final
Connect to a logical Database unit.
virtual StatusCode endSession() override final
End the Database session.
virtual std::string getContName(FileDescriptor &refDB, Token &persToken) override final
Get container name for object.
virtual StatusCode startSession(int mode, int tech) override final
Start a new Database Session.
virtual StatusCode getShape(FileDescriptor &refDB, const Guid &objType, ShapeH &shapeH) override final
Retrieve persistent shape from Storage manager.
virtual StatusCode existsConnection(const FileDescriptor &refDB) override final
Check the existence of a logical Database unit.
IOODatabase * db()
Access technology implementations.
virtual StatusCode initialize()
IService implementation override: Initilize Service.
virtual StatusCode setDomainOption(const DbOption &opt) override final
Set options for a given database domain.
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.
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 getDomainOption(DbOption &opt) override final
Access options for a given database domain.
virtual StatusCode read(const FileDescriptor &refDB, const Token &persToken, ShapeH shapeH, void **object) override final
Read a persistent object from the medium.
IOODatabase * m_implementation
Loaded StorageSvc implementation type (for m_type)
std::string m_name
Service Name.
virtual unsigned int release() override final
IInterface implementation: Release Interface instance.
DbType m_type
Technology type.
virtual ~DbStorageSvc()
Standard destructor.
DbStorageSvc(const DbStorageSvc &)=delete
virtual StatusCode endTransaction(FileDescriptor &refDB, Transaction::Action typ) override final
End/Finish an existing Transaction sequence.
DbStorageSvc(const std::string &name)
Initializing Constructor: Constructs an object of type DbStorageSvc.
unsigned int m_refCount
Reference counter.
std::vector< const Token * > TokenVec
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:50
Framework include files.
Definition libname.h:15
const class Shape * ShapeH
STL namespace.