CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
LayerHitMapCache::SimpleCache Class Reference

Public Types

using KeyType = int
 
using ValueType = RecHitsSortedInPhi
 

Public Member Functions

void add (KeyType key, const ValueType *value)
 add object to cache. It is caller responsibility to check that object is not yet there. More...
 
void clear ()
 emptify cache, delete values associated to Key More...
 
const ValueTypeget (KeyType key)
 
void resize (int size)
 
 SimpleCache (unsigned int initSize)
 
 ~SimpleCache ()
 

Private Member Functions

 SimpleCache (const SimpleCache &)
 

Private Attributes

std::vector< const ValueType * > theContainer
 

Detailed Description

Definition at line 18 of file LayerHitMapCache.h.

Member Typedef Documentation

Definition at line 21 of file LayerHitMapCache.h.

Definition at line 20 of file LayerHitMapCache.h.

Constructor & Destructor Documentation

LayerHitMapCache::SimpleCache::SimpleCache ( unsigned int  initSize)
inline

Definition at line 22 of file LayerHitMapCache.h.

22 : theContainer(initSize, nullptr){}
std::vector< const ValueType * > theContainer
LayerHitMapCache::SimpleCache::~SimpleCache ( )
inline

Definition at line 23 of file LayerHitMapCache.h.

References clear().

23 { clear(); }
void clear()
emptify cache, delete values associated to Key
LayerHitMapCache::SimpleCache::SimpleCache ( const SimpleCache )
inlineprivate

Definition at line 38 of file LayerHitMapCache.h.

38 { }

Member Function Documentation

void LayerHitMapCache::SimpleCache::add ( KeyType  key,
const ValueType value 
)
inline

add object to cache. It is caller responsibility to check that object is not yet there.

Definition at line 27 of file LayerHitMapCache.h.

References relval_steps::key, resize(), theContainer, and relativeConstraints::value.

Referenced by LayerHitMapCache::operator()(), and counter.Counter::register().

27  {
28  if (key>=int(theContainer.size())) resize(key+1);
30  }
std::vector< const ValueType * > theContainer
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
void LayerHitMapCache::SimpleCache::clear ( void  )
inline

emptify cache, delete values associated to Key

Definition at line 32 of file LayerHitMapCache.h.

References theContainer, and findQualityFiles::v.

Referenced by LayerHitMapCache::clear(), and ~SimpleCache().

32  {
33  for ( auto & v : theContainer) { delete v; v=nullptr;}
34  }
std::vector< const ValueType * > theContainer
const ValueType* LayerHitMapCache::SimpleCache::get ( KeyType  key)
inline
void LayerHitMapCache::SimpleCache::resize ( int  size)
inline

Member Data Documentation

std::vector< const ValueType *> LayerHitMapCache::SimpleCache::theContainer
private

Definition at line 36 of file LayerHitMapCache.h.

Referenced by add(), clear(), get(), and resize().