File Information
Library: Foundation
Package: Threading
Header: Poco/ThreadTarget.h
Description
This adapter simplifies using static member functions as well as standalone functions as targets for threads. Note that it is possible to pass those entities directly to Thread::start(). This adapter is provided as a convenience for higher abstraction level scenarios where Runnable abstract class is used.
For using a non-static member function as a thread target, please see the RunnableAdapter class.
Usage:
class MyObject { static void doSomething() {} }; ThreadTarget ra(&MyObject::doSomething); Thread thr; thr.start(ra);
or:
void doSomething() {} ThreadTarget ra(doSomething); Thread thr; thr.start(ra);
Inheritance
Direct Base Classes: Runnable
All Base Classes: Runnable
Member Summary
Member Functions: operator =, run
Inherited Functions: run
Types
Callback
typedef void (* Callback)();
Constructors
ThreadTarget
ThreadTarget(
Callback method
);
ThreadTarget
ThreadTarget(
const ThreadTarget & te
);
Destructor
~ThreadTarget
~ThreadTarget();
Member Functions
operator =
ThreadTarget & operator = (
const ThreadTarget & te
);
run
void run();
See also: Poco::Runnable::run()