ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
TagAthenaAttributeList Class Reference

An AttributeList represents a logical row of attributes in a metadata table. The name and type of each attribute is given in an AttributeListSpecification. TagAthenaAttributeList is an AttributeList which is also a DataObject and thus can be saved in an Athena data store, e.g. the Event Store. More...

#include <TagAthenaAttributeList.h>

Inheritance diagram for TagAthenaAttributeList:
Collaboration diagram for TagAthenaAttributeList:

Public Member Functions

 TagAthenaAttributeList ()
 Construct empty attribute list with empty specification. More...
 
 TagAthenaAttributeList (const coral::AttributeList &rhs)
 Copy attribute lists. More...
 
 TagAthenaAttributeList (const TagAthenaAttributeList &rhs)
 
TagAthenaAttributeListoperator= (const TagAthenaAttributeList &rhs)
 Assignment. More...
 
 TagAthenaAttributeList (const coral::AttributeListSpecification &rhs)
 Construct attribute list according to the specification. More...
 
 TagAthenaAttributeList (const AthenaAttributeListSpecification &rhs)
 base on Spec with (name,type,info) tuple as well Otherwise it acts as coral version More...
 
 ~TagAthenaAttributeList ()
 
template<typename T >
void extend (const std::string &name)
 Extends the AttributeList by one attribute, given a specification. More...
 
void extend (const std::string &name, const std::string &typeName)
 
void extend (const std::string &name, const std::type_info &type)
 
void extend (const std::string &name, const AthenaAttributeType &type)
 
void print (std::ostream &os) const
 print to simulate function provided by old POOL AttributeList More...
 
bool hasDesc () const
 
const AthenaAttributeListSpecificationgetDesc () const
 
const coral::AttributeList & coralList () const
 

Private Attributes

AthenaAttributeListSpecificationm_desc
 The specification (empty if created with coral version) More...
 

Detailed Description

An AttributeList represents a logical row of attributes in a metadata table. The name and type of each attribute is given in an AttributeListSpecification. TagAthenaAttributeList is an AttributeList which is also a DataObject and thus can be saved in an Athena data store, e.g. the Event Store.

Definition at line 44 of file TagAthenaAttributeList.h.

Constructor & Destructor Documentation

◆ TagAthenaAttributeList() [1/5]

TagAthenaAttributeList::TagAthenaAttributeList ( )
inline

Construct empty attribute list with empty specification.

Definition at line 105 of file TagAthenaAttributeList.h.

106  m_desc(0)
107 {}

◆ TagAthenaAttributeList() [2/5]

TagAthenaAttributeList::TagAthenaAttributeList ( const coral::AttributeList &  rhs)
inline

Copy attribute lists.

Definition at line 110 of file TagAthenaAttributeList.h.

110  :
112  DataObject(*this),
113  m_desc(0)
114 {}

◆ TagAthenaAttributeList() [3/5]

TagAthenaAttributeList::TagAthenaAttributeList ( const TagAthenaAttributeList rhs)
inline

Definition at line 124 of file TagAthenaAttributeList.h.

124  :
126  DataObject(rhs)
127 {
128  if (rhs.hasDesc()) m_desc = new AthenaAttributeListSpecification( *(rhs.getDesc()) );
129  else m_desc=0;
130 }

◆ TagAthenaAttributeList() [4/5]

TagAthenaAttributeList::TagAthenaAttributeList ( const coral::AttributeListSpecification &  rhs)
inlineexplicit

Construct attribute list according to the specification.

The link to the specification is kept internally. User must make sure that the lifetime of the specification covers the lifetime of the attribute list.

Definition at line 117 of file TagAthenaAttributeList.h.

117  :
119  m_desc(0)
120 {}

◆ TagAthenaAttributeList() [5/5]

TagAthenaAttributeList::TagAthenaAttributeList ( const AthenaAttributeListSpecification rhs)
inlineexplicit

base on Spec with (name,type,info) tuple as well Otherwise it acts as coral version

Definition at line 147 of file TagAthenaAttributeList.h.

147  :
150 {
152  i != desc.end();
153  ++i)
154  {
155  this->coral::AttributeList::extend( i->name(), i->attributeType().typeName() );
156  }
157 }

◆ ~TagAthenaAttributeList()

TagAthenaAttributeList::~TagAthenaAttributeList ( )
inline

Definition at line 100 of file TagAthenaAttributeList.h.

100  {
101  if(m_desc!=0) m_desc->release();
102 }

Member Function Documentation

◆ coralList()

const coral::AttributeList& TagAthenaAttributeList::coralList ( ) const
inline

Definition at line 86 of file TagAthenaAttributeList.h.

86 {return *static_cast<const coral::AttributeList*>(this);}

◆ extend() [1/4]

