CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

LayerHitMapCache::SimpleCache Class Reference

List of all members.

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.
void clear ()
 emptify cache, delete values associated to Key
const ValueType * get (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.


Constructor & Destructor Documentation

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

Definition at line 22 of file LayerHitMapCache.h.

: theContainer(initSize, nullptr){}
LayerHitMapCache::SimpleCache::~SimpleCache ( ) [inline]

Definition at line 23 of file LayerHitMapCache.h.

References clear().

{ clear(); }
LayerHitMapCache::SimpleCache::SimpleCache ( const SimpleCache ) [inline, private]

Definition at line 38 of file LayerHitMapCache.h.

{ }

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 combine::key, resize(), theContainer, and relativeConstraints::value.

Referenced by LayerHitMapCache::operator()().

                                                   {
      if (key>=int(theContainer.size())) resize(key+1);
      theContainer[key]=value;
    }
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().

                 {
      for ( auto & v : theContainer)  { delete v; v=nullptr;}
    }
const ValueType* LayerHitMapCache::SimpleCache::get ( KeyType  key) [inline]

Definition at line 25 of file LayerHitMapCache.h.

References combine::key, and theContainer.

Referenced by LayerHitMapCache::operator()().

{ return theContainer[key];}
void LayerHitMapCache::SimpleCache::resize ( int  size) [inline]

Definition at line 24 of file LayerHitMapCache.h.

References theContainer.

Referenced by add().

{ theContainer.resize(size,nullptr); }

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().