Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
Callback interface for asynchronous jobs. More...
#include <Job.h>
Public Member Functions | |
virtual | ~IJobCallback ()=default |
Destructor for job call back objects. | |
virtual void | OnJobComplete (unsigned int jobID, bool success, CJob *job)=0 |
The callback used when a job completes. | |
virtual void | OnJobAbort (unsigned int jobID, CJob *job) |
An optional callback function used when a job will be aborted. | |
virtual void | OnJobProgress (unsigned int jobID, unsigned int progress, unsigned int total, const CJob *job) |
An optional callback function that a job may call while processing. | |
Callback interface for asynchronous jobs.
Used by clients of the CJobManager to receive progress, abort and completion notification of jobs. Clients of small jobs wishing to perform actions on job completion or abort should implement the IJobCallback::OnJobComplete() and/or IJobCallback::OnJobAbort() function. Clients of larger jobs may choose to implement the IJobCallback::OnJobProgress() function in order to be kept informed of progress.
|
virtualdefault |
Destructor for job call back objects.
An optional callback function used when a job will be aborted.
OnJobAbort is called whenever a job gets aborted before or while being executed. Job's DoWork method will not be called, OnJobComplete will not be called. The job instance will be destroyed by the caller after calling this function.
jobID | the unique id of the job (as retrieved from CJobManager::AddJob) |
job | the job that has been aborted. |
Reimplemented in CJobQueue.
|
pure virtual |
The callback used when a job completes.
OnJobComplete is called at the completion of the job's DoWork() function, and is used to return information to the caller on the result of the job. On returning form this function the CJobManager will destroy this job.
jobID | the unique id of the job (as retrieved from CJobManager::AddJob) |
success | the result from the DoWork call |
job | the job that has been processed. The job will be destroyed after this function returns |
Implemented in ADDON::CAddonInstaller, CDirectoryProvider, CGUIDialogSubtitles, CGUILargeTextureManager, CGUIMultiImage, CGUIWindowFileManager, CGUIWindowHome, CInfoLoader, CJobQueue, CMediaManager, CMusicLibraryQueue, CSysInfo, CVideoLibraryQueue, CWakeOnAccess, CWeatherManager, KODI::CDRIP::CCDDARipper, PAPlayer, and PingResponseWaiter.
|
inlinevirtual |
An optional callback function that a job may call while processing.
OnJobProgress may be called periodically by a job during it's DoWork() function. It is used by the job to report on progress.
jobID | the unique id of the job (as retrieved from CJobManager::AddJob) |
progress | the current progress of the job, out of total. |
total | the total amount of work to be processed. |
job | the job that has been processed. |
Reimplemented in ADDON::CAddonInstaller.