ATLAS Offline Software
Loading...
Searching...
No Matches
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
14class Guid;
15class Token;
16
17namespace pool {
18
19 // forward declarations
20 class Session;
21 class IStorageSvc;
22 class IStorageExplorer;
23 class IContainer;
24
25 namespace PersistencySvc {
26
33
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 Token* writeObject( const std::string& containerName,
80 long minorTechnology,
81 const void* object,
82 const RootType& type );
83
85 void* readObject( const Token& token, void* object = 0 );
86
88 bool attribute( const std::string& attributeName,
89 void* data,
90 const std::type_info& typeInfo,
91 const std::string& option );
92
94 bool setAttribute( const std::string& attributeName,
95 const void* data,
96 const std::type_info& typeInfo,
97 const std::string& option );
98
99 private:
105 Session* m_session;
112 };
113 }
114}
115
116#endif
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
TTypeAdapter RootType
Definition RootType.h:211
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
IContainer is the base class for container objects.
Definition IContainer.h:23
The IStorageExplorer interface is able to handle user request for.
The IStorageSvc interface is able to handle user request for.
Definition IStorageSvc.h:56
bool commitTransaction()
Commits the transaction.
~DatabaseHandler()
Destructor. Disconnects from the database.
bool commitAndHoldTransaction()
Commits and holds the transaction.
void * readObject(const Token &token, void *object=0)
Reads an object given a token.
bool setAttribute(const std::string &attributeName, const void *data, const std::type_info &typeInfo, const std::string &option)
Sets an attrtibute.
Session * m_session
Pointer to the session for this database.
long technology() const
Returns the technology identifier.
IStorageExplorer & m_storageExplorer
IStorageExplorer reference.
FileDescriptor m_fileDescriptor
File descriptor for this database.
long m_technology
Technology identifier.
DatabaseHandler(IStorageSvc &storageSvc, IStorageExplorer &storageExplorer, Session *session, long technology, const std::string &fid, const std::string &pfn, long accessmode)
Constructor. Connects to the database.
IContainer * container(const std::string &containerName)
Returns a container handle.
Token * writeObject(const std::string &containerName, long minorTechnology, const void *object, const RootType &type)
Writes an object and returns a token.
bool disconnectTransaction()
Disconnects the transaction.
bool attribute(const std::string &attributeName, void *data, const std::type_info &typeInfo, const std::string &option)
Returns an attribute.
long accessMode() const
Returns the access mode.
std::vector< std::string > containers()
Gives the list of containers.
const std::string & fid() const
Returns the file identifier.
const std::string & pfn() const
Returns the physical file name.
void rollBackTransaction()
Rolls back the transaction.
IStorageSvc & m_storageSvc
IStorageSvc reference.
long m_accessMode
Current access mode.
pool namespace
Definition libname.h:15