ATLAS Offline Software
DatabaseHandler.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 #ifndef INCLUDE_PERSISTENCYSVC_DATABASEHANDLER_H
6 #define INCLUDE_PERSISTENCYSVC_DATABASEHANDLER_H
7 
10 #include <vector>
11 #include <set>
12 #include <utility>
13 
14 class Guid;
15 class Token;
16 
17 namespace pool {
18 
19  // forward declarations
20  class Session;
21  class IStorageSvc;
22  class IStorageExplorer;
23  class IContainer;
24 
25  namespace PersistencySvc {
26 
35  public:
38  IStorageExplorer& storageExplorer,
39  Session* session,
40  long technology,
41  const std::string& fid,
42  const std::string& pfn,
43  long accessmode );
44 
47 
50 
53 
56 
59 
61  std::vector< std::string > containers();
62 
64  IContainer* container( const std::string& containerName );
65 
67  const std::string& pfn() const;
68 
70  const std::string& fid() const;
71 
73  long technology() const;
74 
76  long accessMode() const;
77 
79  void reconnect( long accessMode );
80 
82  Token* writeObject( const std::string& containerName,
83  long minorTechnology,
84  const void* object,
85  const RootType& type );
86 
88  void* readObject( const Token& token, void* object = 0 );
89 
91  bool attribute( const std::string& attributeName,
92  void* data,
93  const std::type_info& typeInfo,
94  const std::string& option );
95 
97  bool setAttribute( const std::string& attributeName,
98  const void* data,
99  const std::type_info& typeInfo,
100  const std::string& option );
101 
102  private:
115  };
116  }
117 }
118 
119 #endif
pool::IContainer
Definition: IContainer.h:23
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
pool::PersistencySvc::DatabaseHandler
Definition: DatabaseHandler.h:34
pool::PersistencySvc::DatabaseHandler::m_storageSvc
IStorageSvc & m_storageSvc
IStorageSvc reference.
Definition: DatabaseHandler.h:104
pool::PersistencySvc::DatabaseHandler::m_fileDescriptor
FileDescriptor m_fileDescriptor
File descriptor for this database.
Definition: DatabaseHandler.h:110
pool::PersistencySvc::DatabaseHandler::container
IContainer * container(const std::string &containerName)
Returns a container handle.
pool
pool namespace
Definition: libname.h:15
pool::FileDescriptor
Definition: FileDescriptor.h:41
pool::IStorageExplorer
Definition: IStorageExplorer.h:53
pool::PersistencySvc::DatabaseHandler::rollBackTransaction
void rollBackTransaction()
Rolls back the transaction.
pool::PersistencySvc::DatabaseHandler::disconnectTransaction
bool disconnectTransaction()
Disconnects the transaction.
pool::PersistencySvc::DatabaseHandler::m_storageExplorer
IStorageExplorer & m_storageExplorer
IStorageExplorer reference.
Definition: DatabaseHandler.h:106
python.oracle.Session
Session
Definition: oracle.py:78
pool::PersistencySvc::DatabaseHandler::m_technology
long m_technology
Technology identifier.
Definition: DatabaseHandler.h:112
pool::PersistencySvc::DatabaseHandler::attribute
bool attribute(const std::string &attributeName, void *data, const std::type_info &typeInfo, const std::string &option)
Returns an attribute.
FileDescriptor.h
DbDatabase.h
Token
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition: Token.h:21
pool::PersistencySvc::DatabaseHandler::containers
std::vector< std::string > containers()
Gives the list of containers.
pool::PersistencySvc::DatabaseHandler::m_session
Session * m_session
Pointer to the session for this database.
Definition: DatabaseHandler.h:108
pool::PersistencySvc::DatabaseHandler::setAttribute
bool setAttribute(const std::string &attributeName, const void *data, const std::type_info &typeInfo, const std::string &option)
Sets an attrtibute.
pool::PersistencySvc::DatabaseHandler::readObject
void * readObject(const Token &token, void *object=0)
Reads an object given a token.
pool::PersistencySvc::DatabaseHandler::m_accessMode
long m_accessMode
Current access mode.
Definition: DatabaseHandler.h:114
pool::PersistencySvc::DatabaseHandler::commitTransaction
bool commitTransaction()
Commits the transaction.
pool::PersistencySvc::DatabaseHandler::technology
long technology() const
Returns the technology identifier.
pool::PersistencySvc::DatabaseHandler::commitAndHoldTransaction
bool commitAndHoldTransaction()
Commits and holds the transaction.
pool::IStorageSvc
Definition: IStorageSvc.h:56
pool::PersistencySvc::DatabaseHandler::DatabaseHandler
DatabaseHandler(IStorageSvc &storageSvc, IStorageExplorer &storageExplorer, Session *session, long technology, const std::string &fid, const std::string &pfn, long accessmode)
Constructor. Connects to the database.
pool::PersistencySvc::DatabaseHandler::accessMode
long accessMode() const
Returns the access mode.
pool::PersistencySvc::DatabaseHandler::pfn
const std::string & pfn() const
Returns the physical file name.
pool::PersistencySvc::DatabaseHandler::~DatabaseHandler
~DatabaseHandler()
Destructor. Disconnects from the database.
Guid
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
Definition: Guid.h:20
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
pool::PersistencySvc::DatabaseHandler::fid
const std::string & fid() const
Returns the file identifier.
pool::PersistencySvc::DatabaseHandler::writeObject
Token * writeObject(const std::string &containerName, long minorTechnology, const void *object, const RootType &type)
Writes an object and returns a token.
pool::PersistencySvc::DatabaseHandler::reconnect
void reconnect(long accessMode)
Reconnects with a new access mode.
TScopeAdapter
Definition: RootType.h:119