|
| 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...
|
|
template<class KEYTYPE, class VALUETYPE>
class Mantid::Kernel::Cache< KEYTYPE, VALUETYPE >
Cache is a generic caching storage class.
- Author
- Nick Draper, Tessella Support Services plc
- Date
- 20/10/2009
Definition at line 27 of file Cache.h.
template<class KEYTYPE , class VALUETYPE >
bool Mantid::Kernel::Cache< KEYTYPE, VALUETYPE >::getCache |
( |
const KEYTYPE & |
key, |
|
|
VALUETYPE & |
value |
|
) |
| const |
|
inline |
Attempts to retrieve a value from the cache, with optional cache stats tracking.
- See also
- USE_CACHE_STATS compiler define
- Parameters
-
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 |
- Returns
- True if the value was found, false otherwise
Definition at line 98 of file Cache.h.
References PARALLEL_ATOMIC, and value.