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 IContainer;
23
24 namespace PersistencySvc {
25
32
34 public:
37 Session* session,
38 long technology,
39 const std::string& fid,
40 const std::string& pfn,
41 long accessmode );
42
45
48
51
54
56 std::vector< std::string > containers();
57
59 IContainer* container( const std::string& containerName );
60
62 const std::string& pfn() const;
63
65 const std::string& fid() const;
66
68 long technology() const;
69
71 long accessMode() const;
72
74 Token* writeObject( const std::string& containerName,
75 long minorTechnology,
76 const void* object,
77 const RootType& type );
78
80 void* readObject( const Token& token, void* object = 0 );
81
83 bool attribute( const std::string& attributeName,
84 void* data,
85 const std::type_info& typeInfo,
86 const std::string& option );
87
89 bool setAttribute( const std::string& attributeName,
90 const void* data,
91 const std::type_info& typeInfo,
92 const std::string& option );
93
94 private:
98 Session* m_session;
105 };
106 }
107}
108
109#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 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.
FileDescriptor m_fileDescriptor
File descriptor for this database.
long m_technology
Technology identifier.
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.
DatabaseHandler(IStorageSvc &storageSvc, Session *session, long technology, const std::string &fid, const std::string &pfn, long accessmode)
Constructor. Connects to the database.
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.
IStorageSvc & m_storageSvc
IStorageSvc reference.
long m_accessMode
Current access mode.
pool namespace
Definition libname.h:15