Public Member Functions | |
void | add (const KeyType &key, const ValueType *value) |
add object to cache. It is caller responsibility to check that object is not yet there. | |
virtual void | clear () |
emptify cache, delete values associated to Key | |
const ValueType * | get (const KeyType &key) |
void | reserve (int size) |
SimpleCache (int initSize) | |
virtual | ~SimpleCache () |
Protected Types | |
typedef std::vector < KeyValuePair > ::const_iterator | ConstItr |
typedef std::pair< KeyType, const ValueType * > | KeyValuePair |
Protected Attributes | |
std::vector< KeyValuePair > | theContainer |
Private Member Functions | |
SimpleCache (const SimpleCache &) |
Definition at line 18 of file LayerHitMapCache.h.
typedef std::vector< KeyValuePair >::const_iterator LayerHitMapCache::SimpleCache< KeyType, ValueType >::ConstItr [protected] |
Definition at line 41 of file LayerHitMapCache.h.
typedef std::pair< KeyType, const ValueType * > LayerHitMapCache::SimpleCache< KeyType, ValueType >::KeyValuePair [protected] |
Definition at line 39 of file LayerHitMapCache.h.
LayerHitMapCache::SimpleCache< KeyType, ValueType >::SimpleCache | ( | int | initSize | ) | [inline] |
Definition at line 20 of file LayerHitMapCache.h.
References LayerHitMapCache::SimpleCache< KeyType, ValueType >::reserve().
00020 { reserve(initSize); }
virtual LayerHitMapCache::SimpleCache< KeyType, ValueType >::~SimpleCache | ( | ) | [inline, virtual] |
Definition at line 21 of file LayerHitMapCache.h.
References LayerHitMapCache::SimpleCache< KeyType, ValueType >::clear().
00021 { clear(); }
LayerHitMapCache::SimpleCache< KeyType, ValueType >::SimpleCache | ( | const SimpleCache< KeyType, ValueType > & | ) | [inline, private] |
void LayerHitMapCache::SimpleCache< KeyType, ValueType >::add | ( | const 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 30 of file LayerHitMapCache.h.
References getDQMSummary::key, LayerHitMapCache::SimpleCache< KeyType, ValueType >::theContainer, and value.
Referenced by LayerHitMapCache::operator()().
00030 { 00031 theContainer.push_back( std::make_pair(key,value)); 00032 }
virtual void LayerHitMapCache::SimpleCache< KeyType, ValueType >::clear | ( | void | ) | [inline, virtual] |
emptify cache, delete values associated to Key
Definition at line 34 of file LayerHitMapCache.h.
References i, and LayerHitMapCache::SimpleCache< KeyType, ValueType >::theContainer.
Referenced by LayerHitMapCache::clear(), and LayerHitMapCache::SimpleCache< KeyType, ValueType >::~SimpleCache().
00034 { 00035 for (ConstItr i=theContainer.begin(); i!= theContainer.end(); i++) { delete i->second; } 00036 theContainer.clear(); 00037 }
const ValueType* LayerHitMapCache::SimpleCache< KeyType, ValueType >::get | ( | const KeyType & | key | ) | [inline] |
Definition at line 23 of file LayerHitMapCache.h.
References it, getDQMSummary::key, and LayerHitMapCache::SimpleCache< KeyType, ValueType >::theContainer.
Referenced by LayerHitMapCache::operator()().
00023 { 00024 for (ConstItr it = theContainer.begin(); it != theContainer.end(); it++) { 00025 if ( it->first == key) return it->second; 00026 } 00027 return 0; 00028 }
void LayerHitMapCache::SimpleCache< KeyType, ValueType >::reserve | ( | int | size | ) | [inline] |
Definition at line 22 of file LayerHitMapCache.h.
References LayerHitMapCache::SimpleCache< KeyType, ValueType >::theContainer.
Referenced by LayerHitMapCache::SimpleCache< KeyType, ValueType >::SimpleCache().
00022 { theContainer.reserve(size); }
std::vector< KeyValuePair > LayerHitMapCache::SimpleCache< KeyType, ValueType >::theContainer [protected] |
Definition at line 40 of file LayerHitMapCache.h.
Referenced by LayerHitMapCache::SimpleCache< KeyType, ValueType >::add(), LayerHitMapCache::SimpleCache< KeyType, ValueType >::clear(), LayerHitMapCache::SimpleCache< KeyType, ValueType >::get(), and LayerHitMapCache::SimpleCache< KeyType, ValueType >::reserve().