Library: Foundation
Package: Cache
Header: Poco/StrategyCollection.h
An StrategyCollection is a decorator masking n collections as a single one.
Direct Base Classes: AbstractStrategy < TKey, TValue >
All Base Classes: AbstractStrategy < TKey, TValue >
Member Functions: onAdd, onClear, onGet, onIsValid, onRemove, onReplace, popBack, pushBack
typedef typename Strategies::const_iterator ConstIterator;
typedef typename Strategies::iterator Iterator;
typedef std::vector < SharedPtr < AbstractStrategy < TKey, TValue > > > Strategies;
void onAdd(
const void * pSender,
const KeyValueArgs < TKey, TValue > & key
);
Adds the key to the strategy. If for the key already an entry exists, it will be overwritten.
void onClear(
const void * pSender,
const EventArgs & args
);
void onGet(
const void * pSender,
const TKey & key
);
void onIsValid(
const void * pSender,
ValidArgs < TKey > & key
);
void onRemove(
const void * pSender,
const TKey & key
);
Removes an entry from the strategy. If the entry is not found the remove is ignored.
void onReplace(
const void * pSender,
std::set < TKey > & elemsToRemove
);
void popBack();
Removes the last added AbstractStrategy from the collection.
void pushBack(
AbstractStrategy < TKey, TValue > * pStrat
);
Adds an AbstractStrategy to the collection. Class takes ownership of pointer
Strategies _strategies;