#include <MRParallelProgressReporter.h>
Classes | |
struct | PerTaskReporter |
struct | TaskInfo |
Public Member Functions | |
MRMESH_API | ParallelProgressReporter (const ProgressCallback &cb) |
MRMESH_API PerTaskReporter | newTask (float weight=1.f) |
MRMESH_API bool | operator() () |
This class allows progress to be reported from different threads. Unlike progress callback that is passed to ParallelFor, each task may report the progress separately, and the progress displayed to user is not just a number of completed tasks divided by the total number of tasks, but rather a (weighted) average of progresses reported from each task
MRMESH_API MR::ParallelProgressReporter::ParallelProgressReporter | ( | const ProgressCallback & | cb | ) |
MRMESH_API PerTaskReporter MR::ParallelProgressReporter::newTask | ( | float | weight = 1.f | ) |
Add task to the pull
MRMESH_API bool MR::ParallelProgressReporter::operator() | ( | ) |
Actually report the progress. Designed to be invoked in loop until all tasks are completed or until the operation is cancelled