ATLAS Offline Software
IStorageSvc.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/StorageSvc/IStorageSvc.h,v 1.33 2008/05/13 14:39:31 witoldp Exp $
6 #ifndef POOL_ISTORAGESVC_H
7 #define POOL_ISTORAGESVC_H
8 
9 // Framework include files
10 #include "StorageSvc/DbStatus.h"
11 #include "StorageSvc/Transaction.h"
12 
13 // STL include files
14 #include <string>
15 
16 // Forward declarations
17 
18 class Guid;
19 class Token;
20 
21 /*
22  * pool namespace declaration
23  */
24 namespace pool {
25 
26  // Forward declarations
27  class FileDescriptor;
28  typedef class Session *SessionH;
29  typedef class DatabaseConnection *ConnectionH;
30  typedef const class Shape *ShapeH;
31 
56  class IStorageSvc {
57  protected:
59  virtual ~IStorageSvc() { }
60 
61  public:
63  static const Guid& interfaceID();
64 
66  static const char* category() { return "pool_IStorageSvc"; }
67 
69  virtual DbStatus queryInterface(const Guid& riid, void** ppvUnkn) = 0;
70 
72  virtual unsigned int addRef() = 0;
73 
75  virtual unsigned int release() = 0;
76 
78 
83  virtual std::string getContName(FileDescriptor& refDB,
84  Token& pToken) = 0;
85 
87 
98  virtual DbStatus allocate( FileDescriptor& refDB,
99  const std::string& refCont,
100  int technology,
101  const void* object,
102  ShapeH shapeH,
103  Token*& refpTok) = 0;
104 
105 
107 
115  virtual DbStatus read( const FileDescriptor& refDB,
116  const Token& pToken,
117  ShapeH shapeH,
118  void** object) = 0;
119 
121 
130  virtual DbStatus update( FileDescriptor& refDB,
131  const void* object,
132  ShapeH shapeH,
133  Token& refToken) = 0;
134 
136 
143  virtual DbStatus destroy( FileDescriptor& refDB,
144  Token& refToken) = 0;
145 
147 
160  const Guid& objType,
161  ShapeH& shapeH) = 0;
162 
164 
175  virtual DbStatus createShape( const FileDescriptor& refDB,
176  const std::string& cntName,
177  const Guid& shapeID,
178  ShapeH& shapeH) = 0;
179 
181 
199  int tech,
200  SessionH& session) = 0;
201 
203 
215  virtual DbStatus endSession( const SessionH session) = 0;
216 
218 
229  virtual DbStatus existsConnection(const SessionH sessionH,
230  int mode,
231  const FileDescriptor& refDB) = 0;
232 
234 
249  virtual DbStatus connect( const SessionH sessionH,
250  int mode,
251  FileDescriptor& refDB) = 0;
252 
254 
265  int mode ) = 0;
266 
268 
281  virtual DbStatus disconnect( FileDescriptor& refDB) = 0;
282 
284 
292  int& mode ) = 0;
293 
295 
311 
313  enum : unsigned {
342  };
343  };
344 
345  // Factory function
346  IStorageSvc* createStorageSvc(const std::string& componentName);
347 
348 } // End namespace pool
349 #endif // POOL_ISTORAGESVC_H
pool::IStorageSvc::update
virtual DbStatus update(FileDescriptor &refDB, const void *object, ShapeH shapeH, Token &refToken)=0
In place update of an existing object.
pool::IStorageSvc::CONNECTION_NOT_EXISTING
@ CONNECTION_NOT_EXISTING
Database does not exist.
Definition: IStorageSvc.h:333
pool::IStorageSvc::destroy
virtual DbStatus destroy(FileDescriptor &refDB, Token &refToken)=0
Destroy an existing persistent object.
pool::IStorageSvc::createShape
virtual DbStatus createShape(const FileDescriptor &refDB, const std::string &cntName, const Guid &shapeID, ShapeH &shapeH)=0
Create a persistent shape a given Database container.
pool::ConnectionH
class DatabaseConnection * ConnectionH
Definition: FileDescriptor.h:28
pool::IStorageSvc::ISTORAGESVC_ERROR
@ ISTORAGESVC_ERROR
Error tag.
Definition: IStorageSvc.h:315
checkCorrelInHIST.conn
conn
Definition: checkCorrelInHIST.py:25
pool::DbStatus
Definition: DbStatus.h:67
pool::createStorageSvc
IStorageSvc * createStorageSvc(const std::string &componentName)
Transaction.h
pool::IStorageSvc::INVALID_SESSION_TOKEN
@ INVALID_SESSION_TOKEN
Invalid Database session token.
Definition: IStorageSvc.h:317
pool::IStorageSvc::INVALID_OBJECT
@ INVALID_OBJECT
Object pointer is invalid.
Definition: IStorageSvc.h:327
pool::IStorageSvc::ISTORAGESVC_LAST
@ ISTORAGESVC_LAST
Terminator.
Definition: IStorageSvc.h:335
pool::IStorageSvc::TRANSACTION_FAILED
@ TRANSACTION_FAILED
The Transaction failed.
Definition: IStorageSvc.h:325
pool::IStorageSvc::existsConnection
virtual DbStatus existsConnection(const SessionH sessionH, int mode, const FileDescriptor &refDB)=0
Check the existence of a logical Database unit.
pool::DbStatus::Info
@ Info
Definition: DbStatus.h:74
pool
pool namespace
Definition: libname.h:15
pool::IStorageSvc::openMode
virtual DbStatus openMode(FileDescriptor &refDB, int &mode)=0
Query the access mode of a Database unit.
pool::IStorageSvc::interfaceID
static const Guid & interfaceID()
Retrieve interface ID.
pool::SessionH
class Session * SessionH
Definition: IStorageExplorer.h:35
pool::IStorageSvc::disconnect
virtual DbStatus disconnect(FileDescriptor &refDB)=0
Disconnect from a logical Database unit.
pool::FileDescriptor
Definition: FileDescriptor.h:41
python.oracle.Session
Session
Definition: oracle.py:78
pool::IStorageSvc::IS_PERSISTENT_SHAPE
@ IS_PERSISTENT_SHAPE
Requested shape the persistent shape.
Definition: IStorageSvc.h:341
pool::IStorageSvc::INVALID_OBJ_TOKEN
@ INVALID_OBJ_TOKEN
Invalid object address.
Definition: IStorageSvc.h:329
Token
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition: Token.h:21
pool::IStorageSvc::~IStorageSvc
virtual ~IStorageSvc()
Destructor (called only by sub-classes)
Definition: IStorageSvc.h:59
pool::ShapeH
const class Shape * ShapeH
Definition: DbContainerObj.h:27
pool::IStorageSvc::getShape
virtual DbStatus getShape(FileDescriptor &refDB, const Guid &objType, ShapeH &shapeH)=0
Retrieve persistent shape from Storage manager.
pool::IStorageSvc::connect
virtual DbStatus connect(const SessionH sessionH, int mode, FileDescriptor &refDB)=0
Connect to a logical Database unit.
pool::IStorageSvc::read
virtual DbStatus read(const FileDescriptor &refDB, const Token &pToken, ShapeH shapeH, void **object)=0
Read a persistent object from the medium.
pool::IStorageSvc::reconnect
virtual DbStatus reconnect(FileDescriptor &refDB, int mode)=0
Reconnect to a logical Database unit with different access mode.
pool::IStorageSvc::INVALID_TRANSACTION_TOKEN
@ INVALID_TRANSACTION_TOKEN
Invalid Database Transaction token.
Definition: IStorageSvc.h:321
Preparation.mode
mode
Definition: Preparation.py:94
pool::IStorageSvc::endTransaction
virtual DbStatus endTransaction(ConnectionH conn, Transaction::Action typ)=0
End/Finish an existing Transaction sequence.
pool::IStorageSvc::queryInterface
virtual DbStatus queryInterface(const Guid &riid, void **ppvUnkn)=0
IInterface implementation: Query interfaces of Interface.
pool::IStorageSvc::INVALID_CONNECTION_TOKEN
@ INVALID_CONNECTION_TOKEN
Invalid Database connection token.
Definition: IStorageSvc.h:319
pool::IStorageSvc
Definition: IStorageSvc.h:56
pool::IStorageSvc::INVALID_AUTHENTICATION
@ INVALID_AUTHENTICATION
Invalid Database authentication.
Definition: IStorageSvc.h:323
pool::IStorageSvc::release
virtual unsigned int release()=0
IInterface implementation: Release Interface instance
pool::Transaction::Action
Action
Definition: Transaction.h:34
pool::IStorageSvc::getContName
virtual std::string getContName(FileDescriptor &refDB, Token &pToken)=0
Get container name for object.
pool::IStorageSvc::startSession
virtual DbStatus startSession(int mode, int tech, SessionH &session)=0
Start a new Database Session.
pool::IStorageSvc::OBJ_NOT_LOADED
@ OBJ_NOT_LOADED
Sorry, the requested object is not loaded.
Definition: IStorageSvc.h:331
Guid
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
Definition: Guid.h:20
pool::IStorageSvc::endSession
virtual DbStatus endSession(const SessionH session)=0
End the Database session.
pool::IStorageSvc::ISTORAGESVC_INFO
@ ISTORAGESVC_INFO
Info tag.
Definition: IStorageSvc.h:337
pool::IStorageSvc::allocate
virtual DbStatus allocate(FileDescriptor &refDB, const std::string &refCont, int technology, const void *object, ShapeH shapeH, Token *&refpTok)=0
Register object for write.
pool::DbStatus::Error
@ Error
Definition: DbStatus.h:76
DbStatus.h
pool::IStorageSvc::addRef
virtual unsigned int addRef()=0
IInterface implementation: Reference Interface instance
pool::IStorageSvc::category
static const char * category()
Retrieve category name.
Definition: IStorageSvc.h:66
pool::IStorageSvc::SHAPE_NOT_AVAILIBLE
@ SHAPE_NOT_AVAILIBLE
Requested shape is unfortunately not availible.
Definition: IStorageSvc.h:339