Parent Topic: IMPTERMPROGRESSCOUNTER
IMPProgressFunc
IMPProgressFunc is a typedef type used for functions intended to be
used to report progress. It superceeds the pre-V6.2 PCICounter
function. The type is defined in ccltask.h, and look like this:
typedef TBool (*IMPProgressFunc)( double dfComplete,
const char *pszMessage,
void * pProgressData );
Progress counter functions called to report progress to the user in
an application specific way. Three common progress functions are
IMPTermProgressCounter() (for producing a text odometer for PACE
programs), IMPDummyProgress() which is a progress function that does
not do anything and SGLMonitorProgress() which works with a
SGLMonitor object.
Algorithms that wish to implement IMPProgressFunc services are
expected to do the following:
- Check the return result of IMPProgressFunc on each call. If the
function returns FALSE then the algorithms should be terminated,
any resources cleaned up, and then return to the caller, ideally
with some indication that the algorithm did not complete.
- Calls to the progress monitor function should pass completion
values (dfComplete) varying from 0.0 to 1.0. An initial value of
- 1.0 is a good idea to reset the counter. The final value should
be 1.0, or slightly over to ensure that completion is recognised.
- The pszMessage field can be NULL most of the time, but a specific
message to be displayed to the user may be passed. Typically this
is used to indicate the step within an interative algorithm, or
the stage in an algorithm with more than one process.
- The pszMessage value should be pre-translated using NLSLookup()
into the current language since not all progress functions call
NLSLookup().
See Also: IMPTermProgressCounter(), SGLMonitor, IMPCreateCumulativeProgress(), IMPTermProgressViaCounter()
Parent Topic: IMPTERMPROGRESSCOUNTER
About PCI Help Gateway