Cachemere
Modular Caching Library for C++
|
Simplest insertion policy. Always accepts insertions. More...
#include <insertion_always.h>
Public Member Functions | |
void | clear () |
Clears the policy. | |
bool | should_add (const Key &key) |
Determines whether a given key should be inserted into the cache. More... | |
bool | should_replace (const Key &victim, const Key &candidate) |
Determines whether a given victim should be replaced by a given candidate. More... | |
Simplest insertion policy. Always accepts insertions.
Key | The type of the keys used to identify items in the cache. |
KeyHash | The type of the hasher used to hash item keys. |
Value | The type of the values stored in the cache. |
bool cachemere::policy::InsertionAlways< Key, KeyHash, Value >::should_add | ( | const Key & | key | ) |
Determines whether a given key should be inserted into the cache.
For this policy, should_add
always returns true.
key | The key of the insertion candidate. |
bool cachemere::policy::InsertionAlways< Key, KeyHash, Value >::should_replace | ( | const Key & | victim, |
const Key & | candidate | ||
) |
Determines whether a given victim should be replaced by a given candidate.
For this policy, should_replace
always returns true.
victim | The key of the victim the candidate will be compared to. |
candidate | The key of the insertion candidate. |