Furrballs v0.0.1
A Caching and Storage Solution
Loading...
Searching...
No Matches
ARCPolicy< Key, Value > Class Template Reference

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>

Public Types

typedef void(* EvictionCallback) (Key &)
 

Public Member Functions

 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.
 

Detailed Description

template<class Key, class Value>
class Furrball::ARCPolicy< Key, Value >
See also
S3FIFOPolicy
LRUPolicy
LFUPolicy

Definition at line 132 of file Furrballs.h.

Member Typedef Documentation

◆ EvictionCallback

template<class Key , class Value >
typedef void(* EvictionCallback) (Key &)

Definition at line 134 of file Furrballs.h.

Constructor & Destructor Documentation

◆ ARCPolicy()

template<class Key , class Value >
ARCPolicy ( size_t cap)
inline
Parameters
capCapacity of the cache.

Definition at line 193 of file Furrballs.h.

Member Function Documentation

◆ add()

template<class Key , class Value >
void add ( const Key & key,
const Value & value )
inline

Definition at line 235 of file Furrballs.h.

◆ 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

Definition at line 245 of file Furrballs.h.

◆ set()

template<class Key , class Value >
void set ( const Key & key,
const Value & value )
inline

Definition at line 252 of file Furrballs.h.

◆ setEvictionCallback()

template<class Key , class Value >
void setEvictionCallback ( EvictionCallback cb)
inline

Definition at line 195 of file Furrballs.h.

◆ touch()

template<class Key , class Value >
void touch ( const Key & key)
inline

Definition at line 207 of file Furrballs.h.


The documentation for this class was generated from the following file: