Cachemere
Modular Caching Library for C++
insertion_always.hpp
1 namespace cachemere::policy {
2 
3 template<typename Key, typename KeyHash, typename Value> void InsertionAlways<Key, KeyHash, Value>::clear()
4 {
5 }
6 
7 template<typename Key, typename KeyHash, typename Value> bool InsertionAlways<Key, KeyHash, Value>::should_add(const Key& /* key */)
8 {
9  return true;
10 }
11 
12 template<typename Key, typename KeyHash, typename Value>
13 bool InsertionAlways<Key, KeyHash, Value>::should_replace(const Key& /* key */, const Key& /* candidate */)
14 {
15  return true;
16 }
17 
18 } // namespace cachemere::policy
cachemere::policy::InsertionAlways::should_replace
bool should_replace(const Key &victim, const Key &candidate)
Determines whether a given victim should be replaced by a given candidate.
Definition: insertion_always.hpp:13
cachemere::policy::InsertionAlways::clear
void clear()
Clears the policy.
Definition: insertion_always.hpp:3
cachemere::policy::InsertionAlways::should_add
bool should_add(const Key &key)
Determines whether a given key should be inserted into the cache.
Definition: insertion_always.hpp:7