00001
00015 #ifndef _CACHE_H_
00016 #define _CACHE_H_
00017
00018 #include <map>
00019 #include <TObject.h>
00020
00021 #include "Process.h"
00022 #include "CacheBuffer.h"
00023
00024 using std::map;
00025
00026 class Cache : public TObject
00027 {
00028 public:
00029
00030 Cache();
00031 Cache(unsigned int autoclear_limit);
00032 ~Cache();
00033
00034 void AddToCache (Process::Process_t prs, double e, double de_dx);
00035 bool Retrieve (Process::Process_t prs, double e, double& de_dx) const;
00036 void ClearCache (void);
00037 void Print (const Option_t * opt) const;
00038
00039 friend ostream & operator << (ostream & stream, const Cache & cache);
00040
00041 private:
00042
00043 map<int, CacheBuffer *> fCache;
00044
00045 ClassDef(Cache, 1)
00046 };
00047
00048 #endif // _CACHE_H_