Links
dtSearch Text Retrieval Engine Programmer's Reference 7.70
DJobBase Class
Classes | Legend | Members | Methods | Send Feedback

Base class for DFileConverter, DIndexJob, DIndexMergeJob, DIndexListJob, DSearchJob, and DSearchReportJob.

Class Hierarchy
class DJobBase;
File

dtsfc.h

Remarks

DJobBase provides common task-management functions for starting, monitoring, and cancelling a job, and for obtaining error information after a job completes. 

The Job classes include several callback methods implemented as virtual functions, such as OnCheckAbort and OnError (in all classes), OnProgressUpdate (DIndexJob), and OnFound (DSearchJob). To use these methods, create a class based on the underlying Job class and override the virtual function you want to implement. 

 

class CMySearchJob : public DSearchJob {
     public:
           ...
           virtual void OnError(long errorCode, const char *msg) {
                 // First call base class implementation
                 DSearchJob::OnError(errorCode, msg);
                 // Now show the message to the user
                 CString csMsg = GetMyErrorForErrorCode(errorCode);
                 ShowMessageToUser(csMsg);
                 }
           virtual void OnFound(long totalFiles,
                 long totalHits, const char *name, long hitsInFile, dtsSearchResultsItem& item) {
                 // First call base class implementation
                 DSearchJob::OnFound(totalFiles, totalHits, name, hitsInFile, item);
                 // Now show the file to the user
                 ShowFoundFileToUser(name);
                 }
     };
Group
Methods
Method 
Description 
Requests termination of the job in progress. 
Requests immediate termination of the job in progress. 
Called to execute a job. 
Returns non-zero if the job failed 
Format all errors that occurred during execution as a single string, with line breaks separating the errors 
Returns the number of errors recorded during execution 
Returns a dtsErrorInfo with any errors that occurred during execution 
Returns true if the job has been cancelled 
Returns true if the job has started and is not yet done. 
Called while a job is executing every time the dtSearch Engine checks to see if the job has been cancelled. 
Called while a job is executing if an error is encountered, with the error code and message. 
Not used 
SetTimeout() causes a job to cancel automatically after the specified number of seconds 
Do not pump waiting windows messages during callbacks 
Legend
 
Method 
 
virtual 
 
abstract 
Links
You are here: C++ Support Classes > dtSearch Namespace > Classes > DJobBase Class
Copyright (c) 1995-2012 dtSearch Corp. All rights reserved.