Code::Blocks
SVN r11506
|
This is what you have to use instead of wxThread to add tasks to the Thread Pool. More...
#include <cbthreadedtask.h>
Public Member Functions | |
cbThreadedTask () | |
cbThreadedTask ctor More... | |
virtual | ~cbThreadedTask ()=0 |
cbThreadedTask dtor More... | |
void | Abort () |
This function is called to tell the task to abort (check cbThreadPool::AbortAllTasks) More... | |
virtual int | Execute ()=0 |
Override this function with the task's job Return value doesn't matter. More... | |
Protected Member Functions | |
bool | TestDestroy () const |
Be sure to call this function often. If it returns true, quit your task quickly. More... | |
bool | Aborted () const |
Same as TestDestroy() More... | |
Private Attributes | |
bool | m_abort |
This is what you have to use instead of wxThread to add tasks to the Thread Pool.
It has a reduced, but similar, interface like that of wxThread. Just be sure to override Execute (like wxThread's Entry) and test every now and then for TestDestroy.
Definition at line 13 of file cbthreadedtask.h.
|
inline |
cbThreadedTask ctor
Definition at line 44 of file cbthreadedtask.h.
|
inlinepure virtual |
cbThreadedTask dtor
Definition at line 50 of file cbthreadedtask.h.
|
inline |
This function is called to tell the task to abort (check cbThreadPool::AbortAllTasks)
Definition at line 65 of file cbthreadedtask.h.
References m_abort.
Referenced by cbThreadPool::cbWorkerThread::AbortTask().
|
inlineprotected |
|
pure virtual |
Override this function with the task's job Return value doesn't matter.
Implemented in ParserThread, MarkFileAsLocalThreadedTask, and ParserThreadedTask.
Referenced by cbThreadPool::cbWorkerThread::Entry().
|
inlineprotected |
Be sure to call this function often. If it returns true, quit your task quickly.
Definition at line 55 of file cbthreadedtask.h.
References m_abort.
Referenced by ParserThread::IsStillAlive().
|
private |
Definition at line 37 of file cbthreadedtask.h.
Referenced by Abort(), Aborted(), and TestDestroy().