Graphite
Version 3
An experimental 3D geometry processing program
|
Task progress listener. More...
#include <geogram/basic/progress.h>
Public Member Functions | |
virtual void | begin ()=0 |
Starts listening progress. More... | |
virtual void | progress (index_t step, index_t percent)=0 |
Tracks progress. More... | |
virtual void | end (bool canceled)=0 |
Stops listening progress. More... | |
Public Member Functions inherited from GEO::Counted | |
void | ref () const |
Increments the reference count. More... | |
void | unref () const |
Decrements the reference count. More... | |
bool | is_shared () const |
Check if the object is shared. More... | |
int | nb_refs () const |
Gets the number of references that point to this object. More... | |
Protected Member Functions | |
~ProgressClient () override | |
Protected Member Functions inherited from GEO::Counted | |
Counted () | |
Creates a reference counted object. More... | |
virtual | ~Counted () |
Destroys a reference counted object. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from GEO::Counted | |
static void | ref (const Counted *counted) |
Increments the reference count. More... | |
static void | unref (const Counted *counted) |
Decrements the reference count. More... | |
Task progress listener.
ProgressClient is an abstract interface for listening to the progress of tasks tracked by the ProgressTask. The main purpose of a ProgressClient is to make the progress visible to the end user (to the console, to a progress bar).
To implement a specific progress client, you must create a derived class of ProgressClient and implement the 3 functions:
Then the client must be registered to the Progress system with Progress::set_client(). The client can access the status of the current task at any with Progress::current_progress_task(). time
Definition at line 76 of file progress.h.
|
overrideprotected |
ProgressClient destructor
|
pure virtual |
Starts listening progress.
This function is called by the ProgressTask to start tracking the execution of a new task. Clients are free to do whatever is appropriate (show a progress bar, a progress dialog, ...)
Implemented in OGF::ApplicationBase::ApplicationBaseProgressClient, and GEO::StatusBar.
|
pure virtual |
Stops listening progress.
This function is called by the ProgressTask to stop tracking the execution of the task. Clients are free to do whatever is appropriate (hide a progress bar, a progress dialog, log the elapsed time, ...). If the task was not terminated normally (i.e., canceled() then parameter canceled
is set to true
.
[in] | canceled | set to true if the task was canceled, false otherwise. |
Implemented in OGF::ApplicationBase::ApplicationBaseProgressClient, and GEO::StatusBar.
Tracks progress.
This function is called by the ProgressTask repeatedly during the execution of the task. Clients are free to do whatever is appropriate (update a progress bar, log the current values, ...).
[in] | step | the current progress step |
[in] | percent | the percentage of completion of the task |
Implemented in OGF::ApplicationBase::ApplicationBaseProgressClient, and GEO::StatusBar.