Caches 0.1.0
LRU/LFU/FIFO Caches library
|
Cache policy abstract base class. More...
#include <cache_policy.hpp>
Public Member Functions | |
virtual void | Insert (const Key &key)=0 |
Handle element insertion in a cache. | |
virtual void | Touch (const Key &key)=0 |
Handle request to the key-element in a cache. | |
virtual void | Erase (const Key &key)=0 |
Handle element deletion from a cache. | |
virtual const Key & | ReplCandidate () const =0 |
Return a key of a replacement candidate. | |
Cache policy abstract base class.
Key | Type of a key a policy works with |
|
pure virtual |
Handle element deletion from a cache.
[in] | key | Key that should be used by the policy |
Implemented in caches::LRUCachePolicy< Key >, caches::NoCachePolicy< Key >, caches::FIFOCachePolicy< Key >, and caches::LFUCachePolicy< Key >.
|
pure virtual |
Handle element insertion in a cache.
[in] | key | Key that should be used by the policy |
Implemented in caches::NoCachePolicy< Key >, caches::FIFOCachePolicy< Key >, caches::LFUCachePolicy< Key >, and caches::LRUCachePolicy< Key >.
|
pure virtual |
Return a key of a replacement candidate.
Implemented in caches::NoCachePolicy< Key >, caches::FIFOCachePolicy< Key >, caches::LFUCachePolicy< Key >, and caches::LRUCachePolicy< Key >.
|
pure virtual |
Handle request to the key-element in a cache.
key |
Implemented in caches::NoCachePolicy< Key >, caches::FIFOCachePolicy< Key >, caches::LFUCachePolicy< Key >, and caches::LRUCachePolicy< Key >.