Cachemere
Modular Caching Library for C++
insertion_always.h
1 #ifndef CACHEMERE_INSERTION_ALWAYS_H
2 #define CACHEMERE_INSERTION_ALWAYS_H
3 
4 #include <iostream>
5 
6 namespace cachemere::policy {
7 
12 template<typename Key, typename KeyHash, typename Value> class InsertionAlways
13 {
14 public:
16  void clear();
17 
22  bool should_add(const Key& key);
23 
29  bool should_replace(const Key& victim, const Key& candidate);
30 };
31 
32 } // namespace cachemere::policy
33 
34 #include "insertion_always.hpp"
35 
36 #endif
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
Simplest insertion policy. Always accepts insertions.
Definition: insertion_always.h:12
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