22 #ifndef NDN_UTIL_IN_MEMORY_STORAGE_LRU_HPP
23 #define NDN_UTIL_IN_MEMORY_STORAGE_LRU_HPP
27 #include <boost/multi_index/member.hpp>
28 #include <boost/multi_index_container.hpp>
29 #include <boost/multi_index/sequenced_index.hpp>
30 #include <boost/multi_index/hashed_index.hpp>
31 #include <boost/multi_index/identity.hpp>
77 typedef boost::multi_index_container<
79 boost::multi_index::indexed_by<
82 boost::multi_index::hashed_unique<
83 boost::multi_index::tag<byEntity>,
84 boost::multi_index::identity<InMemoryStorageEntry*>
88 boost::multi_index::sequenced<
89 boost::multi_index::tag<byUsedTime>
95 CleanupIndex m_cleanupIndex;
101 #endif // NDN_UTIL_IN_MEMORY_STORAGE_LRU_HPP
Copyright (c) 2013-2016 Regents of the University of California.
void afterAccess(InMemoryStorageEntry *entry) override
Update the entry when the entry is returned by the find() function, update the last used time accordi...
void afterInsert(InMemoryStorageEntry *entry) override
Update the entry after a entry is successfully inserted, add it to the cleanupIndex.
Represents in-memory storage.
void beforeErase(InMemoryStorageEntry *entry) override
Update the entry or other data structures before a entry is successfully erased, erase it from the cl...
InMemoryStorageLru(size_t limit=10)
Represents an in-memory storage entry.
#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PROTECTED
bool evictItem() override
Removes one Data packet from in-memory storage based on LRU, i.e.
Provides in-memory storage employing LRU replacement policy, of which the least recently used entry w...