VAPOR3 3.9.4
|
#include <Progress.h>
Public Types | |
typedef std::function< void(const std::string &name, long nTotal, bool cancellable)> | Start_t |
typedef std::function< void(long nDone, bool *cancelled)> | Update_t |
typedef std::function< void()> | Finish_t |
Static Public Member Functions | |
static void | Start (const std::string &name, long total, bool cancelable=false) |
static void | StartIndefinite (const std::string &name, bool cancelable=false) |
Same as start but the progress is unknown. Update(0) still needs to be called periodically. | |
static void | Update (long completed) |
Update the progress status. | |
static bool | Cancelled () |
static void | Finish () |
Signify the computation was cancelled. | |
static void | SetHandlers (Start_t start, Update_t update, Finish_t finish) |
static void | Sleep (double s) |
For testing purposes only. | |
Used for displaying the progress of actions to the user. The actual method for displaying the progress can vary based on the callback.
The situations where this should be used is top-level calculations that may take longer than a second. This should not be used (although it will not break) for non-top level calculations, i.e. in the DC library as typically loading data will be part of a higher-level calculation.
The primary use case would be a renderer that has to precompute data, e.g. the Flow renderer computing particle advection.
Definition at line 20 of file Progress.h.
typedef std::function<void()> VAPoR::Progress::Finish_t |
Definition at line 24 of file Progress.h.
typedef std::function<void(const std::string &name, long nTotal, bool cancellable)> VAPoR::Progress::Start_t |
Definition at line 22 of file Progress.h.
typedef std::function<void(long nDone, bool *cancelled)> VAPoR::Progress::Update_t |
Definition at line 23 of file Progress.h.
|
inlinestatic |
If Start was called with cancelled=true, the user will have the option to cancel the computation.
Definition at line 36 of file Progress.h.
|
static |
Signify the computation was cancelled.
This class does not handle actually displaying progress information to the user. The interface (e.g. vaporgui) must set callbacks to accomplish this.
|
static |
For testing purposes only.
|
static |
Signifies the beginning of a computation called "name" with "total" elements Can be called multiple times to signifiy a series of computations but must always end with a Finish
|
static |
Same as start but the progress is unknown. Update(0) still needs to be called periodically.
|
static |
Update the progress status.