ZNC
trunk
|
A CJob version which can be safely used in modules. More...
#include <Modules.h>
Public Types | |
enum | EJobState { READY , RUNNING , DONE , CANCELLED } |
Public Member Functions | |
CModuleJob (CModule *pModule, const CString &sName, const CString &sDesc) | |
virtual | ~CModuleJob () |
CModuleJob (const CModuleJob &)=delete | |
CModuleJob & | operator= (const CModuleJob &)=delete |
CModule * | GetModule () const |
const CString & | GetName () const |
const CString & | GetDescription () const |
virtual void | runThread ()=0 |
This function is called in a separate thread and can do heavy, blocking work. More... | |
virtual void | runMain ()=0 |
This function is called from the main thread after runThread() finishes. More... | |
bool | wasCancelled () const |
This can be used to check if the job was cancelled. More... | |
Protected Attributes | |
CModule * | m_pModule |
const CString | m_sName |
const CString | m_sDescription |
A CJob version which can be safely used in modules.
The job will be cancelled when the module is unloaded.
|
inherited |
|
virtual |
|
delete |
|
inline |
|
delete |
|
pure virtualinherited |
This function is called from the main thread after runThread() finishes.
It can be used to handle the results from runThread() without needing synchronization primitives.
|
pure virtualinherited |
This function is called in a separate thread and can do heavy, blocking work.
|
inherited |
This can be used to check if the job was cancelled.
For example, runThread() can return early if this returns true.
|
protected |
|
protected |
Referenced by GetDescription().