template<typename T >
void TagAthenaAttributeList::extend ( const std::string &  name)

Extends the AttributeList by one attribute, given a specification.

In case the specification is shared, a copy is triggered.

Definition at line 162 of file TagAthenaAttributeList.h.

163 {
164  this->extend( name, typeid(T) );
165 }

◆ extend() [2/4]

void TagAthenaAttributeList::extend ( const std::string &  name,
const AthenaAttributeType type 
)
inline

Definition at line 185 of file TagAthenaAttributeList.h.

187 {
188  if (this->hasDesc()) m_desc->extend( name, type );
189  this->coral::AttributeList::extend( name, type.typeName() );
190 }

◆ extend() [3/4]

void TagAthenaAttributeList::extend ( const std::string &  name,
const std::string &  typeName 
)
inline

Definition at line 168 of file TagAthenaAttributeList.h.

170 {
171  if (this->hasDesc()) m_desc->extend( name, typeName );
172  this->coral::AttributeList::extend( name, typeName );
173 }

◆ extend() [4/4]

void TagAthenaAttributeList::extend ( const std::string &  name,
const std::type_info &  type 
)
inline

Definition at line 177 of file TagAthenaAttributeList.h.

179 {
180  if (this->hasDesc()) m_desc->extend( name, type );
181  this->coral::AttributeList::extend( name, type );
182 }

◆ getDesc()

const AthenaAttributeListSpecification * TagAthenaAttributeList::getDesc ( ) const
inline

Definition at line 210 of file TagAthenaAttributeList.h.

211 {
212  // User has to check for zero = no desc
213  return m_desc;
214 }

◆ hasDesc()

bool TagAthenaAttributeList::hasDesc ( ) const
inline

Definition at line 204 of file TagAthenaAttributeList.h.

205 {
206  return m_desc!=0;
207 }

◆ operator=()

TagAthenaAttributeList & TagAthenaAttributeList::operator= ( const TagAthenaAttributeList rhs)
inline

Assignment.

Definition at line 134 of file TagAthenaAttributeList.h.

135 {
136  if (this != &rhs) {
137  coral::AttributeList::operator= (rhs);
138  DataObject::operator= (rhs);
139  if (m_desc) m_desc->release();
140  if (rhs.hasDesc()) m_desc = new AthenaAttributeListSpecification( *(rhs.getDesc()) );
141  else m_desc=0;
142  }
143  return *this;
144 }

◆ print()

void TagAthenaAttributeList::print ( std::ostream &  os) const
inline

print to simulate function provided by old POOL AttributeList

Definition at line 193 of file TagAthenaAttributeList.h.

193  {
194  // this->toOutputStream(os);
195  os << "{";
196  for (coral::AttributeList::const_iterator itr=this->begin();
197  itr!=this->end();++itr) {
198  if (itr!=this->begin()) os << ",";
199  itr->toOutputStream(os);
200  }
201  os << "}";
202 }

Member Data Documentation

◆ m_desc

AthenaAttributeListSpecification* TagAthenaAttributeList::m_desc
private

The specification (empty if created with coral version)

Definition at line 91 of file TagAthenaAttributeList.h.


The documentation for this class was generated from the following file:
AthenaAttributeListSpecification
Definition: AthenaAttributeListSpecification.h:42
AthenaAttributeListSpecification::const_iterator
The iterator class.
Definition: AthenaAttributeListSpecification.h:94
CaloCondBlobAlgs_fillNoiseFromASCII.spec
spec
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:47
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
TagAthenaAttributeList::hasDesc
bool hasDesc() const
Definition: TagAthenaAttributeList.h:204
python.PyKernel.AttributeList
AttributeList
Definition: PyKernel.py:36
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
AthenaAttributeListSpecification::extend
void extend(const std::string &name, const std::string &unitName="UNKNOWN", const std::string &groupName="UNKNOWN")
Appends a new specification.
Definition: AthenaAttributeListSpecification.h:149
CaloCondBlobAlgs_fillNoiseFromASCII.desc
desc
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:54
TagAthenaAttributeList::extend
void extend(const std::string &name)
Extends the AttributeList by one attribute, given a specification.
Definition: TagAthenaAttributeList.h:162
lumiFormat.i
int i
Definition: lumiFormat.py:92
TagAthenaAttributeList::getDesc
const AthenaAttributeListSpecification * getDesc() const
Definition: TagAthenaAttributeList.h:210
AthenaAttributeListSpecification::release
void release() const
Decrements the reference counter.
Definition: AthenaAttributeListSpecification.h:285
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TagAthenaAttributeList::m_desc
AthenaAttributeListSpecification * m_desc
The specification (empty if created with coral version)
Definition: TagAthenaAttributeList.h:91
ReadCalibFromCool.typeName
typeName
Definition: ReadCalibFromCool.py:477
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35