Implements the ARC eviction policy TODO: Implement Adaptive Memory Pooling (AMP) You can create and manage your own cache separately by instantiating a Policy object and using it.
More...
#include <Furrballs.h>
|
| ARCPolicy (size_t cap) |
| Creates a cache following ARC policy.
|
|
void | setEvictionCallback (EvictionCallback cb) |
|
bool | contains (const Key &key) const |
|
void | touch (const Key &key) |
| Promotes a Key.
|
|
void | add (const Key &key, const Value &value) |
| Adds a Key-Value Pair the the cache.
|
|
Value | get (const Key &key) |
| Gets a value from the cache.
|
|
void | set (const Key &key, const Value &value) |
| Changes a value if it exsits or adds it.
|
|
template<class Key, class Value>
class Furrball::ARCPolicy< Key, Value >
- See also
- S3FIFOPolicy
-
LRUPolicy
-
LFUPolicy
Definition at line 132 of file Furrballs.h.
◆ EvictionCallback
template<class Key , class Value >
typedef void(* EvictionCallback) (Key &) |
◆ ARCPolicy()
template<class Key , class Value >
- Parameters
-
cap | Capacity of the cache. |
Definition at line 193 of file Furrballs.h.
◆ add()
template<class Key , class Value >
void add |
( |
const Key & | key, |
|
|
const Value & | value ) |
|
inline |
◆ contains()
template<class Key , class Value >
bool contains |
( |
const Key & | key | ) |
const |
|
inline |
- Returns
- true if the key exists.
Definition at line 201 of file Furrballs.h.
◆ get()
template<class Key , class Value >
Value get |
( |
const Key & | key | ) |
|
|
inline |
◆ set()
template<class Key , class Value >
void set |
( |
const Key & | key, |
|
|
const Value & | value ) |
|
inline |
◆ setEvictionCallback()
template<class Key , class Value >
◆ touch()
template<class Key , class Value >
void touch |
( |
const Key & | key | ) |
|
|
inline |
The documentation for this class was generated from the following file: