OmniSciDB
a5dc49c757
|
#include <LruCache.h>
Public Types | |
using | const_list_iterator_t = typename cache_list_t::const_iterator |
Public Member Functions | |
LruCache (EvictionMetricType eviction_metric_type, const size_t max_size) | |
size_t | put (const key_t &key, value_t &&value) |
size_t | put (const key_t &key, const value_t &value) |
void | erase (const key_t &key) |
value_t * | get (const key_t &key) |
const_list_iterator_t | find (const key_t &key) const |
const_list_iterator_t | cbegin () const |
const_list_iterator_t | cend () const |
void | clear () |
size_t | computeNumEntriesToEvict (const float fraction) |
size_t | 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 | |
size_t | putCommon (map_t_iterator &it, key_t const &key) |
size_t | evictCommon (const size_t entries_to_evict) |
size_t | getValueSize (const value_t &value) |
size_t | getValueSize (const list_iterator_t &it) |
Private Attributes | |
cache_list_t | cache_items_list_ |
map_t | cache_items_map_ |
EvictionMetricType | eviction_metric_type_ |
size_t | max_size_ |
size_t | total_byte_size_ |
Definition at line 25 of file LruCache.h.
|
private |
Definition at line 28 of file LruCache.h.
using LruCache< key_t, value_t, hash_t >::const_list_iterator_t = typename cache_list_t::const_iterator |
Definition at line 70 of file LruCache.h.
|
private |
Definition at line 27 of file LruCache.h.
|
private |
Definition at line 29 of file LruCache.h.
|
private |
Definition at line 30 of file LruCache.h.
|
private |
Definition at line 31 of file LruCache.h.
|
inline |
Definition at line 34 of file LruCache.h.
|
inline |
Definition at line 81 of file LruCache.h.
|
inline |
Definition at line 83 of file LruCache.h.
Referenced by LruCache< CompilationContext >::find().
|
inline |
Definition at line 85 of file LruCache.h.
|
inline |
Definition at line 91 of file LruCache.h.
|
inline |
Definition at line 53 of file LruCache.h.
|
inlineprivate |
Definition at line 133 of file LruCache.h.
Referenced by LruCache< CompilationContext >::evictNEntries().
|
inline |
Definition at line 99 of file LruCache.h.
|
inline |
Definition at line 72 of file LruCache.h.
|
inline |
Definition at line 62 of file LruCache.h.
|
inlineprivate |
Definition at line 146 of file LruCache.h.
Referenced by LruCache< CompilationContext >::erase(), LruCache< CompilationContext >::evictCommon(), LruCache< CompilationContext >::put(), and LruCache< CompilationContext >::putCommon().
|
inlineprivate |
Definition at line 155 of file LruCache.h.
Referenced by LruCache< CompilationContext >::getValueSize().
|
inline |
Definition at line 39 of file LruCache.h.
|
inline |
Definition at line 46 of file LruCache.h.
|
inlineprivate |
Definition at line 108 of file LruCache.h.
Referenced by LruCache< CompilationContext >::put().
|
inline |
Definition at line 101 of file LruCache.h.
|
private |
Definition at line 157 of file LruCache.h.
Referenced by LruCache< CompilationContext >::cbegin(), LruCache< CompilationContext >::cend(), LruCache< CompilationContext >::clear(), LruCache< CompilationContext >::erase(), LruCache< CompilationContext >::evictCommon(), LruCache< CompilationContext >::get(), LruCache< CompilationContext >::put(), LruCache< CompilationContext >::putCommon(), and LruCache< CompilationContext >::size().
|
private |
Definition at line 158 of file LruCache.h.
Referenced by LruCache< CompilationContext >::clear(), LruCache< CompilationContext >::computeNumEntriesToEvict(), LruCache< CompilationContext >::erase(), LruCache< CompilationContext >::evictCommon(), LruCache< CompilationContext >::find(), LruCache< CompilationContext >::get(), LruCache< CompilationContext >::put(), and LruCache< CompilationContext >::putCommon().
|
private |
Definition at line 159 of file LruCache.h.
Referenced by LruCache< CompilationContext >::putCommon(), and LruCache< CompilationContext >::size().
|
private |
Definition at line 160 of file LruCache.h.
Referenced by LruCache< CompilationContext >::putCommon().
|
private |
Definition at line 161 of file LruCache.h.
Referenced by LruCache< CompilationContext >::clear(), LruCache< CompilationContext >::erase(), LruCache< CompilationContext >::evictCommon(), LruCache< CompilationContext >::put(), LruCache< CompilationContext >::putCommon(), and LruCache< CompilationContext >::size().