template class Poco::Util::TimerTaskAdapter

Overview

This class template simplifies the implementation of TimerTask objects by allowing a member function of an object to be called as task. Moreā€¦

#include <TimerTaskAdapter.h>

template <class C>
class TimerTaskAdapter: public Poco::Util::TimerTask
{
public:
    // typedefs

    typedef void(C::* Callback)(TimerTask &);

    // construction

    TimerTaskAdapter(
        C& object,
        Callback method
        );

    // methods

    virtual
    void
    run();
};

Inherited Members

public:
    // typedefs

    typedef Poco::AutoPtr<TimerTask> Ptr;

    // methods

    void
    duplicate() const;

    void
    release() const;

    int
    referenceCount() const;

    virtual
    void
    run() = 0;

    void
    cancel();

    bool
    isCancelled() const;

    Poco::Timestamp
    lastExecution() const;

Detailed Documentation

This class template simplifies the implementation of TimerTask objects by allowing a member function of an object to be called as task.

Construction

TimerTaskAdapter(
    C& object,
    Callback method
    )

Creates the TimerTaskAdapter, using the given object and its member function as task target.

The member function must accept one argument, a reference to a TimerTask object.

Methods

virtual
void
run()

Do whatever the thread needs to do.

Must be overridden by subclasses.