CCalibrationDictionary.h
//-----------------------------------------------------------------------------
// $Header: /tmp_mnt/asis/offline/ceres/cool/project/RCS/CCalibrationDictionary.h,v 2.1 1996/10/04 08:43:33 voigt Exp $
//
// COOL Program Library
// Copyright (C) CERES collaboration, 1996
//
// Declaration of class CCalibrationDictionary.
//
// The dictionary stores all values as doubles.
// If the lvalue (for lookup only) is an integer a type cast
// must be provided.
// Every object O with sizeof(O) <= sizeof(double) can be stored.
// Note that duplicate keys are not allowed.
//
//-----------------------------------------------------------------------------
#ifndef CCALIBRATIONDICTIONARY_H
#define CCALIBRATIONDICTIONARY_H
#include "cool.h"
#include <rw/tvhdict.h>
class CCalibrationDictionary {
public:
CCalibrationDictionary();
~CCalibrationDictionary();
void add(const CString&, double); // adds key-value pair
double lookup(const CString&); // returns value for given key
CBoolean isEmpty(); // tests wether dictionary has no entries
CBoolean contains(const CString&); // tests wether key is in dictionary
size_t entries(); // number of key-value pairs in dictionary
void remove(const CString&); // removes a key-value pair
void clear(); // removes all itens
CBoolean writeContentToFile(const char*); // write entire dictionary
CBoolean readContentFromFile(const char*); // read entire dictionary
private:
RWTValHashDictionary<CString, double> *dictionary;
};
#endif /* CCALIBRATIONDICTIONARY_H */