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
19 namespace PersistencySvc {
20 // forward declarations
21 class UserSession;
22 class DatabaseHandler;
23 class DatabaseRegistry;
24
30 class UserDatabase : virtual public IDatabase,
31 virtual public ITechnologySpecificAttributes,
32 public APRMessaging
33 {
34 public:
37 const std::string& name,
38 const DatabaseSpecification::NameType nameType );
39
41 virtual ~UserDatabase();
42
45
47 virtual void connectForRead() override;
48
50 virtual void connectForWrite() override;
51
53 virtual void disconnect() override;
54
56 virtual IDatabase::OpenMode openMode() const override;
57
59 virtual const std::string& fid() override;
60
62 virtual const std::string& pfn() override;
63
68 virtual bool setTechnology( long technology ) override;
69
71 virtual long technology() const override;
72
74 virtual std::vector< std::string > containers() override;
75
77 virtual IContainer* containerHandle( const std::string& name ) override;
78
82
83 protected:
84 virtual
85 bool attributeOfType( const std::string& attributeName,
86 void* data,
87 const std::type_info& typeInfo,
88 const std::string& option ) override;
89
90 virtual
91 bool setAttributeOfType( const std::string& attributeName,
92 const void* data,
93 const std::type_info& typeInfo,
94 const std::string& option ) override;
95 private:
107 std::string m_name;
121 std::string m_the_fid;
122 std::string m_the_pfn;
123
126
128 void setTechnologyIdentifier( const std::string& sTechnology );
129 };
130 }
131}
132
133#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...
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.
DatabaseHandler is a class taking care of the micro-connections and the micro transactions for a give...
void setTechnologyIdentifier(const std::string &sTechnology)
Converts a technology string to the technology (long) identifier.
virtual void connectForRead() override
Connects explicitly to the database for read operations.
virtual const ITechnologySpecificAttributes & technologySpecificAttributes() const override
Returns the object holding the technology specific attributes.
virtual ITechnologySpecificAttributes & technologySpecificAttributes() override
virtual bool setTechnology(long technology) override
Sets the technology identifier for this database.
virtual std::vector< std::string > containers() override
Returns the names of the containers in this database.
virtual const std::string & fid() override
Returns the file identifier of this database.
IDatabase::OpenMode m_openMode
Current open mode.
bool m_technologySet
Checks if the technology identifier has been set.
virtual void connectForWrite() override
Connects explicitly to the database for write/update operations.
std::string m_the_fid
Other names used.
DatabaseHandler & databaseHandler()
Returns the database handler.
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.
std::string m_name
The database name.
virtual void disconnect() override
Disconnects from the database.
virtual const std::string & pfn() override
Returns the physical file name of this database.
DatabaseSpecification::NameType m_nameType
The database name spacification.
DatabaseRegistry & m_registry
Reference to the database registry.
UserDatabase(UserSession &session, const std::string &name, const DatabaseSpecification::NameType nameType)
Constructor.
bool m_alreadyConnected
Flag indicating whether a connection has been already made once.
ITransaction::Type m_transactionType
Transaction type (read/update)
virtual long technology() const override
Returns the technology identifier for this database.
const DatabaseConnectionPolicy & m_policy
Reference to the policy.
bool checkInRegistry()
Checks in the registry if the database handler already exists.
IFileCatalog & m_catalog
Reference to the file catalog.
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.
DatabaseHandler * m_databaseHandler
The underlying database handler.
virtual ~UserDatabase()
Destructor.
virtual IContainer * containerHandle(const std::string &name) override
Returns a pointer to a container object. The user acquires ownership of that object.
long m_technology
The technology identifier of the database.
UserSession & m_session
Reference to the session.
virtual IDatabase::OpenMode openMode() const override
Returns the opening mode. It can be used to check whether the database is connected.
UserSession is an implementation of the ISession interface.
Definition UserSession.h:31
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