![]() |
ImFusion SDK 4.3
|
#include <ImFusion/Base/SubProgress.h>
Wrapper class to report partial progress on an existing Task. More...
Wrapper class to report partial progress on an existing Task.
This class provides a Progress interface that linearly maps to a given range of an existing Progress::Task. It can be used to merge the progress of multiple methods that are not aware of each other into one single progress report and use up its entire range. This is different to a NestedProgress as creating tasks on a SubProgress will not create a new task on the parent reporter (usually resulting in an additional progress bar) but reuse an existing task.
Public Member Functions | |
SubProgress (Progress::Task *parentTask, double startRatio, double endRatio, int resolution=100) | |
Create a new SubProgress instance where update reports are merged into the current step information of the parent task. | |
bool | forwardsDescription () const |
Returns the flag whether to forward the task description from the sub progress to the parent. | |
void | setForwardDescription (bool value) |
Sets the flag whether to forward the task description from the sub progress to the parent. | |
void | onTaskAdded (Task *task) override |
Function is called whenever a new Task has been created. | |
void | onTaskUpdated (const Task *task) override |
Function is called whenever the state of a Task has changed and the reporter should update its UI. | |
bool | onTaskRequestsThreadSafety (const Task *task) override |
Function is called by Task::requestThreadSafety() in order to check whether the parent reporter supports concurrent access. | |
void | onTaskRemoved (const Task *task) override |
Function is called whenever a Task is about to be destroyed and its pointer will become invalid. | |
![]() | |
Task | addTask (int numSteps, const std::string &description) |
Create a new progress report for an operation with the given number of steps. | |
Task | addBusyIndicator (const std::string &description) |
Create a busy indicator for an operation but does not have a predefined number of steps. | |
SubProgress | ( | Progress::Task * | parentTask, |
double | startRatio, | ||
double | endRatio, | ||
int | resolution = 100 ) |
Create a new SubProgress instance where update reports are merged into the current step information of the parent task.
Progress reports on this object will be mapped linearly to the range startRatio*resolution .. endRatio*resolution
.
|
overridevirtual |
Function is called whenever a new Task has been created.
Implements Progress.
|
overridevirtual |
Function is called whenever the state of a Task has changed and the reporter should update its UI.
Implements Progress.
|
overridevirtual |
Function is called by Task::requestThreadSafety() in order to check whether the parent reporter supports concurrent access.
Implementations are free to ignore this request and return false
. Otherwise they must ensure that subsequent concurrent calls to any of the onTask...()
callbacks are handled correctly without race conditions. Implementations are free to return to a unsynchronized implementation as soon as all multi-threaded tasks have been removed from the reporter.
Implements Progress.
|
overridevirtual |
Function is called whenever a Task is about to be destroyed and its pointer will become invalid.
Implements Progress.