Cache Class Reference

#include <Cache.h>

List of all members.

Public Member Functions

 Cache ()
 Cache (unsigned int autoclear_limit)
 ~Cache ()
void AddToCache (Process::Process_t prs, double e, double de_dx)
bool Retrieve (Process::Process_t prs, double e, double &de_dx) const
void ClearCache (void)
void Print (const Option_t *opt) const

Private Attributes

map< int, CacheBuffer * > fCache

Friends

ostream & operator<< (ostream &stream, const Cache &cache)

Detailed Description

________________________________________________________________________________________

Id
Cache.cxx,v 1.2 2004/01/05 16:11:12 costas Exp

________________________________________________________________________________________

Id
Cache.h,v 1.2 2004/01/05 16:11:12 costas Exp

Definition at line 26 of file Cache.h.


Constructor & Destructor Documentation

Cache::Cache (  ) 

Definition at line 31 of file Cache.cxx.

References Process::eBremsstrahlung, Process::eIonization, Process::eNuclearInteraction, Process::ePairProduction, and fCache.

00032 {
00033   typedef map<int, CacheBuffer *>::value_type cache_pair;
00034   
00035   fCache.insert( cache_pair( (int) Process::eIonization,         new CacheBuffer ) );
00036   fCache.insert( cache_pair( (int) Process::eBremsstrahlung,     new CacheBuffer ) );
00037   fCache.insert( cache_pair( (int) Process::ePairProduction,     new CacheBuffer ) );
00038   fCache.insert( cache_pair( (int) Process::eNuclearInteraction, new CacheBuffer ) );
00039 }

Cache::Cache ( unsigned int  autoclear_limit  ) 

Definition at line 41 of file Cache.cxx.

References Process::eBremsstrahlung, Process::eIonization, Process::eNuclearInteraction, Process::ePairProduction, and fCache.

00042 {
00043   typedef map<int, CacheBuffer *>::value_type cache_pair;
00044 
00045   fCache.insert(cache_pair((int) Process::eIonization,         new CacheBuffer(autoclear)));
00046   fCache.insert(cache_pair((int) Process::eBremsstrahlung,     new CacheBuffer(autoclear)));
00047   fCache.insert(cache_pair((int) Process::ePairProduction,     new CacheBuffer(autoclear)));
00048   fCache.insert(cache_pair((int) Process::eNuclearInteraction, new CacheBuffer(autoclear)));
00049 }

Cache::~Cache (  ) 

Definition at line 51 of file Cache.cxx.

References fCache.

00052 {
00053   map<int, CacheBuffer *>::iterator buf_iter;
00054   for(buf_iter = fCache.begin(); buf_iter != fCache.end(); ++buf_iter)
00055                                                                    delete buf_iter->second;
00056   fCache.clear();
00057 }


Member Function Documentation

void Cache::AddToCache ( Process::Process_t  prs,
double  e,
double  de_dx 
)

Definition at line 59 of file Cache.cxx.

References fCache.

Referenced by MuEnergyLoss::dE_dx().

00060 {
00061   map<int, CacheBuffer *>::iterator iter = fCache.find( (int) prs );
00062 
00063   iter->second->AddToCache(e, de_dx);
00064 }

void Cache::ClearCache ( void   ) 

Definition at line 73 of file Cache.cxx.

References fCache.

00074 {
00075   map<int, CacheBuffer *>::iterator buf_iter;
00076   for(buf_iter = fCache.begin(); buf_iter != fCache.end(); ++buf_iter)
00077                                                             buf_iter->second->ClearCache();
00078 }

void Cache::Print ( const Option_t *  opt  )  const

Definition at line 80 of file Cache.cxx.

00081 {
00082   cout << *this;
00083 }

bool Cache::Retrieve ( Process::Process_t  prs,
double  e,
double &  de_dx 
) const

Definition at line 66 of file Cache.cxx.

References fCache.

Referenced by MuEnergyLoss::dE_dx().

00067 {
00068   map<int, CacheBuffer *>::const_iterator iter = fCache.find( (int) prs );
00069 
00070   return iter->second->Retrieve(e, de_dx);
00071 }


Friends And Related Function Documentation

ostream& operator<< ( ostream &  stream,
const Cache cache 
) [friend]

Member Data Documentation

map<int, CacheBuffer *> Cache::fCache [private]

Definition at line 43 of file Cache.h.

Referenced by AddToCache(), Cache(), ClearCache(), Retrieve(), and ~Cache().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1