Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
IJobCallback Class Referenceabstract

Callback interface for asynchronous jobs. More...

#include <Job.h>

Inheritance diagram for IJobCallback:
ADDON::CAddonInstaller ADDON::CRepositoryUpdater CDirectoryProvider CGUILargeTextureManager CGUIMultiImage CGUIWindowHome CInfoLoader CJobQueue CMediaManager CWakeOnAccess PAPlayer PingResponseWaiter

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.
 

Detailed Description

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.

See also
CJobManager and CJob

Constructor & Destructor Documentation

◆ ~IJobCallback()

virtual IJobCallback::~IJobCallback ( )
virtualdefault

Destructor for job call back objects.

See also
CJobManager and CJob

Member Function Documentation

◆ OnJobAbort()

virtual void IJobCallback::OnJobAbort ( unsigned int jobID,
CJob * job )
inlinevirtual

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.

Parameters
jobIDthe unique id of the job (as retrieved from CJobManager::AddJob)
jobthe job that has been aborted.
See also
CJobManager and CJob

Reimplemented in CJobQueue.

◆ OnJobComplete()

virtual void IJobCallback::OnJobComplete ( unsigned int jobID,
bool success,
CJob * job )
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.

Parameters
jobIDthe unique id of the job (as retrieved from CJobManager::AddJob)
successthe result from the DoWork call
jobthe job that has been processed. The job will be destroyed after this function returns
See also
CJobManager and CJob

Implemented in ADDON::CAddonInstaller, KODI::CDRIP::CCDDARipper, PAPlayer, CGUILargeTextureManager, CGUIMultiImage, CDirectoryProvider, CMusicLibraryQueue, PingResponseWaiter, CWakeOnAccess, CMediaManager, CInfoLoader, CJobQueue, CSysInfo, CGUIDialogSubtitles, CVideoLibraryQueue, CWeatherManager, CGUIWindowFileManager, and CGUIWindowHome.

◆ OnJobProgress()

virtual void IJobCallback::OnJobProgress ( unsigned int jobID,
unsigned int progress,
unsigned int total,
const CJob * job )
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.

Parameters
jobIDthe unique id of the job (as retrieved from CJobManager::AddJob)
progressthe current progress of the job, out of total.
totalthe total amount of work to be processed.
jobthe job that has been processed.
See also
CJobManager and CJob

Reimplemented in ADDON::CAddonInstaller.


The documentation for this class was generated from the following file: