ATLAS Offline Software
AthenaAttributeSpecification.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 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 {
26 public:
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  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();}
44 
46  bool operator==( const AthenaAttributeSpecification& rhs ) const;
47 
49  bool operator!=( const AthenaAttributeSpecification& rhs ) const;
50 
51 private:
52  std::string m_name;
54 };
55 
56 
57 inline bool
59 {
60  return ( this->m_name == rhs.m_name &&
61  this->m_type == rhs.m_type );
62 }
63 
64 inline bool
66 {
67  return ( this->m_name != rhs.m_name ||
68  this->m_type != rhs.m_type );
69 }
70 
71 #endif
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
AthenaAttributeType::group
std::string group() const
Definition: AthenaAttributeType.h:135
AthenaAttributeSpecification::group
std::string group() const
Definition: AthenaAttributeSpecification.h:42
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:83
AthenaAttributeSpecification::unit
std::string unit() const
Definition: AthenaAttributeSpecification.h:41
AthenaAttributeType::typeName
std::string typeName() const
Definition: AthenaAttributeType.h:119
AthenaAttributeSpecification::AthenaAttributeSpecification
AthenaAttributeSpecification(const std::string &n, const std::string &t, const std::string &g="UNKNOWN", const std::string &u="UNKNOWN")
Definition: AthenaAttributeSpecification.h:28
AthenaAttributeSpecification::m_name
std::string m_name
Definition: AthenaAttributeSpecification.h:52
AthenaAttributeSpecification::operator==
bool operator==(const AthenaAttributeSpecification &rhs) const
Equal operator.
Definition: AthenaAttributeSpecification.h:58
AthenaAttributeType.h
AthenaAttributeType::unit
std::string unit() const
Definition: AthenaAttributeType.h:127
python.CaloCondTools.g
g
Definition: CaloCondTools.py:15
beamspotman.n
n
Definition: beamspotman.py:731
AthenaAttributeSpecification::typeName
std::string typeName() const
Definition: AthenaAttributeSpecification.h:40
AthenaAttributeSpecification::attributeType
AthenaAttributeType attributeType() const
Definition: AthenaAttributeSpecification.h:43
AthenaAttributeSpecification::name
std::string name() const
Definition: AthenaAttributeSpecification.h:39
AthenaAttributeSpecification::m_type
AthenaAttributeType m_type
Definition: AthenaAttributeSpecification.h:53
AthenaAttributeSpecification::operator!=
bool operator!=(const AthenaAttributeSpecification &rhs) const
Comparison operator.
Definition: AthenaAttributeSpecification.h:65
AthenaAttributeType
Definition: AthenaAttributeType.h:31
AthenaAttributeSpecification::AthenaAttributeSpecification
AthenaAttributeSpecification(const std::string &n, const AthenaAttributeType &t)
Definition: AthenaAttributeSpecification.h:34
AthenaAttributeSpecification
Definition: AthenaAttributeSpecification.h:25