ProgressDelegate Class Reference
ProgressDelegate is the base class for progress and interrupt reporting.
More...
#include <ProgressDelegate.h>
List of all members.
Public Member Functions |
virtual | ~ProgressDelegate (void) |
virtual void | reportProgress (double progress, const char *message)=0 |
| Displays the progress of the operation.
|
virtual bool | getCancelled (void)=0 |
| Indicate weather the operation should be cancelled.
|
void | setTotal (double total) |
| Set the total amount of work that must be done.
|
void | updateCompleted (double delta, const char *message) |
| Update the amount of work that has been done.
|
double | getProgress (void) const |
| Get the fraction the work completed.
|
void | warning (const char *format,...) |
virtual void | displayWarning (const char *message) |
Protected Member Functions |
| ProgressDelegate (void) |
Detailed Description
ProgressDelegate class is used for reporting progress of and interrupting long-running operation such as PointWriter::write() and PointSource::read(). During long-running operation the delegate's updateCompleted() method is called which will inturn calls reportProgress() with the fraction completed. Likewise getCancelled() is called frequently and should return true when the delegate wants to stop the long-running operation.
Definition at line 29 of file ProgressDelegate.h.
Constructor & Destructor Documentation
virtual ProgressDelegate::~ProgressDelegate |
( |
void |
|
) |
[virtual] |
ProgressDelegate::ProgressDelegate |
( |
void |
|
) |
[protected] |
Member Function Documentation
virtual void ProgressDelegate::displayWarning |
( |
const char * |
message |
) |
[virtual] |
virtual bool ProgressDelegate::getCancelled |
( |
void |
|
) |
[pure virtual] |
This method should be implemented to indicate whether some user-defined event indicates that the operation should be terminated.
- Returns:
- return true to cancel the long-running operation
Implemented in PercentProgressDelegate.
double ProgressDelegate::getProgress |
( |
void |
|
) |
const |
This method returns the progress.
- Returns:
- returns the a number between 0 and 1.
virtual void ProgressDelegate::reportProgress |
( |
double |
progress, |
|
|
const char * |
message | |
|
) |
| | [pure virtual] |
This method should be implemented to report to the client application the progress of a long-running operation.
- Parameters:
-
| progress | a value between 0 and 1 (progress = <work completed>=""> / <total work>="">) |
Implemented in PercentProgressDelegate.
void ProgressDelegate::setTotal |
( |
double |
total |
) |
|
This method sets the total amount of work that must be done. This value is used as denominator.
- Parameters:
-
| total | the total work for the ProgressDelgate |
void ProgressDelegate::updateCompleted |
( |
double |
delta, |
|
|
const char * |
message | |
|
) |
| | |
This method adds delta to the amount of work done.
- Parameters:
-
| delta | the amount of work to add to the work accumulator |
| message | a tag for who the caller is |
void ProgressDelegate::warning |
( |
const char * |
format, |
|
|
|
... | |
|
) |
| | |
The documentation for this class was generated from the following file: