ImFusion SDK 4.3
Progress Reporting

Reporting progress of long-standing tasks/algorithms. More...

+ Collaboration diagram for Progress Reporting:

Detailed Description

Reporting progress of long-standing tasks/algorithms.

The Progress interface provides a generic means for algorithms to report status and progress of their current computation. Usually, an application has one central instance of a progress reporter (e.g. a ProgressDialog) that is available through ApplicationController::progress(). Similarly, the Algorithm interface also provides a member m_progress, which is automatically populated with the ApplicationController's Progress instance in case the Algorithm is created through the AlgorithmFactory interface.

Independent of where the progress handler originates from, the usage pattern is essentially always the same:

void processData(const std::vector<Foo>& data, Progress* progressHandler) {
// A nullptr check of progressHandler is not needed because it's already performed by Task:
// If the parent progress handler is null, reporting progress through progressTask results in a no-op
Progress::Task progressTask(progressHandler, data.size(), "Processing data");
for (auto& elem : data) {
// The Progress interface provides a back-channel to notify the algorithm if it should abort
if (progressTask.wasCanceled())
break;
processElement(elem);
// Report progress update
progressTask.incrementStep();
}
}

The Progress interface supports advanced features such as optional thread-safety or nesting of progress callbacks. See the corresponding documentation for more information.

Classes

class  AsciiProgress
 Displays a basic progress bar with ASCII characters on the console window. More...
 
class  NestedProgress
 Wrapper class to provide the Progress interface, ensure certain invariants for created tasks and/or optionally forward the progress information to an existing Progress. More...
 
class  Progress
 Generic interface to report operation/computation progress. More...
 
class  Progress::Task
 Represents the progress/status report of an individual task hosted by a Progress. More...
 
class  SubProgress
 Wrapper class to report partial progress on an existing Task. More...
 
class  ProgressDialog
 QDialog-based progress reporter that shows one QProgressBar for each progress task. More...
 
Search Tab / S to search, Esc to close