ATLAS Offline Software
Loading...
Searching...
No Matches
pool::ITechnologySpecificAttributes Class Referenceabstract

ITechnologySpecificAttributes is the interface for an object holding technology-specific attributes. More...

#include <PersistencySvc/ITechnologySpecificAttributes.h>

Inheritance diagram for pool::ITechnologySpecificAttributes:
Collaboration diagram for pool::ITechnologySpecificAttributes:

Public Member Functions

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 ~ITechnologySpecificAttributes ()
 Default destructor.
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.
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.

Detailed Description

ITechnologySpecificAttributes is the interface for an object holding technology-specific attributes.

Definition at line 22 of file ITechnologySpecificAttributes.h.

Constructor & Destructor Documentation

◆ ~ITechnologySpecificAttributes()

virtual pool::ITechnologySpecificAttributes::~ITechnologySpecificAttributes ( )
inlineprotectedvirtual

Default destructor.

Definition at line 52 of file ITechnologySpecificAttributes.h.

52{}

Member Function Documentation

◆ attribute()

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

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::ITechnologySpecificAttributes::attributeOfType ( const std::string & attributeName,
void * data,
const std::type_info & typeInfo,
const std::string & option )
protectedpure virtual

The actual method returning the attribute data given a name.

Implemented in pool::PersistencySvc::Container, pool::PersistencySvc::MicroSessionManager, and pool::PersistencySvc::UserDatabase.

◆ setAttribute()

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

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::ITechnologySpecificAttributes::setAttributeOfType ( const std::string & attributeName,
const void * data,
const std::type_info & typeInfo,
const std::string & option )
protectedpure virtual

The actual method setting the attribute data given a name.

Implemented in pool::PersistencySvc::Container, pool::PersistencySvc::MicroSessionManager, and pool::PersistencySvc::UserDatabase.


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