ATLAS Offline Software
Loading...
Searching...
No Matches
AthenaAttributeSpecification.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ATHENAPOOLUTILITIES_ATHENAATTRIBUTESPECIFICATION_H
6#define ATHENAPOOLUTILITIES_ATHENAATTRIBUTESPECIFICATION_H
7
8#include <string>
9#include <iostream>
10#include <sstream>
11#include <typeinfo>
12
14
16//
17// Class which acts like coral::AttributeSpecification
18// BUT allows annotation like pool::CollectionDescription
19// BUT which is encased in name,value pair interface
20// which is not accessible through the constructor
21//
23
25{
26public:
27 //
28 AthenaAttributeSpecification(const std::string& n,
29 const std::string& t,
30 const std::string& g = "UNKNOWN",
31 const std::string& u = "UNKNOWN") :
32 m_name(n),m_type(t, u, g)
33 {}
34 AthenaAttributeSpecification(const std::string& n,
35 const AthenaAttributeType& t) :
36 m_name(n),m_type(t)
37 {}
38
39 const std::string& name() const {return m_name;}
40 std::string typeName() const {return m_type.typeName();}
41 std::string unit() const {return m_type.unit();}
42 std::string group() const {return m_type.group();}
43 const AthenaAttributeType& attributeType() const {return m_type;}
44
46 bool operator==( const AthenaAttributeSpecification& rhs ) const;
47
49 bool operator!=( const AthenaAttributeSpecification& rhs ) const;
50
51private:
52 std::string m_name;
54};
55
56
57inline bool
59{
60 return ( this->m_name == rhs.m_name &&
61 this->m_type == rhs.m_type );
62}
63
64inline bool
66{
67 return ( this->m_name != rhs.m_name ||
68 this->m_type != rhs.m_type );
69}
70
71#endif
bool operator==(const AthenaAttributeSpecification &rhs) const
Equal operator.
AthenaAttributeSpecification(const std::string &n, const std::string &t, const std::string &g="UNKNOWN", const std::string &u="UNKNOWN")
bool operator!=(const AthenaAttributeSpecification &rhs) const
Comparison operator.
AthenaAttributeSpecification(const std::string &n, const AthenaAttributeType &t)
const AthenaAttributeType & attributeType() const