|
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 55 of file LruCache.h.
Referenced by VFS::find(), PosixSubsystem::findFile(), and VFS::lookupFilesystem().
Here is the caller graph for this function:
|
inline |
Store an item as the most recently used item.
Definition at line 78 of file LruCache.h.
Referenced by VFS::find(), PosixSubsystem::findFile(), and VFS::lookupFilesystem().
Here is the caller graph for this function:
1.8.11