Thread job class to manager specific aspects of a job, such as the error state and completion notification. More...
#include <mi32/mithread.h>
Public Types | |
| enum | FLAGS { FLAG_Default = 0x0000, FLAG_Synchronized = 0x0001, FLAG_DeleteWhenCompleted = 0x0002, FLAG_StopIfError = 0x0004 } |
Public Member Functions | |
| JOB (FLAGS flags=FLAG_Default, MISTATUSMANAGER *Manager=0) | |
| virtual | ~JOB ()=0 |
| const ERRORSTATE & | GetErrorState () const |
| FLAGS | GetFlags () const |
| ID | GetID () const |
| void | SetDelegateOnCancelBeforeRun (DELEGATE_VOID_ID delegate) |
| void | SetDelegateOnCompletion (DELEGATE_VOID_ID delegate) |
Protected Member Functions | |
| ERRVALUE | CheckCancel () |
| WORKER * | GetWorker () |
Private Member Functions | |
| virtual void | v_OnCancelBeforeRun () |
| virtual ERRVALUE | v_RunJob ()=0 |
Thread job class to manager specific aspects of a job, such as the error state and completion notification.
| enum MITHREAD::JOB::FLAGS |
| MITHREAD::JOB::JOB | ( | FLAGS | flags = FLAG_Default, |
|
| MISTATUSMANAGER * | Manager = 0 | |||
| ) | [explicit] |
| virtual MITHREAD::JOB::~JOB | ( | ) | [pure virtual] |
Destructor.
| ERRVALUE MITHREAD::JOB::CheckCancel | ( | ) | [protected] |
Check if the WORKER::CancelJob() has been called.
| const ERRORSTATE& MITHREAD::JOB::GetErrorState | ( | ) | const [inline] |
Get the error state for the thread instance generated by the delegate's return value There exists an ERRORSTATE for each thread created to prevent a thread from clobbering the error state of a different thread.
Therefore to transfer the error state from one thread to another, we use the ERRORSTATE class.
| FLAGS MITHREAD::JOB::GetFlags | ( | ) | const [inline] |
Get the flags set for 'this'.
| ID MITHREAD::JOB::GetID | ( | ) | const [inline] |
Get the ID for 'this'.
| WORKER* MITHREAD::JOB::GetWorker | ( | ) | [inline, protected] |
| void MITHREAD::JOB::SetDelegateOnCancelBeforeRun | ( | DELEGATE_VOID_ID | delegate | ) | [inline] |
Set a delegate that gets called when this job is complete.
| void MITHREAD::JOB::SetDelegateOnCompletion | ( | DELEGATE_VOID_ID | delegate | ) | [inline] |
Set a delegate that gets called when this job is complete.
| virtual void MITHREAD::JOB::v_OnCancelBeforeRun | ( | ) | [private, virtual] |
Called if job is cancelled before v_RunJob would be called.
| virtual ERRVALUE MITHREAD::JOB::v_RunJob | ( | ) | [private, pure virtual] |
Do the actual job.
1.6.1