Electroneum
Public Types | Public Member Functions | Private Attributes | List of all members
caches::LRUCachePolicy< Key > Class Template Reference

#include <lru_cache_policy.hpp>

Inheritance diagram for caches::LRUCachePolicy< Key >:
Inheritance graph
[legend]
Collaboration diagram for caches::LRUCachePolicy< Key >:
Collaboration graph
[legend]

Public Types

using lru_iterator = typename std::list< Key >::const_iterator
 

Public Member Functions

 LRUCachePolicy ()=default
 
 ~LRUCachePolicy ()=default
 
void Insert (const Key &key) override
 
void Touch (const Key &key) override
 
void Erase (const Key &key) override
 
const Key & ReplCandidate () const override
 
void Clear () override
 
- Public Member Functions inherited from caches::ICachePolicy< Key >
virtual ~ICachePolicy ()
 

Private Attributes

std::list< Key > lru_queue
 
std::unordered_map< Key, lru_iteratorkey_finder
 

Member Typedef Documentation

◆ lru_iterator

template<typename Key >
using caches::LRUCachePolicy< Key >::lru_iterator = typename std::list<Key>::const_iterator

Constructor & Destructor Documentation

◆ LRUCachePolicy()

template<typename Key >
caches::LRUCachePolicy< Key >::LRUCachePolicy ( )
default

◆ ~LRUCachePolicy()

template<typename Key >
caches::LRUCachePolicy< Key >::~LRUCachePolicy ( )
default

Member Function Documentation

◆ Clear()

template<typename Key >
void caches::LRUCachePolicy< Key >::Clear ( )
inlineoverridevirtual

◆ Erase()

template<typename Key >
void caches::LRUCachePolicy< Key >::Erase ( const Key &  key)
inlineoverridevirtual

◆ Insert()

template<typename Key >
void caches::LRUCachePolicy< Key >::Insert ( const Key &  key)
inlineoverridevirtual

◆ ReplCandidate()

template<typename Key >
const Key& caches::LRUCachePolicy< Key >::ReplCandidate ( ) const
inlineoverridevirtual

◆ Touch()

template<typename Key >
void caches::LRUCachePolicy< Key >::Touch ( const Key &  key)
inlineoverridevirtual

Member Data Documentation

◆ key_finder

template<typename Key >
std::unordered_map<Key, lru_iterator> caches::LRUCachePolicy< Key >::key_finder
private

◆ lru_queue

template<typename Key >
std::list<Key> caches::LRUCachePolicy< Key >::lru_queue
private

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