A minimal wrapper around a map class with cache semantics. More...
#include <Cache.h>
Public Types | |
using | key_type = KeyType |
using | value_type = ValueType |
Public Member Functions | |
Modification | |
void | add (const KeyType key, const ValueType value) |
Adds a data value for a key value into the cache. | |
void | invalidate () |
Invalidates the entire cache, removing all stored data. | |
void | invalidate (const KeyType &key) |
Selectively invalidates cache entries. | |
Information | |
boost::optional< const ValueType & > | getOption (const KeyType &key) const |
Fetches a cache entry via an optional. | |
bool | has (const KeyType &key) const |
Tests whether the cache contains an entry for a key. | |
const ValueType & | get (const KeyType &key) const |
Fetches a particular key, assuming that it is currently cached. | |
Private Attributes | |
std::map< KeyType, ValueType > | cache_ |
Cache data. | |
A minimal wrapper around a map class with cache semantics.