CErrorCollection.h
//-----------------------------------------------------------------------------
// $Header: /asis/offline/ceres/cool/project/RCS/CErrorCollection.h,v 1.2 1997/07/16 15:25:02 messer Exp $
//
// COOL Program Library
// Copyright (C) CERES collaboration, 1996
//
// Declaration of class CErrorCollection.
//
//-----------------------------------------------------------------------------
#ifndef CERRORCOLLECTION_H
#define CERRORCOLLECTION_H
#include "cool.h"
#include <rw/tvhdict.h>
class CErrorCollection {
public:
CErrorCollection();
~CErrorCollection();
void remember(const CString&);
void remember(const CString&, int);
CBoolean inLastEvent(const CString&) const;
CBoolean inLastEvent(const CString&, int) const;
int getCounter(const CString&) const;
int getCounter(const CString&, int) const;
size_t entries() const; // number of key-value pairs in counterDictionary
void newEvent();
void reset(); // clears eventDictionary
void resetAll(); // clears both dictionaries
void printSummary() const;
private:
CString getFullKey(const CString&, int) const;
private:
RWTValHashDictionary<CString, int> *counterDictionary;
RWTValHashDictionary<CString, CBoolean> *eventDictionary;
int eventCounter;
};
#endif /* CERRORCOLLECTION_H */