![]() |
|
A simple cache with a fixed capacity and a least-recently-used eviction policy. More...
#include <lruCache.h>
Public Member Functions | |
| VdfLRUCache (const VdfLRUCache &)=delete | |
| VdfLRUCache & | operator= (const VdfLRUCache &)=delete |
| VdfLRUCache (VdfLRUCache &&)=delete | |
| VdfLRUCache & | operator= (VdfLRUCache &&)=delete |
| VdfLRUCache (size_t capacity) | |
Constructs a new cache with a fixed capacity. | |
| bool | Lookup (const Key &key, Value **value) |
Performs a lookup into the cache and returns true if the cache contains an entry for the given key. | |
| void | Clear () |
| Removes all entries from the cache. | |
A simple cache with a fixed capacity and a least-recently-used eviction policy.
Definition at line 27 of file lruCache.h.
|
inlineexplicit |
Constructs a new cache with a fixed capacity.
Definition at line 40 of file lruCache.h.
| void Clear |
Removes all entries from the cache.
Definition at line 126 of file lruCache.h.
| bool Lookup | ( | const Key & | key, |
| Value ** | value | ||
| ) |
Performs a lookup into the cache and returns true if the cache contains an entry for the given key.
If the cache does not contain and entry for key, a new entry will be constructed as long as the cache is below capacity. If the cache has reached capacity an existing entry will be repurposed for key. In this case, value will point at the evicted entry. and the client will be resonpsible for resetting value. In all cases, value will always point at a valid instance of Value.
Definition at line 81 of file lruCache.h.