44 BOOST_ASSERT(m_cleanupIndex.size() <=
size());
45 CleanupEntry cleanupEntry;
46 cleanupEntry.entry = entry;
47 cleanupEntry.frequency = 0;
48 m_cleanupIndex.insert(cleanupEntry);
54 if (!m_cleanupIndex.get<byFrequency>().empty()) {
57 m_cleanupIndex.get<byFrequency>().
erase(it);
68 if (it != m_cleanupIndex.get<byEntity>().end())
69 m_cleanupIndex.get<byEntity>().erase(it);
76 m_cleanupIndex.get<byEntity>().modify(it, &incrementFrequency);
Copyright (c) 2011-2015 Regents of the University of California.
shared_ptr< const Data > find(const Interest &interest)
Finds the best match Data for an Interest.
virtual bool evictItem()=0
Removes one Data packet from in-memory storage based on derived class implemented replacement policy...
void eraseImpl(const Name &name)
deletes in-memory storage entries by the Name with implicit digest.
Table::const_iterator iterator
virtual ~InMemoryStorageLfu()
InMemoryStorage::const_iterator begin() const
Returns begin iterator of the in-memory storage ordering by name with digest.
virtual void afterAccess(InMemoryStorageEntry *entry)
Update the entry when the entry is returned by the find() function, increment the frequency according...
Represents in-memory storage.
InMemoryStorageLfu(size_t limit=10)
virtual void beforeErase(InMemoryStorageEntry *entry)
Update the entry or other data structures before a entry is successfully erased, erase it from the cl...
virtual void afterInsert(InMemoryStorageEntry *entry)
Update the entry after a entry is successfully inserted, add it to the cleanupIndex.
Represents an in-memory storage entry.
void erase(const Name &prefix, const bool isPrefix=true)
Deletes in-memory storage entry by prefix by default.