ATLAS Offline Software
Loading...
Searching...
No Matches
pool::PersistencySvc::MicroSessionManager Class Reference

MicroSessionManager is a class taking care of starting sessions for a given major technology and managing the individual database connections. More...

#include <MicroSessionManager.h>

Inheritance diagram for pool::PersistencySvc::MicroSessionManager:
Collaboration diagram for pool::PersistencySvc::MicroSessionManager:

Public Member Functions

 MicroSessionManager (DatabaseRegistry &registry, ITransaction &transaction, long technology)
 Constructor.
virtual ~MicroSessionManager ()
 Destructor.
DatabaseHandlerconnect (const std::string &fid, const std::string &pfn, long accessMode)
 Connects to a database.
void disconnect (DatabaseHandler *database)
 Disconnects from a database.
bool disconnectAll ()
 Disconnects from all the databases.
long technology () const
 Returns the technology.
std::string fidForPfn (const std::string &pfn)
 Fetches the FID by trying to temporatily connect to a database.
template<class T>
attribute (const std::string &attributeName, const std::string &option="")
 Templated method to retrieve an attribute.
template<class T>
bool setAttribute (const std::string &attributeName, const T &atttibuteValue, const std::string &option="")
 Templated method to set an attribute.

Protected Member Functions

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 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.

Private Attributes

DatabaseRegistrym_registry
ITransactionm_transaction
IStorageSvcm_storageSvc
IStorageExplorerm_storageExplorer
Session * m_session
long m_technology
std::set< DatabaseHandler * > m_databaseHandlers

Detailed Description

MicroSessionManager is a class taking care of starting sessions for a given major technology and managing the individual database connections.

Definition at line 35 of file MicroSessionManager.h.

Constructor & Destructor Documentation

◆ MicroSessionManager()

pool::PersistencySvc::MicroSessionManager::MicroSessionManager ( DatabaseRegistry & registry,
ITransaction & transaction,
long technology )

Constructor.

◆ ~MicroSessionManager()

virtual pool::PersistencySvc::MicroSessionManager::~MicroSessionManager ( )
virtual

Destructor.

Member Function Documentation

◆ attribute()

template<class T>
T pool::ITechnologySpecificAttributes::attribute ( const std::string & attributeName,
const std::string & option = "" )
inlineinherited

Templated method to retrieve an attribute.

Definition at line 25 of file ITechnologySpecificAttributes.h.

26 {
27 T data;
28 const std::type_info& typeInfo = typeid(T);
29 if ( ! this->attributeOfType( attributeName,
30 static_cast< void* >( &data ),
31 typeInfo,
32 option ) ) {
33 std::ostringstream error;
34 error << "Failed to retrieve attribute " << attributeName << " of type " << typeInfo.name();
35 throw std::runtime_error( error.str() + " (APR: \" ITechnologySpecificAttributes \" from \" PersistencySvc \")");
36 }
37 return data;
38 }
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
virtual bool attributeOfType(const std::string &attributeName, void *data, const std::type_info &typeInfo, const std::string &option)=0
The actual method returning the attribute data given a name.
unsigned long long T

◆ attributeOfType()

virtual bool pool::PersistencySvc::MicroSessionManager::attributeOfType ( const std::string & attributeName,
void * data,
const std::type_info & typeInfo,
const std::string & option )
overrideprotectedvirtual

The actual method returning the attribute data given a name.

Implements pool::ITechnologySpecificAttributes.

◆ connect()

DatabaseHandler * pool::PersistencySvc::MicroSessionManager::connect ( const std::string & fid,
const std::string & pfn,
long accessMode )

Connects to a database.

◆ disconnect()

void pool::PersistencySvc::MicroSessionManager::disconnect ( DatabaseHandler * database)

Disconnects from a database.

◆ disconnectAll()

bool pool::PersistencySvc::MicroSessionManager::disconnectAll ( )

Disconnects from all the databases.

◆ fidForPfn()

std::string pool::PersistencySvc::MicroSessionManager::fidForPfn ( const std::string & pfn)

Fetches the FID by trying to temporatily connect to a database.

◆ setAttribute()

template<class T>
bool pool::ITechnologySpecificAttributes::setAttribute ( const std::string & attributeName,
const T & atttibuteValue,
const std::string & option = "" )
inlineinherited

Templated method to set an attribute.

Definition at line 41 of file ITechnologySpecificAttributes.h.

43 {
44 return this->setAttributeOfType( attributeName,
45 static_cast< const void* >( &atttibuteValue ),
46 typeid(T),
47 option );
48 }
virtual bool setAttributeOfType(const std::string &attributeName, const void *data, const std::type_info &typeInfo, const std::string &option)=0
The actual method setting the attribute data given a name.

◆ setAttributeOfType()

virtual bool pool::PersistencySvc::MicroSessionManager::setAttributeOfType ( const std::string & attributeName,
const void * data,
const std::type_info & typeInfo,
const std::string & option )
overrideprotectedvirtual

The actual method setting the attribute data given a name.

Implements pool::ITechnologySpecificAttributes.

◆ technology()

long pool::PersistencySvc::MicroSessionManager::technology ( ) const

Returns the technology.

Member Data Documentation

◆ m_databaseHandlers

std::set<DatabaseHandler*> pool::PersistencySvc::MicroSessionManager::m_databaseHandlers
private

Definition at line 81 of file MicroSessionManager.h.

◆ m_registry

DatabaseRegistry& pool::PersistencySvc::MicroSessionManager::m_registry
private

Definition at line 75 of file MicroSessionManager.h.

◆ m_session

Session* pool::PersistencySvc::MicroSessionManager::m_session
private

Definition at line 79 of file MicroSessionManager.h.

◆ m_storageExplorer

IStorageExplorer* pool::PersistencySvc::MicroSessionManager::m_storageExplorer
private

Definition at line 78 of file MicroSessionManager.h.

◆ m_storageSvc

IStorageSvc* pool::PersistencySvc::MicroSessionManager::m_storageSvc
private

Definition at line 77 of file MicroSessionManager.h.

◆ m_technology

long pool::PersistencySvc::MicroSessionManager::m_technology
private

Definition at line 80 of file MicroSessionManager.h.

◆ m_transaction

ITransaction& pool::PersistencySvc::MicroSessionManager::m_transaction
private

Definition at line 76 of file MicroSessionManager.h.


The documentation for this class was generated from the following file: