|
The Pedigree Project 0.1
|
LruCache provides a least-recently-used cache abstraction. More...
#include <LruCache.h>
Inheritance diagram for LruCache< K, T, Slots >:
Collaboration diagram for LruCache< K, T, Slots >:Classes | |
| struct | Slot |
Public Member Functions | |
| bool | get (const K &key, T &object) |
| void | store (const K &key, const T &object) |
| size_t | hits () const |
| size_t | misses () const |
Private Attributes | |
| Slot | m_Slots [Slots] |
| size_t | m_Hits = 0 |
| size_t | m_Misses = 0 |
LruCache provides a least-recently-used cache abstraction.
A key type is used to find items within the cache.
It is recommended that the type T is relatively small and has a low cost to copy (a scalar type is best) for maximum performance.
Definition at line 38 of file LruCache.h.
|
inline |
Potentially get an item with the given key.
Definition at line 53 of file LruCache.h.
|
inline |
Definition at line 87 of file LruCache.h.
|
inline |
Definition at line 91 of file LruCache.h.
|
inline |
Store an item as the most recently used item.
Definition at line 71 of file LruCache.h.
|
private |
Definition at line 98 of file LruCache.h.
|
private |
Definition at line 99 of file LruCache.h.
|
private |
Definition at line 96 of file LruCache.h.