Implementation of the AIDA IAnnotation interface class.
More...
#include <src/HistogramSvc/Annotation.h>
Implementation of the AIDA IAnnotation interface class.
Definition at line 18 of file Annotation.h.
AIDA::Annotation::Annotation |
( |
| ) |
|
|
inline |
virtual AIDA::Annotation::~Annotation |
( |
| ) |
|
|
inlinevirtual |
bool AIDA::Annotation::addItem |
( |
const std::string & |
key, |
|
|
const std::string & |
value, |
|
|
bool |
sticky = false |
|
) |
| |
|
inline |
Add a key/value pair with a given sticky.
Definition at line 83 of file Annotation.h.
std::map< std::string, unsigned int > m_identifiers
The map of strings to identifiers.
std::string value(const std::string &key) const
Retrieve the value for a given key.
std::string key(int index) const
Individual access to the Annotation-items.
std::vector< AnnotationItem > m_annotationItems
The vector of the annotation items.
std::string AIDA::Annotation::key |
( |
int |
index | ) |
const |
|
inline |
Individual access to the Annotation-items.
Definition at line 145 of file Annotation.h.
std::vector< AnnotationItem > m_annotationItems
The vector of the annotation items.
bool AIDA::Annotation::removeItem |
( |
const std::string & |
key | ) |
|
|
inline |
Remove the item indicated by a given key.
Definition at line 93 of file Annotation.h.
94 std::map< std::string, unsigned int >::const_iterator iKey =
m_identifiers.find(
key );
97 unsigned int indexToBeRemoved = iKey->second;
105 std::vector< AnnotationItem > m_annotationItemsNew;
108 if ( iItem == indexToBeRemoved )
continue;
110 m_annotationItemsNew.push_back( AnnotationItem( item.m_key, item.m_value, item.m_sticky ) );
111 m_identifiers.insert( std::make_pair( item.m_key, m_annotationItemsNew.size() - 1 ) );
std::map< std::string, unsigned int > m_identifiers
The map of strings to identifiers.
std::string key(int index) const
Individual access to the Annotation-items.
std::vector< AnnotationItem > m_annotationItems
The vector of the annotation items.
void AIDA::Annotation::reset |
( |
| ) |
|
|
inline |
Remove all the non-sticky items.
Definition at line 157 of file Annotation.h.
160 std::vector< std::string > itemsToRemove;
161 itemsToRemove.reserve(
size() );
168 for (
unsigned int i = 0;
i < itemsToRemove.size(); ++
i )
removeItem( itemsToRemove[
i] );
bool removeItem(const std::string &key)
Remove the item indicated by a given key.
int size() const
Get the number of items in the Annotation.
std::vector< AnnotationItem > m_annotationItems
The vector of the annotation items.
void AIDA::Annotation::setSticky |
( |
const std::string & |
key, |
|
|
bool |
sticky |
|
) |
| |
|
inline |
Set sticky for a given key.
Definition at line 134 of file Annotation.h.
136 std::map< std::string, unsigned int >::const_iterator iKey =
m_identifiers.find(
key );
std::map< std::string, unsigned int > m_identifiers
The map of strings to identifiers.
std::string key(int index) const
Individual access to the Annotation-items.
std::vector< AnnotationItem > m_annotationItems
The vector of the annotation items.
void AIDA::Annotation::setValue |
( |
const std::string & |
key, |
|
|
const std::string & |
value |
|
) |
| |
|
inline |
Set value for a given key.
Definition at line 124 of file Annotation.h.
126 std::map< std::string, unsigned int >::const_iterator iKey =
m_identifiers.find(
key );
std::map< std::string, unsigned int > m_identifiers
The map of strings to identifiers.
std::string value(const std::string &key) const
Retrieve the value for a given key.
bool addItem(const std::string &key, const std::string &value, bool sticky=false)
Add a key/value pair with a given sticky.
std::string key(int index) const
Individual access to the Annotation-items.
std::vector< AnnotationItem > m_annotationItems
The vector of the annotation items.
int AIDA::Annotation::size |
( |
| ) |
const |
|
inline |
Get the number of items in the Annotation.
Definition at line 141 of file Annotation.h.
std::vector< AnnotationItem > m_annotationItems
The vector of the annotation items.
std::string AIDA::Annotation::value |
( |
const std::string & |
key | ) |
const |
|
inline |
Retrieve the value for a given key.
Definition at line 117 of file Annotation.h.
119 std::map< std::string, unsigned int >::const_iterator iKey =
m_identifiers.find(
key );
std::map< std::string, unsigned int > m_identifiers
The map of strings to identifiers.
std::string key(int index) const
Individual access to the Annotation-items.
std::vector< AnnotationItem > m_annotationItems
The vector of the annotation items.
std::string AIDA::Annotation::value |
( |
int |
index | ) |
const |
|
inline |
Definition at line 151 of file Annotation.h.
std::vector< AnnotationItem > m_annotationItems
The vector of the annotation items.
std::string AIDA::Annotation::emptyString |
|
private |
The vector of the annotation items.
Definition at line 74 of file Annotation.h.
std::map< std::string, unsigned int > AIDA::Annotation::m_identifiers |
|
private |
The map of strings to identifiers.
Definition at line 77 of file Annotation.h.
The documentation for this class was generated from the following file: