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

Container is an implementation of the IContainer interface. More...

#include <Container.h>

Inheritance diagram for pool::PersistencySvc::Container:
Collaboration diagram for pool::PersistencySvc::Container:

Public Member Functions

 Container (FileDescriptor &fileDescriptor, long technology, const std::string &name)
virtual ~Container ()=default
 destructor
virtual const std::string & name () const override final
 Returns the name of this container.
virtual long technology () const override final
 Returns the technology identifier for this container.
virtual ITokenIteratortokens () override
 Starts an iteration over the tokens in the container.
virtual const ITechnologySpecificAttributestechnologySpecificAttributes () const override final
 Returns the object holding the technology specific attributes for a given technology domain.
virtual ITechnologySpecificAttributestechnologySpecificAttributes () override final
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

std::string m_name
 The name of the container.
FileDescriptorm_fileDescriptor
 Reference to file descriptor of the parent database.
long m_technology
 The technology identifier.

Detailed Description

Container is an implementation of the IContainer interface.

Definition at line 25 of file Container.h.

Constructor & Destructor Documentation

◆ Container()

pool::PersistencySvc::Container::Container ( FileDescriptor & fileDescriptor,
long technology,
const std::string & name )

◆ ~Container()

virtual pool::PersistencySvc::Container::~Container ( )
virtualdefault

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

◆ name()

virtual const std::string & pool::PersistencySvc::Container::name ( ) const
inlinefinaloverridevirtual

Returns the name of this container.

Implements pool::IContainer.

Definition at line 36 of file Container.h.

36{ return m_name; }
std::string m_name
The name of the container.
Definition Container.h:67

◆ 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::Container::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()

virtual long pool::PersistencySvc::Container::technology ( ) const
inlinefinaloverridevirtual

Returns the technology identifier for this container.

Implements pool::IContainer.

Definition at line 39 of file Container.h.

39{ return m_technology; }
long m_technology
The technology identifier.
Definition Container.h:73

◆ technologySpecificAttributes() [1/2]

virtual const ITechnologySpecificAttributes & pool::PersistencySvc::Container::technologySpecificAttributes ( ) const
inlinefinaloverridevirtual

Returns the object holding the technology specific attributes for a given technology domain.

Implements pool::IContainer.

Definition at line 47 of file Container.h.

47{ return *this; }

◆ technologySpecificAttributes() [2/2]

virtual ITechnologySpecificAttributes & pool::PersistencySvc::Container::technologySpecificAttributes ( )
inlinefinaloverridevirtual

Implements pool::IContainer.

Definition at line 48 of file Container.h.

48{ return *this; }

◆ tokens()

virtual ITokenIterator * pool::PersistencySvc::Container::tokens ( )
overridevirtual

Starts an iteration over the tokens in the container.

Returns a token iterator whose ownership is passed to the user.

Implements pool::IContainer.

Member Data Documentation

◆ m_fileDescriptor

FileDescriptor& pool::PersistencySvc::Container::m_fileDescriptor
private

Reference to file descriptor of the parent database.

Definition at line 70 of file Container.h.

◆ m_name

std::string pool::PersistencySvc::Container::m_name
private

The name of the container.

Definition at line 67 of file Container.h.

◆ m_technology

long pool::PersistencySvc::Container::m_technology
private

The technology identifier.

Definition at line 73 of file Container.h.


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