|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef ATHENAPOOLUTILITIES_ATHENAATTRIBUTELISTSPECIFICATION_H
6 #define ATHENAPOOLUTILITIES_ATHENAATTRIBUTELISTSPECIFICATION_H
16 #include "CoralBase/AttributeSpecification.h"
17 #include "CoralBase/AttributeListException.h"
18 #include "CoralBase/AttributeListSpecification.h"
23 #include "GaudiKernel/System.h"
57 template<
typename T>
void extend(
const std::string&
name,
const std::string& unitName =
"UNKNOWN",
const std::string&
groupName =
"UNKNOWN" );
61 const std::string& unitName=
"UNKNOWN",
64 const std::type_info&
type,
65 const std::string& unitName=
"UNKNOWN",
81 int index(
const std::string&
name )
const;
90 void coralSpec(coral::AttributeListSpecification&)
const;
103 const_iterator( std::vector< AthenaAttributeSpecification* >::const_iterator theIterator );
113 std::vector< AthenaAttributeSpecification* >::const_iterator
m_iterator;
148 template<
typename T>
void
177 m_iterator( rhs.m_iterator )
189 m_iterator( theIterator )
232 return ( ! ( *
this == rhs ) );
245 m_attributeSpecifications(),
246 m_mapOfNameToIndex( rhs.m_mapOfNameToIndex )
248 for ( std::vector< AthenaAttributeSpecification* >::const_iterator iSpecification = rhs.
m_attributeSpecifications.begin();
257 m_attributeSpecifications(),
261 for ( coral::AttributeListSpecification::const_iterator iSpecification = rhs.begin();
262 iSpecification != rhs.end(); ++iSpecification )
264 this->
extend(iSpecification->name(),iSpecification->typeName());
296 const std::string& unitName,
300 throw coral::AttributeListException(
"An attribute with the name \"" +
name +
"\" exists already" );
308 const std::type_info& typeInfo,
309 const std::string& unitName,
314 throw coral::AttributeListException(
"An attribute with the name \"" +
name +
"\" exists already" );
325 throw coral::AttributeListException(
"An attribute with the name \"" +
name +
"\" exists already" );
335 throw coral::AttributeListException(
"An attribute with the name \"" + aas.
name() +
"\" exists already" );
346 else return iSpecificationForAttribute->second;
354 throw coral::AttributeListException(
"Invalid index for the attribute already" );
368 s.extend(
i->name(),
i->attributeType().typeName() );
376 if ( this->
size() != rhs.
size() )
return false;
377 size_t theSize = this->
size();
379 for (
size_t i = 0;
i < theSize; ++
i )
381 if ( lhs[
i] != rhs[
i] )
JetConstituentVector::iterator iterator
int index(const std::string &name) const
Returns the index of a specification given its name. If the name is not found it returns -1.
const_iterator & operator=(const const_iterator &rhs)
std::map< std::string, int > m_mapOfNameToIndex
The map of names to indices.
bool operator==(const const_iterator &rhs) const
const AthenaAttributeSpecification * operator->() const
const_iterator begin() const
Returns a forward iterator.
const AthenaAttributeSpecification & specificationForAttribute(int index) const
Returns the specification given an index.
std::atomic< int > m_counter
The reference counter.
void extend(const std::string &name, const std::string &unitName="UNKNOWN", const std::string &groupName="UNKNOWN")
Appends a new specification.
std::string typeinfoName(const std::type_info &ti)
Convert a type_info to a demangled string.
const_iterator(const const_iterator &rhs)
std::vector< AthenaAttributeSpecification * > m_attributeSpecifications
The specifications.
std::vector< AthenaAttributeSpecification * >::const_iterator m_iterator
bool operator!=(const const_iterator &rhs) const
~AthenaAttributeListSpecification()
The destructor is private.
const_iterator end() const
An AttributeList represents a logical row of attributes in a metadata table. The name and type of eac...
void release() const
Decrements the reference counter.
const std::string & name() const
size_t size() const
Returns the size of the specification.
AthenaAttributeListSpecification()
Constructor.
AthenaAttributeListSpecification & operator=(const AthenaAttributeListSpecification &)
No assignment operator.
bool operator!=(const AthenaAttributeListSpecification &rhs) const
Comparison operator. Compares only types and values. Not the attribute names.
const AthenaAttributeSpecification & operator[](size_t index) const
Bracket operator.
const AthenaAttributeSpecification & operator*() const
void coralSpec(coral::AttributeListSpecification &) const
Fills a coral Specification.
bool operator==(const AthenaAttributeListSpecification &rhs) const
Equal operator. Compares only types and values. Not the attribute names.