Poco

template < class TKey, class TValue >

class StrategyCollection

File Information

Library: Foundation
Package: Cache
Header: Poco/StrategyCollection.h

Description

An StrategyCollection is a decorator masking n collections as a single one.

Inheritance

Direct Base Classes: AbstractStrategy < TKey, TValue >

All Base Classes: AbstractStrategy < TKey, TValue >

Member Summary

Member Functions: onAdd, onClear, onGet, onIsValid, onRemove, onReplace, popBack, pushBack

Types Aliases

ConstIterator

using ConstIterator = typename Strategies::const_iterator;

Iterator

using Iterator = typename Strategies::iterator;

Strategies

using Strategies = std::vector < SharedPtr < AbstractStrategy < TKey, TValue >> >;

Constructors

StrategyCollection inline

StrategyCollection();

Destructor

~StrategyCollection inline

~StrategyCollection();

Member Functions

onAdd inline

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.

onClear inline

void onClear(
    const void * pSender,
    const EventArgs & args
);

onGet inline

void onGet(
    const void * pSender,
    const TKey & key
);

onIsValid inline

void onIsValid(
    const void * pSender,
    ValidArgs < TKey > & key
);

onRemove inline

void onRemove(
    const void * pSender,
    const TKey & key
);

Removes an entry from the strategy. If the entry is not found the remove is ignored.

onReplace inline

void onReplace(
    const void * pSender,
    std::set < TKey > & elemsToRemove
);

popBack inline

void popBack();

Removes the last added AbstractStrategy from the collection.

pushBack inline

void pushBack(
    AbstractStrategy < TKey, TValue > * pStrat
);

Adds an AbstractStrategy to the collection. Class takes ownership of pointer

Variables

_strategies protected

Strategies _strategies;

Securely control IoT edge devices from anywhere   Connect a Device