MCPcopy Create free account
hub / github.com/computationalpathologygroup/ASAP / evict

Method evict

ASAP/WSITileGraphicsItemCache.cpp:8–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6}
7
8void WSITileGraphicsItemCache::evict() {
9 // Identify least recently used key
10 std::map<keyType, std::pair<std::pair<WSITileGraphicsItem*, unsigned int>, keyTypeList::iterator> >::iterator it = _cache.find(_LRU.front());
11
12 // Erase both elements to completely purge record
13 WSITileGraphicsItem* itemToEvict = it->second.first.first;
14 _cacheCurrentByteSize -= it->second.first.second;
15 _cache.erase(it);
16 _LRU.pop_front();
17 emit itemEvicted(itemToEvict);
18}
19
20void WSITileGraphicsItemCache::clear() {
21 _cache.clear();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected