Implementation of the AIDA IAnnotation interface class.
More...
#include </builds/gaudi/Gaudi/GaudiCommonSvc/include/GaudiCommonSvc/Annotation.h>
|
bool | addItem (const std::string &key, const std::string &value, bool sticky=false) override |
| Add a key/value pair with a given sticky.
|
|
bool | removeItem (const std::string &key) override |
| Remove the item indicated by a given key.
|
|
std::string | value (const std::string &key) const override |
| Retrieve the value for a given key.
|
|
void | setValue (const std::string &key, const std::string &value) override |
| Set value for a given key.
|
|
void | setSticky (const std::string &key, bool sticky) override |
| Set sticky for a given key.
|
|
int | size () const override |
| Get the number of items in the Annotation.
|
|
std::string | key (int index) const override |
| Individual access to the Annotation-items.
|
|
std::string | value (int index) const override |
|
void | reset () override |
| Remove all the non-sticky items.
|
|
Implementation of the AIDA IAnnotation interface class.
Definition at line 25 of file Annotation.h.
◆ addItem()
bool AIDA::Annotation::addItem |
( |
const std::string & | key, |
|
|
const std::string & | value, |
|
|
bool | sticky = false ) |
|
inlineoverride |
Add a key/value pair with a given sticky.
Definition at line 76 of file Annotation.h.
76 {
80 return true;
81}
std::string value(const std::string &key) const override
Retrieve the value for a given key.
std::string key(int index) const override
Individual access to the Annotation-items.
std::vector< AnnotationItem > m_annotationItems
The vector of the annotation items.
std::map< std::string, unsigned int > m_identifiers
The map of strings to identifiers.
◆ key()
std::string AIDA::Annotation::key |
( |
int | index | ) |
const |
|
inlineoverride |
Individual access to the Annotation-items.
Definition at line 128 of file Annotation.h.
128 {
131}
size_t index(const Gaudi::ParticleProperty *property, const Gaudi::Interfaces::IParticlePropertySvc *service)
helper utility for mapping of Gaudi::ParticleProperty object into non-negative integral sequential id...
◆ removeItem()
bool AIDA::Annotation::removeItem |
( |
const std::string & | key | ) |
|
|
inlineoverride |
Remove the item indicated by a given key.
Definition at line 83 of file Annotation.h.
83 {
86
87 unsigned int indexToBeRemoved = iKey->second;
88
89
91
92
93
95 std::vector<AnnotationItem> annotationItemsNew;
98 if ( iItem == indexToBeRemoved ) continue;
100 annotationItemsNew.emplace_back( item.m_key, item.m_value, item.m_sticky );
101 m_identifiers.emplace( item.m_key, annotationItemsNew.size() - 1 );
102 }
104 return true;
105}
◆ reset()
void AIDA::Annotation::reset |
( |
| ) |
|
|
inlineoverride |
Remove all the non-sticky items.
Definition at line 138 of file Annotation.h.
138 {
139
140 std::vector<std::string> itemsToRemove;
141 itemsToRemove.reserve(
size() );
143 if ( !item.m_sticky ) itemsToRemove.push_back( item.m_key );
144 }
145 for (
const auto& i : itemsToRemove )
removeItem( i );
146}
bool removeItem(const std::string &key) override
Remove the item indicated by a given key.
int size() const override
Get the number of items in the Annotation.
◆ setSticky()
void AIDA::Annotation::setSticky |
( |
const std::string & | key, |
|
|
bool | sticky ) |
|
inlineoverride |
◆ setValue()
void AIDA::Annotation::setValue |
( |
const std::string & | key, |
|
|
const std::string & | value ) |
|
inlineoverride |
Set value for a given key.
Definition at line 112 of file Annotation.h.
112 {
115
117 else
119}
bool addItem(const std::string &key, const std::string &value, bool sticky=false) override
Add a key/value pair with a given sticky.
◆ size()
int AIDA::Annotation::size |
( |
| ) |
const |
|
inlineoverride |
◆ value() [1/2]
std::string AIDA::Annotation::value |
( |
const std::string & | key | ) |
const |
|
inlineoverride |
Retrieve the value for a given key.
Definition at line 107 of file Annotation.h.
◆ value() [2/2]
std::string AIDA::Annotation::value |
( |
int | index | ) |
const |
|
inlineoverride |
◆ emptyString
std::string AIDA::Annotation::emptyString |
|
private |
◆ m_annotationItems
The vector of the annotation items.
Definition at line 67 of file Annotation.h.
◆ m_identifiers
std::map<std::string, unsigned int> AIDA::Annotation::m_identifiers |
|
private |
The map of strings to identifiers.
Definition at line 70 of file Annotation.h.
The documentation for this class was generated from the following file: