40 #ifndef GEOGRAM_BASIC_PROGRESS
41 #define GEOGRAM_BASIC_PROGRESS
108 virtual void end(
bool canceled) = 0;
128 const char*
what() const GEO_NOEXCEPT override;
254 const std::string& task_name,
index_t max_steps,
268 const std::string& task_name =
"",
index_t max_steps = 100
379 std::string task_name_;
Base class for reference-counted objects.
virtual void end(bool canceled)=0
Stops listening progress.
virtual void progress(index_t step, index_t percent)=0
Tracks progress.
~ProgressClient() override
virtual void begin()=0
Starts listening progress.
Tracks the progress of a task.
virtual ~ProgressTask()
Destroys a ProgressTask.
virtual void progress(index_t step)
Sets the current execution step.
index_t max_steps() const
Gets the number of steps of the task.
virtual void next()
Goes to the next step.
index_t step() const
Gets the current step of the task.
double start_time() const
Gets the start time of the task.
virtual void update()
Updates progress values.
void reset(index_t max_steps)
Resets the execution step.
index_t percent() const
Gets the percentage of completion of the task.
ProgressTask(const std::string &task_name, index_t max_steps, bool quiet)
Creates a logger for a task.
const std::string & task_name() const
Gets the name of the task.
ProgressTask(const std::string &task_name="", index_t max_steps=100)
Creates a logger for a task.
void reset()
Resets the execution step.
bool is_canceled() const
Checks if the task is canceled.
A smart pointer with reference-counted copy semantics.
Base class of reference-counted objects, to be used with smart pointers.
Common include file, providing basic definitions. Should be included before anything else by all head...
Generic logging mechanism.
void cancel()
Cancels the current task.
void clear_canceled()
Clears the cancellation flag.
bool is_canceled()
Checks if the current task is canceled.
void set_client(ProgressClient *client)
Sets the Progress client.
const ProgressTask * current_progress_task()
Gets the current task.
Global Vorpaline namespace.
void terminate()
Cleans up Geogram.
geo_index_t index_t
The type for storing and manipulating indices.
void initialize(int flags=GEOGRAM_INSTALL_NONE)
Initialize Geogram.
SmartPointer< ProgressClient > ProgressClient_var
Pointers with automatic reference counting.
Exception thrown when a task is canceled.
const char * what() const GEO_NOEXCEPT override
Gets the string identifying the exception.