Mantid
|
Cache is a generic caching storage class. More...
#include <Kernel/Cache.h>
Public Member Functions | |
Cache () | |
No-arg Constructor. More... | |
Cache (const Cache< KEYTYPE, VALUETYPE > &src) | |
Copy constructor (mutex cannot be copied) More... | |
void | clear () |
Clears the cache. More... | |
bool | getCache (const KEYTYPE &key, VALUETYPE &value) const |
Attempts to retrieve a value from the cache, with optional cache stats tracking. More... | |
int | hitCount () |
total number of times the cache has contained the requested information More... | |
double | hitRatio () |
total number of times the cache has contained the requested information/the total number of requests More... | |
int | missCount () |
total number of times the cache has contained the requested information More... | |
Cache< KEYTYPE, VALUETYPE > & | operator= (const Cache< KEYTYPE, VALUETYPE > &rhs) |
Copy-assignment operator as we have a non-default copy constructor. More... | |
void | removeCache (const KEYTYPE &key) |
Attempts to remove a value from the cache. More... | |
void | setCache (const KEYTYPE &key, const VALUETYPE &value) |
Inserts/updates a cached value with the given key. More... | |
int | size () |
The number of cache entries. More... | |
Private Types | |
using | CacheMapConstIterator = typename std::map< KEYTYPE, VALUETYPE >::const_iterator |
const_iterator typedef More... | |
using | CacheMapIterator = typename std::map< KEYTYPE, VALUETYPE >::iterator |
iterator typedef More... | |
Private Member Functions | |
bool | getCacheNoStats (const KEYTYPE key, VALUETYPE &value) const |
Attempts to retrieve a value from the cache. More... | |
Private Attributes | |
int | m_cacheHit |
total number of times the cache has contained the requested information More... | |
std::map< KEYTYPE, VALUETYPE > | m_cacheMap |
internal cache map More... | |
int | m_cacheMiss |
total number of times the cache has not contained the requested information More... | |
std::mutex | m_mutex |
internal mutex More... | |
Cache is a generic caching storage class.
|
private |
|
private |
|
inline |
|
inline |
|
inline |
|
inline |
Attempts to retrieve a value from the cache, with optional cache stats tracking.
key | The key for the requested value |
value | An output reference for the value, set to the curretn value if found, otherwise it is untouched |
Definition at line 98 of file Cache.h.
References PARALLEL_ATOMIC, and value.
|
inlineprivate |
Attempts to retrieve a value from the cache.
key | The key for the requested value |
value | An output reference for the value, set to the curretn value if found, otherwise it is untouched |
Definition at line 132 of file Cache.h.
References value.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
mutableprivate |
|
private |
|
mutableprivate |
|
mutableprivate |