ML Reference
ml::GetTileJobBase Class Referenceabstract

Base class for TileRequest based jobs. More...

#include <mlGetTileJob.h>

Inheritance diagram for ml::GetTileJobBase:
ml::GetTileJob ml::ProcessAllPagesJob

Public Member Functions

 GetTileJobBase ()
 
virtual ~GetTileJobBase ()
 
virtual MLErrorCode init (PageRequestProcessor &processor)=0
 Initializes the tile request and add it to the processor if no error occurs.
 
double getProgress () const
 Returns the current progress of the tile request ([0..1] range).
 
bool hasFinished ()
 Returns if the request has finished (If an error happened, true will be returned as well).
 
bool hasError () const
 Returns if the request has an error (and the data is thus unusable/invalid).
 
MLErrorCode getError () const
 Returns the error that happened (return ML_RESULT_OK if everything is ok).
 
void setTileRequestFinishedCB (TileRequestFinishedCB *cb, void *data)
 Sets the tile request finished cb, which is called when the tile is ready.
 
void cancel ()
 Cancels the GetTileJob, this only sets the flag, the real cancellation needs to be done on the PageRequestProcessor.
 
void updateProgress ()
 Called by host to allow custom progress updates.
 
virtual void delegateProgressUpdate (double)
 Emits the progress when it changes, to be reimplemented in derived classes.
 
void setProgressCB (MLRequestProgressCB *progressCallback, void *progressCallbackUserData)
 Set the progress callback. It will be called when updateProgress() is called.
 

Protected Attributes

TileRequest_request
 The root TileRequest that is used internally.
 
MLRequestProgressCB_progressCB
 
void * _progressCBUserData
 
double _lastProgress
 

Detailed Description

Base class for TileRequest based jobs.

Definition at line 31 of file mlGetTileJob.h.

Constructor & Destructor Documentation

◆ GetTileJobBase()

ml::GetTileJobBase::GetTileJobBase ( )

◆ ~GetTileJobBase()

virtual ml::GetTileJobBase::~GetTileJobBase ( )
virtual

Member Function Documentation

◆ cancel()

void ml::GetTileJobBase::cancel ( )

Cancels the GetTileJob, this only sets the flag, the real cancellation needs to be done on the PageRequestProcessor.

◆ delegateProgressUpdate()

virtual void ml::GetTileJobBase::delegateProgressUpdate ( double )
inlinevirtual

Emits the progress when it changes, to be reimplemented in derived classes.

Reimplemented in ml::ProcessAllPagesJob.

Definition at line 64 of file mlGetTileJob.h.

◆ getError()

MLErrorCode ml::GetTileJobBase::getError ( ) const
inline

Returns the error that happened (return ML_RESULT_OK if everything is ok).

Definition at line 51 of file mlGetTileJob.h.

◆ getProgress()

double ml::GetTileJobBase::getProgress ( ) const

Returns the current progress of the tile request ([0..1] range).

◆ hasError()

bool ml::GetTileJobBase::hasError ( ) const
inline

Returns if the request has an error (and the data is thus unusable/invalid).

Definition at line 48 of file mlGetTileJob.h.

◆ hasFinished()

bool ml::GetTileJobBase::hasFinished ( )
inline

Returns if the request has finished (If an error happened, true will be returned as well).

Definition at line 45 of file mlGetTileJob.h.

◆ init()

virtual MLErrorCode ml::GetTileJobBase::init ( PageRequestProcessor & processor)
pure virtual

Initializes the tile request and add it to the processor if no error occurs.

Implemented in ml::GetTileJob, and ml::ProcessAllPagesJob.

◆ setProgressCB()

void ml::GetTileJobBase::setProgressCB ( MLRequestProgressCB * progressCallback,
void * progressCallbackUserData )

Set the progress callback. It will be called when updateProgress() is called.

◆ setTileRequestFinishedCB()

void ml::GetTileJobBase::setTileRequestFinishedCB ( TileRequestFinishedCB * cb,
void * data )
inline

Sets the tile request finished cb, which is called when the tile is ready.

Definition at line 54 of file mlGetTileJob.h.

◆ updateProgress()

void ml::GetTileJobBase::updateProgress ( )

Called by host to allow custom progress updates.

By default it calls the progress callback if set. It also calls the virtual delegateProgressUpdate().

Member Data Documentation

◆ _lastProgress

double ml::GetTileJobBase::_lastProgress
protected

Definition at line 74 of file mlGetTileJob.h.

◆ _progressCB

MLRequestProgressCB* ml::GetTileJobBase::_progressCB
protected

Definition at line 72 of file mlGetTileJob.h.

◆ _progressCBUserData

void* ml::GetTileJobBase::_progressCBUserData
protected

Definition at line 73 of file mlGetTileJob.h.

◆ _request

TileRequest* ml::GetTileJobBase::_request
protected

The root TileRequest that is used internally.

Definition at line 71 of file mlGetTileJob.h.


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