1
#ifndef CBTHREADEDTASK_H
2
#define CBTHREADEDTASK_H
4
/// This is what you have to use instead of wxThread to add tasks to the Thread Pool.
5
/// It has a reduced, but similar, interface like that of wxThread.
6
/// Just be sure to override Execute (like wxThread's Entry) and test every now and then
11
/// cbThreadedTask ctor
14
/// cbThreadedTask dtor
15
virtual ~cbThreadedTask() = 0;
17
/// This function is called to tell the task to abort (check cbThreadPool::AbortAllTasks)
20
/// Override this function with the task's job
21
/// Return value doesn't matter
22
virtual int Execute() = 0;
25
/// Be sure to call this function often. If it returns true, quit your task quickly
26
bool TestDestroy() const;
28
/// Same as TestDestroy()
35
/* ************************************************ */
36
/* **************** INLINE MEMBERS **************** */
37
/* ************************************************ */
39
inline cbThreadedTask::cbThreadedTask()
45
inline cbThreadedTask::~cbThreadedTask()
50
inline bool cbThreadedTask::TestDestroy() const
55
inline bool cbThreadedTask::Aborted() const
60
inline void cbThreadedTask::Abort()