10 #include <unordered_map>
23 template <
typename TMass,
typename TScale>
28 size_t genkey(TScale
const& mu2, vector<TMass>
const& m, vector<TScale>
const& p)
const;
36 template<
typename Tkey,
typename Tvalue>
48 typedef typename std::pair<Tkey, Tvalue> key_value_pair_t;
49 typedef typename std::list<key_value_pair_t>::iterator list_iterator_t;
58 void store(Tkey
const& key, Tvalue
const& value);
61 bool get(Tkey
const& key, Tvalue & out);
65 std::list<key_value_pair_t> _cache_list;
66 std::unordered_map<Tkey, list_iterator_t> _cache_map;
LRUCache(int const &size=1)
LRUCache constructor.
Definition: cache.cc:78
The Hasher algorithm container for key generation.
Definition: cache.h:24
void setCacheSize(int const &size)
Set the Cache size.
Definition: cache.cc:97
void store(Tkey const &key, Tvalue const &value)
Store the cached data.
Definition: cache.cc:105
The LRU Cache class.
Definition: cache.h:37
int const & getCacheSize() const
Get the Cache size.
Definition: cache.h:55