template class Poco::ExpirationDecorator

Overview

ExpirationDecorator adds an expiration method to values so that they can be used with the UniqueExpireCache. Moreā€¦

#include <ExpirationDecorator.h>

template <typename TArgs>
class ExpirationDecorator
{
public:
    // construction

    ExpirationDecorator();

    ExpirationDecorator(
        const TArgs& p,
        const Poco::Timespan::TimeDiff& diffInMs
        );

    ExpirationDecorator(
        const TArgs& p,
        const Poco::Timespan& timeSpan
        );

    ExpirationDecorator(
        const TArgs& p,
        const Poco::Timestamp& timeStamp
        );

    // methods

    const Poco::Timestamp&
    getExpiration() const;

    const TArgs&
    value() const;

    TArgs&
    value();
};

Detailed Documentation

ExpirationDecorator adds an expiration method to values so that they can be used with the UniqueExpireCache.

Construction

ExpirationDecorator(
    const TArgs& p,
    const Poco::Timespan::TimeDiff& diffInMs
    )

Creates an element that will expire in diff milliseconds.

ExpirationDecorator(
    const TArgs& p,
    const Poco::Timespan& timeSpan
    )

Creates an element that will expire after the given timeSpan.

ExpirationDecorator(
    const TArgs& p,
    const Poco::Timestamp& timeStamp
    )

Creates an element that will expire at the given time point.