VAPOR3 3.9.4
Public Types | Static Public Member Functions | List of all members
VAPoR::Progress Class Reference

#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.
 

Detailed Description

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.

Member Typedef Documentation

◆ Finish_t

typedef std::function<void()> VAPoR::Progress::Finish_t

Definition at line 24 of file Progress.h.

◆ Start_t

typedef std::function<void(const std::string &name, long nTotal, bool cancellable)> VAPoR::Progress::Start_t

Definition at line 22 of file Progress.h.

◆ Update_t

typedef std::function<void(long nDone, bool *cancelled)> VAPoR::Progress::Update_t

Definition at line 23 of file Progress.h.

Member Function Documentation

◆ Cancelled()

static bool VAPoR::Progress::Cancelled ( )
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.

◆ Finish()

static void VAPoR::Progress::Finish ( )
static

Signify the computation was cancelled.

◆ SetHandlers()

static void VAPoR::Progress::SetHandlers ( Start_t  start,
Update_t  update,
Finish_t  finish 
)
static

This class does not handle actually displaying progress information to the user. The interface (e.g. vaporgui) must set callbacks to accomplish this.

◆ Sleep()

static void VAPoR::Progress::Sleep ( double  s)
static

For testing purposes only.

◆ Start()

static void VAPoR::Progress::Start ( const std::string &  name,
long  total,
bool  cancelable = false 
)
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

◆ StartIndefinite()

static void VAPoR::Progress::StartIndefinite ( const std::string &  name,
bool  cancelable = false 
)
static

Same as start but the progress is unknown. Update(0) still needs to be called periodically.

◆ Update()

static void VAPoR::Progress::Update ( long  completed)
static

Update the progress status.


The documentation for this class was generated from the following file: