ATLAS Offline Software
Loading...
Searching...
No Matches
DatabaseHandler.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef POOLSVC_DATABASEHANDLER_H
6#define POOLSVC_DATABASEHANDLER_H
7
8#include "GaudiKernel/IFileMgr.h"
11
12#include <vector>
13#include <set>
14#include <utility>
15
16class IStorageSvc;
17class Guid;
18class Token;
19class Container;
20
27
28class DatabaseHandler final {
29public:
31 DatabaseHandler( IStorageSvc& storageSvc,
32 long technology,
33 const std::string& fid,
34 const std::string& pfn,
35 Io::IoFlag accessmode );
36
39
41 bool commitTransaction();
42
45
48
50 std::vector< std::string > containers();
51
53 Container* container( const std::string& containerName );
54
56 const std::string& pfn() const;
57
59 const std::string& fid() const;
60
62 long technology() const;
63
65 Io::IoFlag accessMode() const;
66
67 // expose FileDescriptor object for the technology specific DB implementation
69
71 Token* writeObject( const std::string& containerName,
72 long minorTechnology,
73 const void* object,
74 const RootType& type );
75
77 void* readObject( const Token& token, void* object = 0 );
78
80 bool attribute( const std::string& attributeName,
81 void* data,
82 const std::type_info& typeInfo,
83 const std::string& option );
84
86 bool setAttribute( const std::string& attributeName,
87 const void* data,
88 const std::type_info& typeInfo,
89 const std::string& option );
90
91private:
99 Io::IoFlag m_accessMode;
100};
101
102#endif
TTypeAdapter RootType
Definition RootType.h:211
bool commitTransaction()
Commits the transaction.
IStorageSvc & m_storageSvc
IStorageSvc reference.
FileDescriptor & fileDescriptor()
~DatabaseHandler()
Destructor. Disconnects from the database.
Token * writeObject(const std::string &containerName, long minorTechnology, const void *object, const RootType &type)
Writes an object and returns a token.
Container * container(const std::string &containerName)
Returns a container handle.
void * readObject(const Token &token, void *object=0)
Reads an object given a token.
FileDescriptor m_fileDescriptor
File descriptor for this database.
bool setAttribute(const std::string &attributeName, const void *data, const std::type_info &typeInfo, const std::string &option)
Sets an attrtibute.
long technology() const
Returns the technology identifier.
std::vector< std::string > containers()
Gives the list of containers.
long m_technology
Technology identifier.
bool disconnectTransaction()
Disconnects the transaction.
Io::IoFlag accessMode() const
Returns the access mode.
DatabaseHandler(IStorageSvc &storageSvc, long technology, const std::string &fid, const std::string &pfn, Io::IoFlag accessmode)
Constructor. Connects to the database.
Io::IoFlag m_accessMode
Current access mode.
bool attribute(const std::string &attributeName, void *data, const std::type_info &typeInfo, const std::string &option)
Returns an attribute.
bool commitAndHoldTransaction()
Commits and holds the transaction.
const std::string & fid() const
Returns the file identifier.
const std::string & pfn() const
Returns the physical file name.
Description:
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
Definition Guid.h:25
The IStorageSvc interface is able to handle user request for.
Definition IStorageSvc.h:39
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition Token.h:22