Class LruCache¶
-
template<typename
key_t
, typenamevalue_t
, classhash_t
= std::hash<key_t>>
classLruCache
¶ Public Types
-
template<>
usingconst_list_iterator_t
= typename cache_list_t::const_iterator¶
Public Functions
-
LruCache
(const size_t max_size)¶
-
void
put
(const key_t &key, value_t &&value)¶
-
void
put
(const key_t &key, const value_t &value)¶
-
value_t *
get
(const key_t &key)¶
-
const_list_iterator_t
find
(const key_t &key) const¶
-
const_list_iterator_t
cend
() const¶
-
void
clear
()¶
-
void
evictFractionEntries
(const float fraction)¶
-
void
evictNEntries
(const size_t n)¶
-
size_t
size
() const¶
Private Types
-
template<>
usingkey_value_pair_t
= typename std::pair<key_t, value_t>¶
-
template<>
usingcache_list_t
= typename std::list<key_value_pair_t>¶
-
template<>
usinglist_iterator_t
= typename cache_list_t::iterator¶
-
template<>
usingmap_t
= typename std::unordered_map<key_t, list_iterator_t, hash_t>¶
-
template<>