ATLAS Offline Software
Loading...
Searching...
No Matches
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"
12
13// STL include files
14#include <string>
15
16// Forward declarations
17
18class Guid;
19class Token;
20
21/*
22 * pool namespace declaration
23 */
24namespace 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
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
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
134 const Guid& objType,
135 ShapeH& shapeH) = 0;
136
138
149 virtual DbStatus createShape( const FileDescriptor& refDB,
150 const std::string& cntName,
151 const Guid& shapeID,
152 ShapeH& shapeH) = 0;
153
155
172 virtual DbStatus startSession(int mode,
173 int tech,
174 SessionH& session) = 0;
175
177
189 virtual DbStatus endSession( const SessionH session) = 0;
190
192
203 virtual DbStatus existsConnection(const SessionH sessionH,
204 int mode,
205 const FileDescriptor& refDB) = 0;
206
208
223 virtual DbStatus connect( const SessionH sessionH,
224 int mode,
225 FileDescriptor& refDB) = 0;
226
228
241 virtual DbStatus disconnect( FileDescriptor& refDB) = 0;
242
244
251 int& mode ) = 0;
252
254
270
272 enum : unsigned {
301 };
302 };
303
304 // Factory function
305 IStorageSvc* createStorageSvc(const std::string& componentName);
306
307} // End namespace pool
308#endif // POOL_ISTORAGESVC_H
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
Definition Guid.h:25
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition Token.h:21
Definition of the DbConnection class.
This class is highly inspired by the error code distribution system as it is used in DEC/VMS or MS/WN...
Definition DbStatus.h:64
The IStorageSvc interface is able to handle user request for.
Definition IStorageSvc.h:56
virtual DbStatus existsConnection(const SessionH sessionH, int mode, const FileDescriptor &refDB)=0
Check the existence of a logical Database unit.
virtual std::string getContName(FileDescriptor &refDB, Token &pToken)=0
Get container name for object.
virtual DbStatus read(const FileDescriptor &refDB, const Token &pToken, ShapeH shapeH, void **object)=0
Read a persistent object from the medium.
virtual DbStatus endSession(const SessionH session)=0
End the Database session.
@ SHAPE_NOT_AVAILIBLE
Requested shape is unfortunately not availible.
@ INVALID_CONNECTION_TOKEN
Invalid Database connection token.
@ INVALID_OBJECT
Object pointer is invalid.
@ ISTORAGESVC_INFO
Info tag.
@ ISTORAGESVC_ERROR
Error tag.
@ IS_PERSISTENT_SHAPE
Requested shape the persistent shape.
@ INVALID_SESSION_TOKEN
Invalid Database session token.
@ INVALID_AUTHENTICATION
Invalid Database authentication.
@ ISTORAGESVC_LAST
Terminator.
@ INVALID_OBJ_TOKEN
Invalid object address.
@ INVALID_TRANSACTION_TOKEN
Invalid Database Transaction token.
@ CONNECTION_NOT_EXISTING
Database does not exist.
@ TRANSACTION_FAILED
The Transaction failed.
@ OBJ_NOT_LOADED
Sorry, the requested object is not loaded.
virtual DbStatus openMode(FileDescriptor &refDB, int &mode)=0
Query the access mode of a Database unit.
virtual DbStatus endTransaction(ConnectionH conn, Transaction::Action typ)=0
End/Finish an existing Transaction sequence.
virtual ~IStorageSvc()
Destructor (called only by sub-classes)
Definition IStorageSvc.h:59
virtual DbStatus allocate(FileDescriptor &refDB, const std::string &refCont, int technology, const void *object, ShapeH shapeH, Token *&refpTok)=0
Register object for write.
virtual DbStatus disconnect(FileDescriptor &refDB)=0
Disconnect from a logical Database unit.
static const Guid & interfaceID()
Retrieve interface ID.
virtual DbStatus startSession(int mode, int tech, SessionH &session)=0
Start a new Database Session.
virtual unsigned int addRef()=0
IInterface implementation: Reference Interface instance.
virtual DbStatus connect(const SessionH sessionH, int mode, FileDescriptor &refDB)=0
Connect to a logical Database unit.
virtual DbStatus queryInterface(const Guid &riid, void **ppvUnkn)=0
IInterface implementation: Query interfaces of Interface.
static const char * category()
Retrieve category name.
Definition IStorageSvc.h:66
virtual DbStatus getShape(FileDescriptor &refDB, const Guid &objType, ShapeH &shapeH)=0
Retrieve persistent shape from Storage manager.
virtual DbStatus createShape(const FileDescriptor &refDB, const std::string &cntName, const Guid &shapeID, ShapeH &shapeH)=0
Create a persistent shape a given Database container.
virtual unsigned int release()=0
IInterface implementation: Release Interface instance.
Description:
Definition Shape.h:35
pool namespace
Definition libname.h:15
class Session * SessionH
IStorageSvc * createStorageSvc(const std::string &componentName)
class DatabaseConnection * ConnectionH
const class Shape * ShapeH