RAIDA  1.9.0
Public Member Functions | List of all members
AIDA::IAnnotation Class Referenceabstract

The annotation holds arbitrary information represented with (key,value) pairs of strings. More...

#include <IAnnotation.h>

Inheritance diagram for AIDA::IAnnotation:
AIDA::IAnnotationROOT

Public Member Functions

virtual ~IAnnotation ()
 Destructor.
 
virtual bool addItem (const std::string &key, const std::string &value, bool sticky=false)=0
 The list of the commonly accepted keys : "Title" for the title. More...
 
virtual bool removeItem (const std::string &key)=0
 Remove the item indicated by a given key. More...
 
virtual std::string value (const std::string &key) const =0
 Retrieve the value for a given key. More...
 
virtual void setValue (const std::string &key, const std::string &value)=0
 Set the value for a given key. More...
 
virtual void setSticky (const std::string &key, bool sticky)=0
 Set the sticky flag for a given key. More...
 
virtual int size () const =0
 Get the size of the IAnnotation, i.e. More...
 
virtual std::string key (int index) const =0
 Get the key at a given position within the IAnnotation. More...
 
virtual std::string value (int index) const =0
 Get the value at a given position within the IAnnotation. More...
 
virtual void reset ()=0
 Remove all the non-sticky items.
 

Detailed Description

The annotation holds arbitrary information represented with (key,value) pairs of strings.

A sticky bit is associated to every item to protect it (or not) from a reset operation.

Author
The AIDA team (http://aida.freehep.org/)

Member Function Documentation

virtual bool AIDA::IAnnotation::addItem ( const std::string &  key,
const std::string &  value,
bool  sticky = false 
)
pure virtual

The list of the commonly accepted keys : "Title" for the title.

Add a key/value pair with a given sticky flag. If key alredy exists, override its value ?

Parameters
keyThe key to be added.
valueThe key's value.
stickyThe key's sticky flag. If true the item will not be removed when the method reset or removeItem are invoked. The default value for the sticky flag is false.
Returns
false If the key already exists.

Implemented in AIDA::IAnnotationROOT.

virtual std::string AIDA::IAnnotation::key ( int  index) const
pure virtual

Get the key at a given position within the IAnnotation.

Parameters
indexThe key's position within the IAnnotation.
Returns
The corresponding key.

Implemented in AIDA::IAnnotationROOT.

virtual bool AIDA::IAnnotation::removeItem ( const std::string &  key)
pure virtual

Remove the item indicated by a given key.

Parameters
keyThe key to be removed. If the key is flagged as "sticky" it will not be removed.
Returns
false If the key is sticky.

Implemented in AIDA::IAnnotationROOT.

virtual void AIDA::IAnnotation::setSticky ( const std::string &  key,
bool  sticky 
)
pure virtual

Set the sticky flag for a given key.

Parameters
keyThe key whose stick flag is to be set.
stickyThe new sticky flag.

Implemented in AIDA::IAnnotationROOT.

virtual void AIDA::IAnnotation::setValue ( const std::string &  key,
const std::string &  value 
)
pure virtual

Set the value for a given key.

Parameters
keyThe key whose vale is to be changed.
valueThe new value.

Implemented in AIDA::IAnnotationROOT.

virtual int AIDA::IAnnotation::size ( ) const
pure virtual

Get the size of the IAnnotation, i.e.

the number of keys contained in it.

Returns
The size of the IAnnotation.

Implemented in AIDA::IAnnotationROOT.

virtual std::string AIDA::IAnnotation::value ( const std::string &  key) const
pure virtual

Retrieve the value for a given key.

Parameters
keyThe key.
Returns
The corresponding value.

Implemented in AIDA::IAnnotationROOT.

virtual std::string AIDA::IAnnotation::value ( int  index) const
pure virtual

Get the value at a given position within the IAnnotation.

Parameters
indexThe value's position within the IAnnotation.
Returns
The corresponding value.

Implemented in AIDA::IAnnotationROOT.


The documentation for this class was generated from the following file: