44 this->insertToQueue(i,
true);
49 LruPolicy::doAfterRefresh(
EntryRef i)
51 this->insertToQueue(i,
false);
57 m_queue.get<1>().erase(i);
63 this->insertToQueue(i,
false);
67 LruPolicy::evictEntries()
69 BOOST_ASSERT(this->
getCs() !=
nullptr);
71 BOOST_ASSERT(!m_queue.empty());
79 LruPolicy::insertToQueue(
EntryRef i,
bool isNewEntry)
84 std::tie(it, isNew) = m_queue.push_back(i);
86 BOOST_ASSERT(isNew == isNewEntry);
88 m_queue.relocate(m_queue.end(), it);
#define NFD_REGISTER_CS_POLICY(P)
registers a CS policy
Least-Recently-Used (LRU) replacement policy.
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
static const std::string POLICY_NAME
size_t getLimit() const
gets hard limit (in number of entries)
represents a CS replacement policy
Table::const_iterator EntryRef
a reference to an CS entry
Cs * getCs() const
gets cs
signal::Signal< Policy, EntryRef > beforeEvict
emits when an entry is being evicted