qualcomm/qbox
Loading...
Searching...
No Matches
gs::LRUCache< Key, Value > Class Template Reference
Inheritance diagram for gs::LRUCache< Key, Value >:
Collaboration diagram for gs::LRUCache< Key, Value >:

Public Member Functions

bool get (const Key &key, Value &value) override
 Retrieve value from cache and update LRU order.
void put (const Key &key, const Value &value, uint64_t size) override
 Insert or update value in cache with LRU eviction.
void clear () override
 Clear all cached entries.
uint64_t get_hits () const override
uint64_t get_misses () const override
void reset_stats () override

Member Function Documentation

◆ clear()

template<typename Key, typename Value>
void gs::LRUCache< Key, Value >::clear ( )
inlineoverridevirtual

Clear all cached entries.

Implements gs::AddrMapCacheBase< Key, Value >.

◆ get()

template<typename Key, typename Value>
bool gs::LRUCache< Key, Value >::get ( const Key & key,
Value & value )
inlineoverridevirtual

Retrieve value from cache and update LRU order.

Parameters
keyAddress to look up
valueOutput parameter for the cached value
Returns
true if found in cache, false otherwise

Implements gs::AddrMapCacheBase< Key, Value >.

◆ get_hits()

template<typename Key, typename Value>
uint64_t gs::LRUCache< Key, Value >::get_hits ( ) const
inlineoverridevirtual

◆ get_misses()

template<typename Key, typename Value>
uint64_t gs::LRUCache< Key, Value >::get_misses ( ) const
inlineoverridevirtual

◆ put()

template<typename Key, typename Value>
void gs::LRUCache< Key, Value >::put ( const Key & key,
const Value & value,
uint64_t size )
inlineoverridevirtual

Insert or update value in cache with LRU eviction.

Parameters
keyAddress to cache
valueTarget info to cache

Implements gs::AddrMapCacheBase< Key, Value >.

◆ reset_stats()

template<typename Key, typename Value>
void gs::LRUCache< Key, Value >::reset_stats ( )
inlineoverridevirtual

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