|
Aurore
A Switch-like interface for your app, on every screen
|
#include <aurore/core/cache_helper.hpp>
Public Types | |
| typedef std::list< Node< K, T > >::iterator | CacheIter |
Public Member Functions | |
| LRUCache (size_t c, T defaultValue) | |
| T | get (K key) |
| void | set (K key, T value) |
| void | setMemoryBudget (size_t bytes, std::function< size_t(T)> sizeOf) |
| size_t | getTotalBytes () const |
| size_t | getSize () const |
| void | remove (T value) |
| void | update (T old_val, T new_val) |
| void | setCapacity (int c) |
| void | markDirty (T value) |
| void | markAllDirty () |
| void | trimUnused () |
| std::list< Node< K, T > > & | getCacheList () |
| void | debug () |
Static Public Attributes | |
| static size_t | DEFAULT_CAPACITY = 400 |
| static bool | ALWAYS_CACHE_LOCAL_FILE = true |
LRU cache If the reference count is not 0, the cache will never expire. Cache items with a reference count of 0 are cached according to LRU rules
| typedef std::list<Node<K,T>>::iterator aurore::LRUCache< K, T >::CacheIter |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
A dirty cache is not able to be hit
| value |
|
inline |
It is not really to remove a cache, but to reduce the counter of the corresponding cache by 1
|
inline |
|
inline |
|
inline |
A budget in bytes, on top of the capacity in entries (0: none). Over it, the least recently used entries nothing holds are freed. sizeOf says what an entry weighs.
|
inline |
Delete all cache entries whose reference count has dropped to zero. Call this after releasing images to promptly free GPU memory.
|
inline |
Update a cache value
|
inlinestatic |
|
inlinestatic |