OmniSciDB
c1a53651b2
|
#include <LruCache.hpp>
Public Types | |
using | const_list_iterator_t = typename cache_list_t::const_iterator |
Public Member 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 | |
using | key_value_pair_t = typename std::pair< key_t, value_t > |
using | cache_list_t = typename std::list< key_value_pair_t > |
using | list_iterator_t = typename cache_list_t::iterator |
using | map_t = typename std::unordered_map< key_t, list_iterator_t, hash_t > |
using | map_t_iterator = typename map_t::iterator |
Private Member Functions | |
void | putCommon (map_t_iterator &it, key_t const &key) |
void | evictCommon (const size_t entries_to_evict) |
Private Attributes | |
cache_list_t | cache_items_list_ |
map_t | cache_items_map_ |
size_t | max_size_ |
Definition at line 16 of file LruCache.hpp.
|
private |
Definition at line 19 of file LruCache.hpp.
using LruCache< key_t, value_t, hash_t >::const_list_iterator_t = typename cache_list_t::const_iterator |
Definition at line 47 of file LruCache.hpp.
|
private |
Definition at line 18 of file LruCache.hpp.
|
private |
Definition at line 20 of file LruCache.hpp.
|
private |
Definition at line 21 of file LruCache.hpp.
|
private |
Definition at line 22 of file LruCache.hpp.
|
inline |
Definition at line 25 of file LruCache.hpp.
|
inline |
Definition at line 58 of file LruCache.hpp.
Referenced by LruCache< CompilationContext >::find().
|
inline |
Definition at line 60 of file LruCache.hpp.
|
inlineprivate |
Definition at line 96 of file LruCache.hpp.
Referenced by LruCache< CompilationContext >::evictFractionEntries(), and LruCache< CompilationContext >::evictNEntries().
|
inline |
Definition at line 65 of file LruCache.hpp.
|
inline |
Definition at line 73 of file LruCache.hpp.
|
inline |
Definition at line 49 of file LruCache.hpp.
|
inline |
Definition at line 39 of file LruCache.hpp.
|
inline |
Definition at line 27 of file LruCache.hpp.
|
inline |
Definition at line 33 of file LruCache.hpp.
|
inlineprivate |
Definition at line 81 of file LruCache.hpp.
Referenced by LruCache< CompilationContext >::put().
|
inline |
Definition at line 78 of file LruCache.hpp.
|
private |
Definition at line 107 of file LruCache.hpp.
Referenced by LruCache< CompilationContext >::cend(), LruCache< CompilationContext >::clear(), LruCache< CompilationContext >::evictCommon(), LruCache< CompilationContext >::get(), LruCache< CompilationContext >::put(), LruCache< CompilationContext >::putCommon(), and LruCache< CompilationContext >::size().
|
private |
Definition at line 108 of file LruCache.hpp.
Referenced by LruCache< CompilationContext >::clear(), LruCache< CompilationContext >::evictCommon(), LruCache< CompilationContext >::evictFractionEntries(), LruCache< CompilationContext >::evictNEntries(), LruCache< CompilationContext >::find(), LruCache< CompilationContext >::get(), LruCache< CompilationContext >::put(), and LruCache< CompilationContext >::putCommon().
|
private |
Definition at line 109 of file LruCache.hpp.
Referenced by LruCache< CompilationContext >::putCommon().