ATLAS Offline Software
Loading...
Searching...
No Matches
UserDatabase.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_USERDATABASE_H
6#define INCLUDE_PERSISTENCYSVC_USERDATABASE_H
7
12#include "POOLCore/DbPrint.h"
13
14namespace pool {
15 // forward declarations
17 class IFileCatalog;
18 class ITransaction;
19
20
21 namespace PersistencySvc {
22 // forward declarations
24 class DatabaseHandler;
25 class DatabaseRegistry;
26
32 class UserDatabase : virtual public IDatabase,
33 virtual public ITechnologySpecificAttributes,
34 public APRMessaging
35 {
36 public:
38 UserDatabase( TechnologyDispatcher& technologyDispatcher,
39 const DatabaseConnectionPolicy& policy,
40 IFileCatalog& fileCatalog,
41 ITransaction& transaction,
42 DatabaseRegistry& registry,
43 const std::string& name,
45
47 virtual ~UserDatabase();
48
51
53 virtual void connectForRead() override;
54 virtual void connectForRead( const DatabaseConnectionPolicy& policy ) override;
55
57 virtual void connectForWrite() override;
58 virtual void connectForWrite( const DatabaseConnectionPolicy& policy ) override;
59
61 virtual void disconnect() override;
62
64 virtual IDatabase::OpenMode openMode() const override;
65
67 virtual const std::string& fid() override;
68
70 virtual const std::string& pfn() override;
71
76 virtual bool setTechnology( long technology ) override;
77
79 virtual long technology() const override;
80
82 virtual std::vector< std::string > containers() override;
83
85 virtual IContainer* containerHandle( const std::string& name ) override;
86
90
91 protected:
92 virtual
93 bool attributeOfType( const std::string& attributeName,
94 void* data,
95 const std::type_info& typeInfo,
96 const std::string& option ) override;
97
98 virtual
99 bool setAttributeOfType( const std::string& attributeName,
100 const void* data,
101 const std::type_info& typeInfo,
102 const std::string& option ) override;
103 private:
115 std::string m_name;
129 std::string m_the_fid;
130 std::string m_the_pfn;
131
134
136 void setTechnologyIdentifier( const std::string& sTechnology );
137 };
138 }
139}
140
141#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...
NameType
Enumeration type specifying the database name field, wherever the latter is used in methods accessing...
IContainer is the base class for container objects.
Definition IContainer.h:23
IDatabase is the base class for database objects.
Definition IDatabase.h:25
OpenMode
Current open mode enumeration.
Definition IDatabase.h:28
ITechnologySpecificAttributes is the interface for an object holding technology-specific attributes.
ITransaction is the interface class for user (macroscopic transactions) Every operation with the pool...
DatabaseHandler is a class taking care of the micro-connections and the micro transactions for a give...
TechnologyDispatcher is a class that delivers the appropriate MicroSessionManager given a technology.
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.
UserDatabase(TechnologyDispatcher &technologyDispatcher, const DatabaseConnectionPolicy &policy, IFileCatalog &fileCatalog, ITransaction &transaction, DatabaseRegistry &registry, const std::string &name, DatabaseSpecification::NameType nameType)
Constructor.
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.
ITransaction & m_transaction
Reference to the global transaction.
virtual void disconnect() override
Disconnects from the database.
virtual const std::string & pfn() override
Returns the physical file name of this database.
TechnologyDispatcher & m_technologyDispatcher
Reference to the technology dispatcher.
DatabaseSpecification::NameType m_nameType
The database name spacification.
DatabaseRegistry & m_registry
Reference to the database registry.
virtual void connectForRead(const DatabaseConnectionPolicy &policy) override
bool m_alreadyConnected
Flag indicating whether a connection has been already made once.
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.
virtual void connectForWrite(const DatabaseConnectionPolicy &policy) override
long m_technology
The technology identifier of the database.
virtual IDatabase::OpenMode openMode() const override
Returns the opening mode. It can be used to check whether the database is connected.
pool namespace
Definition libname.h:15