Least-Recently-Used (LRU) replacement policy. More...
#include <cs-policy-lru.hpp>
Public Member Functions | |
LruPolicy () | |
Public Member Functions inherited from nfd::cs::Policy | |
Policy (const std::string &policyName) | |
virtual | ~Policy ()=default |
const std::string & | getName () const |
Cs * | getCs () const |
gets cs More... | |
void | setCs (Cs *cs) |
sets cs More... | |
size_t | getLimit () const |
gets hard limit (in number of entries) More... | |
void | setLimit (size_t nMaxEntries) |
sets hard limit (in number of entries) More... | |
void | afterInsert (EntryRef i) |
invoked by CS after a new entry is inserted More... | |
void | afterRefresh (EntryRef i) |
invoked by CS after an existing entry is refreshed by same Data More... | |
void | beforeErase (EntryRef i) |
invoked by CS before an entry is erased due to management command More... | |
void | beforeUse (EntryRef i) |
invoked by CS before an entry is used to match a lookup More... | |
Static Public Attributes | |
static const std::string | POLICY_NAME = "lru" |
Additional Inherited Members | |
Public Types inherited from nfd::cs::Policy | |
using | EntryRef = Table::const_iterator |
a reference to an CS entry More... | |
Static Public Member Functions inherited from nfd::cs::Policy | |
template<typename P > | |
static void | registerPolicy (const std::string &policyName=P::POLICY_NAME) |
static unique_ptr< Policy > | create (const std::string &policyName) |
static std::set< std::string > | getPolicyNames () |
Public Attributes inherited from nfd::cs::Policy | |
signal::Signal< Policy, EntryRef > | beforeEvict |
emits when an entry is being evicted More... | |
Least-Recently-Used (LRU) replacement policy.
Definition at line 49 of file cs-policy-lru.hpp.
nfd::cs::lru::LruPolicy::LruPolicy | ( | ) |
Definition at line 36 of file cs-policy-lru.cpp.
References nfd::cs::Policy::beforeEvict, emitSignal, nfd::cs::Policy::getCs(), nfd::cs::Policy::getLimit(), and nonstd::span_lite::size().
|
static |
Definition at line 55 of file cs-policy-lru.hpp.