template class Poco::Expire<void>

Overview

Decorator for AbstractDelegate adding automatic expiration of registrations to AbstractDelegate ‘s. More…

#include <Expire.h>

template <>
class Expire<void>: public Poco::AbstractDelegate<void>
{
public:
    // construction

    Expire(
        const AbstractDelegate<void>& p,
        Timestamp::TimeDiff expireMillisecs
        );

    Expire(const Expire& expire);

    // methods

    Expire&
    operator=(const Expire& expire);

    virtual
    bool
    notify(const void* sender);

    bool
    equals(const AbstractDelegate<void>& other) const;

    virtual
    AbstractDelegate<void>*
    clone() const;

    virtual
    void
    disable();

    virtual
    const AbstractDelegate<void>*
    unwrap() const;

protected:
    // fields

    AbstractDelegate<void>* _pDelegate;
    Timestamp::TimeDiff _expire;
    Timestamp _creationTime;

    // methods

    bool
    expired() const;
};

Inherited Members

public:
    // methods

    virtual
    bool
    notify(const void* sender) = 0;

    virtual
    bool
    equals(const AbstractDelegate& other) const = 0;

    virtual
    AbstractDelegate*
    clone() const = 0;

    virtual
    void
    disable() = 0;

    virtual
    const AbstractDelegate*
    unwrap() const;

Detailed Documentation

Decorator for AbstractDelegate adding automatic expiration of registrations to AbstractDelegate ‘s.

Methods

virtual
bool
notify(const void* sender)

Invokes the delegate’s callback function.

Returns true if successful, or false if the delegate has been disabled or has expired.

virtual
AbstractDelegate<void>*
clone() const

Returns a deep copy of the AbstractDelegate.

virtual
void
disable()

Disables the delegate, which is done prior to removal.

virtual
const AbstractDelegate<void>*
unwrap() const

Returns the unwrapped delegate.

Must be overridden by decorators like Expire.