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

#include <lfu_cache_policy.hpp>

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

Public Types

using lfu_iterator = typename std::multimap< std::size_t, Key >::iterator
 

Public Member Functions

 LFUCachePolicy ()=default
 
 ~LFUCachePolicy () override=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::multimap< std::size_t, Key > frequency_storage
 
std::unordered_map< Key, lfu_iteratorlfu_storage
 

Member Typedef Documentation

◆ lfu_iterator

template<typename Key >
using caches::LFUCachePolicy< Key >::lfu_iterator = typename std::multimap<std::size_t, Key>::iterator

Constructor & Destructor Documentation

◆ LFUCachePolicy()

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

◆ ~LFUCachePolicy()

template<typename Key >
caches::LFUCachePolicy< Key >::~LFUCachePolicy ( )
overridedefault

Member Function Documentation

◆ Clear()

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

◆ Erase()

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

◆ Insert()

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

◆ ReplCandidate()

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

◆ Touch()

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

Member Data Documentation

◆ frequency_storage

template<typename Key >
std::multimap<std::size_t, Key> caches::LFUCachePolicy< Key >::frequency_storage
private

◆ lfu_storage

template<typename Key >
std::unordered_map<Key, lfu_iterator> caches::LFUCachePolicy< Key >::lfu_storage
private

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