CERN Accelerating science

This website is no longer maintained. Its content may be obsolete. Please visit http://home.cern/ for current CERN information.

Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

AIDA::IAnnotation Class Reference

#include <IAnnotation.h>

List of all members.

Public Methods

virtual ~IAnnotation ()
 Destructor. More...

virtual bool addItem (const std::string &key, const std::string &value, bool sticky=false)=0
virtual bool removeItem (const std::string &key)=0
virtual const std::string& value (const std::string &key) const=0
virtual void setValue (const std::string &key, const std::string &value)=0
virtual void setSticky (const std::string &key, bool sticky)=0
virtual int size () const=0
virtual const std::string& key (int index) const=0
virtual const std::string& value (int index) const=0
virtual void reset ()=0


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/)

Definition at line 34 of file IAnnotation.h.


Constructor & Destructor Documentation

AIDA::IAnnotation::~IAnnotation ( ) [inline, virtual]
 

Definition at line 38 of file IAnnotation.h.


Member Function Documentation

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

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

Parameters:
key   The key to be added.
value   The key's value.
sticky   The 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.

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

Get the key at a given position within the IAnnotation.

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

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

Remove the item indicated by a given key.

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

void AIDA::IAnnotation::reset ( ) [pure virtual]
 

Remove all the non-sticky items.

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

Set the sticky flag for a given key.

Parameters:
key   The key whose stick flag is to be set.
sticky   The new sticky flag.

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

Set the value for a given key.

Parameters:
key   The key whose vale is to be changed.
value   The new value.

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.

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

Get the value at a given position within the IAnnotation.

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

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

Retrieve the value for a given key.

Parameters:
key   The key.
Returns:
The corresponding value.


The documentation for this class was generated from the following file:
Generated at Tue Feb 18 15:48:24 2003 for AIDA_Interfaces by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001