Used for indicating the progress of a certain task.
The function pointer argument has to be supplied with a valid function of the given signature which will then be called on progress changes. An equivalent progress_t structure will be passed back as argument to the callback function on each progress change. The factor field of the supplied progress_t structure will then reflect the current progress as value between 0.0 and 1.0. You might want to use the custom field for data needed in your callback function.
Definition at line 216 of file RIFF.h.
std::vector< progress_t > RIFF::progress_t::subdivide |
( |
std::vector< float > | vSubTaskPortions | ) |
|
Divides this progress task into the requested amount of sub-progress tasks, where each one of those new sub-progress tasks is created with its requested individual weight / portion, and finally returns a vector with those new subprogress tasks.
The amount of subprogresses to be created is determined by this method by calling vSubTaskPortions.size()
.
Example: consider you wanted to create 3 subprogresses where the 1st subtask should be assigned 10% of the new 3 subprogresses' overall progress, the 2nd subtask should be assigned 50% of the new 3 subprogresses' overall progress, and the 3rd subtask should be assigned 40%, then you might call this method like this:
std::vector<progress_t> subprogresses = progress.subdivide({0.1, 0.5, 0.4});
- Parameters
-
vSubTaskPortions | - amount and individual weight of subtasks to be created |
- Returns
- subtasks
Definition at line 106 of file RIFF.cpp.