ATLAS Offline Software
Loading...
Searching...
No Matches
UserDatabase.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 INCLUDE_PERSISTENCYSVC_USERDATABASE_H
6#define INCLUDE_PERSISTENCYSVC_USERDATABASE_H
7
11#include "StorageSvc/DbPrint.h"
12
13namespace pool {
14 // forward declarations
16 class IFileCatalog;
17
18 // forward declarations
19 class UserSession;
20 class DatabaseHandler;
21 class DatabaseRegistry;
22
28 class UserDatabase : virtual public IDatabase,
29 virtual public ITechnologySpecificAttributes,
30 public APRMessaging
31 {
32 public:
35 const std::string& name,
36 const DatabaseSpecification::NameType nameType );
37
39 virtual ~UserDatabase();
40
43
45 virtual void connectForRead() override;
46
48 virtual void connectForWrite() override;
49
51 virtual void disconnect() override;
52
54 virtual IDatabase::OpenMode openMode() const override;
55
57 virtual const std::string& fid() override;
58
60 virtual const std::string& pfn() override;
61
66 virtual bool setTechnology( long technology ) override;
67
69 virtual long technology() const override;
70
72 virtual std::vector< std::string > containers() override;
73
75 virtual IContainer* containerHandle( const std::string& name ) override;
76
80
81 protected:
82 virtual
83 bool attributeOfType( const std::string& attributeName,
84 void* data,
85 const std::type_info& typeInfo,
86 const std::string& option ) override;
87
88 virtual
89 bool setAttributeOfType( const std::string& attributeName,
90 const void* data,
91 const std::type_info& typeInfo,
92 const std::string& option ) override;
93 private:
105 std::string m_name;
119 std::string m_the_fid;
120 std::string m_the_pfn;
121
124
126 void setTechnologyIdentifier( const std::string& sTechnology );
127 };
128}
129
130#endif
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
APRMessaging(const std::string &name)
DatabaseConnectionPolicy is a class holding information on the policy to be followed whenever a datab...
DatabaseHandler is a class taking care of the micro-connections and the micro transactions for a give...
IContainer is the base class for container objects.
Definition IContainer.h:23
IDatabase is the base class for database objects.
Definition IDatabase.h:36
OpenMode
Current open mode enumeration.
Definition IDatabase.h:39
ITechnologySpecificAttributes is the interface for an object holding technology-specific attributes.
Type
Transaction type enumeration.
virtual void connectForRead() override
Connects explicitly to the database for read operations.
virtual ITechnologySpecificAttributes & technologySpecificAttributes() override
UserDatabase(UserSession &session, const std::string &name, const DatabaseSpecification::NameType nameType)
Constructor.
std::string m_the_fid
Other names used.
const DatabaseConnectionPolicy & m_policy
Reference to the policy.
virtual const std::string & pfn() override
Returns the physical file name of this database.
std::string m_the_pfn
void setTechnologyIdentifier(const std::string &sTechnology)
Converts a technology string to the technology (long) identifier.
std::string m_name
The database name.
virtual IDatabase::OpenMode openMode() const override
Returns the opening mode. It can be used to check whether the database is connected.
virtual bool setAttributeOfType(const std::string &attributeName, const void *data, const std::type_info &typeInfo, const std::string &option) override
The actual method setting the attribute data given a name.
DatabaseRegistry & m_registry
Reference to the database registry.
bool m_alreadyConnected
Flag indicating whether a connection has been already made once.
virtual void connectForWrite() override
Connects explicitly to the database for write/update operations.
bool checkInRegistry()
Checks in the registry if the database handler already exists.
IDatabase::OpenMode m_openMode
Current open mode.
IFileCatalog & m_catalog
Reference to the file catalog.
UserSession & m_session
Reference to the session.
DatabaseSpecification::NameType m_nameType
The database name spacification.
virtual IContainer * containerHandle(const std::string &name) override
Returns a pointer to a container object. The user acquires ownership of that object.
virtual std::vector< std::string > containers() override
Returns the names of the containers in this database.
virtual long technology() const override
Returns the technology identifier for this database.
long m_technology
The technology identifier of the database.
virtual bool setTechnology(long technology) override
Sets the technology identifier for this database.
virtual bool attributeOfType(const std::string &attributeName, void *data, const std::type_info &typeInfo, const std::string &option) override
The actual method returning the attribute data given a name.
virtual const std::string & fid() override
Returns the file identifier of this database.
virtual const ITechnologySpecificAttributes & technologySpecificAttributes() const override
Returns the object holding the technology specific attributes.
ITransaction::Type m_transactionType
Transaction type (read/update).
virtual void disconnect() override
Disconnects from the database.
bool m_technologySet
Checks if the technology identifier has been set.
DatabaseHandler & databaseHandler()
Returns the database handler.
virtual ~UserDatabase()
Destructor.
DatabaseHandler * m_databaseHandler
The underlying database handler.
UserSession is an implementation of the ISession interface.
Definition UserSession.h:29
Framework include files.
Definition libname.h:15
NameType
Enumeration type specifying the database name field, wherever the latter is used in methods accessing...
Definition IDatabase.h:23