template class Poco::PriorityExpire

Overview

Decorator for AbstractPriorityDelegate adding automatic expiring of registrations to AbstractPriorityDelegate. More…

#include <PriorityExpire.h>

template <class TArgs>
class PriorityExpire: public Poco::AbstractPriorityDelegate
{
public:
    // construction

    PriorityExpire(
        const AbstractPriorityDelegate<TArgs>& p,
        Timestamp::TimeDiff expireMilliSec
        );

    PriorityExpire(const PriorityExpire& expire);

    // methods

    PriorityExpire&
    operator=(const PriorityExpire& expire);

    virtual
    bool
    notify(
        const void* sender,
        TArgs& arguments
        );

    virtual
    bool
    equals(const AbstractDelegate<TArgs>& other) const;

    virtual
    AbstractPriorityDelegate<TArgs>*
    clone() const;

    virtual
    void
    disable();

    virtual
    const AbstractPriorityDelegate<TArgs>*
    unwrap() const;

protected:
    // fields

    AbstractPriorityDelegate<TArgs>* _pDelegate;
    Timestamp::TimeDiff _expire;
    Timestamp _creationTime;

    // methods

    bool
    expired() const;
};

Inherited Members

public:
    // methods

    virtual
    bool
    notify(
        const void* sender,
        TArgs& arguments
        ) = 0;

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

    virtual
    AbstractDelegate*
    clone() const = 0;

    virtual
    void
    disable() = 0;

    virtual
    const AbstractDelegate*
    unwrap() const;

    int
    priority() const;

protected:
    // fields

    int _priority;

Detailed Documentation

Decorator for AbstractPriorityDelegate adding automatic expiring of registrations to AbstractPriorityDelegate.

Methods

virtual
bool
notify(
    const void* sender,
    TArgs& arguments
    )

Invokes the delegate’s callback function.

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

virtual
bool
equals(const AbstractDelegate<TArgs>& other) const

Compares the AbstractDelegate with the other one for equality.

virtual
AbstractPriorityDelegate<TArgs>*
clone() const

Returns a deep copy of the AbstractDelegate.

virtual
void
disable()

Disables the delegate, which is done prior to removal.

virtual
const AbstractPriorityDelegate<TArgs>*
unwrap() const

Returns the unwrapped delegate.

Must be overridden by decorators like Expire.