Library: Foundation
Package: Cache
Header: Poco/LRUStrategy.h
An LRUStrategy implements least recently used cache replacement.
Direct Base Classes: AbstractStrategy < TKey, TValue >
All Base Classes: AbstractStrategy < TKey, TValue >
Member Functions: onAdd, onClear, onGet, onIsValid, onRemove, onReplace
typedef typename KeyIndex::const_iterator ConstIndexIterator;
typedef typename Keys::const_iterator ConstIterator;
typedef typename KeyIndex::iterator IndexIterator;
typedef typename Keys::iterator Iterator;
typedef std::map < TKey, Iterator > KeyIndex;
typedef std::list < TKey > Keys;
LRUStrategy(
std::size_t size
);
~LRUStrategy();
void onAdd(
const void * param137,
const KeyValueArgs < TKey, TValue > & args
);
void onClear(
const void * param140,
const EventArgs & args
);
void onGet(
const void * param139,
const TKey & key
);
void onIsValid(
const void * param141,
ValidArgs < TKey > & args
);
void onRemove(
const void * param138,
const TKey & key
);
void onReplace(
const void * param142,
std::set < TKey > & elemsToRemove
);
KeyIndex _keyIndex;
For faster access to _keys
Keys _keys;
std::size_t _size;
Number of keys the cache can store.