Kodi Documentation 18.0
Kodi is an open source media player and entertainment hub.
IJobCallback Class Referenceabstract

Callback interface for asynchronous jobs. More...

#include <Job.h>

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

Public Member Functions

virtual ~IJobCallback ()=default
 Destructor for job call back objects. More...
 
virtual void OnJobComplete (unsigned int jobID, bool success, CJob *job)=0
 The callback used when a job completes. More...
 
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. More...
 

Detailed Description

Callback interface for asynchronous jobs.

Used by clients of the CJobManager to receive progress and completion notification of jobs. Clients of small jobs wishing to perform actions on job completion should implement the IJobCallback::OnJobComplete() 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

◆ 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 PVR::CPVRChannelEntryTimeoutJob, PVR::CPVRChannelInfoTimeoutJob, CAddonInstaller, CCDDARipper, PAPlayer, CGUILargeTextureManager, CGUIMultiImage, CDirectoryProvider, CMusicLibraryQueue, PingResponseWaiter, CWakeOnAccess, CPictureThumbLoader, CMediaManager, CInfoLoader, CJobQueue, CSysInfo, CGUIDialogSubtitles, CGUIDialogVideoBookmarks, CVideoLibraryQueue, CVideoThumbLoader, 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 CAddonInstaller.


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