Regina Calculation Engine
Public Member Functions | Protected Attributes | List of all members
regina::ProgressTrackerOpen Class Reference

Manages percentage-based progress tracking and cancellation polling for open-ended operations. More...

#include <progress/progresstracker.h>

Inheritance diagram for regina::ProgressTrackerOpen:
regina::ProgressTrackerBase

Public Member Functions

 ProgressTrackerOpen ()
 Creates a new progress tracker. More...
 
bool stepsChanged ()
 Queries whether the number of steps completed has changed since the last call to stepsChanged(). More...
 
unsigned long steps ()
 Returns the number of steps completed throughout the entire operation. More...
 
void newStage (const char *desc)
 Used by the writing thread to indicate that it has moved on to a new stage of processing. More...
 
void newStage (const std::string &desc)
 Used by the writing thread to indicate that it has moved on to a new stage of processing. More...
 
bool incSteps ()
 Used by the writing thread to indicate that one more step has been completed. More...
 
bool incSteps (unsigned long add)
 Used by the writing thread to indicate that some number of additional steps have been completed. More...
 
void setFinished ()
 Used by the writing thread to indicate that it has finished all processing. More...
 
bool isFinished ()
 Queries whether the writing thread has finished all processing. More...
 
bool descriptionChanged ()
 Queries whether the stage description has changed since the last call to descriptionChanged(). More...
 
std::string description ()
 Returns the human-readable description of the current stage. More...
 
void cancel ()
 Indicates to the writing thread that the user wishes to cancel the operation. More...
 
bool isCancelled ()
 Queries whether the reading thread has made a request for the writing thread to cancel the operation; in other words, whether cancel() has been called. More...
 

Protected Attributes

std::string desc_
 The human-readable description of the current stage. More...
 
bool descChanged_
 Has the description changed since the last call to descriptionChanged()? More...
 
bool cancelled_
 Has the reading thread requested that the operation be cancelled? More...
 
bool finished_
 Has the writing thread declared that it has finished all processing? More...
 
std::mutex lock_
 A mutex to stop the reading and writing threads from interfering with each other. More...
 

Detailed Description

Manages percentage-based progress tracking and cancellation polling for open-ended operations.

See the ProgressTrackerBase documentation for detailed information on how to use a progress tracker.

This class represents a progress tracker that measures progress using a non-negative integer, which typically indicates the number of steps completed so far during the operation. This integer begin at 0 and rises as the operation progresses. There is no particular "end point" or upper bound on the number of steps, and indeed the end point is often unknown until the operation has finished.


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

Copyright © 1999-2016, The Regina development team
This software is released under the GNU General Public License, with some additional permissions; see the source code for details.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@maths.uq.edu.au).