dtSearch Text Retrieval Engine Programmer's Reference
DJobBase Class

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

File: dtsfc.h 

Namespace: dtSearch 

class DJobBase;
No members matching the current filter
No members matching the current filter

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); } };