Geogram  Version 1.9.1
A programming library of geometric algorithms
GEO::ProgressClient Class Referenceabstract

Task progress listener. More...

#include <geogram/basic/progress.h>

Inheritance diagram for GEO::ProgressClient:
GEO::Counted GEO::StatusBar

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

Detailed Description

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

See also
Progress
ProgressTask

Definition at line 76 of file progress.h.

Constructor & Destructor Documentation

◆ ~ProgressClient()

GEO::ProgressClient::~ProgressClient ( )
overrideprotected

ProgressClient destructor

Member Function Documentation

◆ begin()

virtual void GEO::ProgressClient::begin ( )
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 GEO::StatusBar.

◆ end()

virtual void GEO::ProgressClient::end ( bool  canceled)
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.

Parameters
[in]canceledset to true if the task was canceled, false otherwise.

Implemented in GEO::StatusBar.

◆ progress()

virtual void GEO::ProgressClient::progress ( index_t  step,
index_t  percent 
)
pure virtual

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, ...).

Parameters
[in]stepthe current progress step
[in]percentthe percentage of completion of the task

Implemented in GEO::StatusBar.


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