A progress report in which the current state of progress is stored as a number of items completed.
More...
#include <progress/nprogresstypes.h>
|
bool | changed |
| Has the state of progress changed since the last query? More...
|
|
A progress report in which the current state of progress is stored as a number of items completed.
The expected total number of items can be optionally specified.
- Python:
- Not present; all progress classes communicate with external interfaces through the NProgress interface.
regina::NProgressNumber::NProgressNumber |
( |
long |
newCompleted = 0 , |
|
|
long |
newOutOf = -1 |
|
) |
| |
|
inline |
Creates a new progress report containing the given details.
Note that the internal mutex is not locked during construction.
- Precondition
- The new number of items completed is non-negative.
-
If the new expected total is non-negative, then the new number of items completed is at most the new expected total.
- Parameters
-
newCompleted | the number of items completed; this defaults to 0. |
newOutOf | the expected total number of items, or -1 if this total is not known (the default). |
long regina::NProgressNumber::getCompleted |
( |
| ) |
const |
|
inline |
Returns the number of items completed.
- Returns
- the number of items completed.
Returns both the number of items completed and the expected total number of items.
- Returns
- the current state of progress.
long regina::NProgressNumber::getOutOf |
( |
| ) |
const |
|
inline |
Returns the expected total number of items.
- Returns
- the expected total number of items, or -1 if this total is not known.
void regina::NProgressNumber::incCompleted |
( |
unsigned long |
extraCompleted = 1 | ) |
|
|
inline |
Increases the number of items completed by the given amount.
- Precondition
- If the expected total is non-negative, then the new total number of items completed is at most the expected total.
- Parameters
-
extraCompleted | the number of items to add to the number of items already completed. |
virtual std::string regina::NProgressNumber::internalGetDescription |
( |
| ) |
const |
|
protectedvirtual |
Returns a string description of the current state of progress.
- Returns
- the current state of progress.
Implements regina::NProgress.
double regina::NProgressNumber::internalGetPercent |
( |
| ) |
const |
|
inlineprotectedvirtual |
Returns the current state of progress as a percentage.
The default implementation returns 0.
- Precondition
- Progress can be expressed as a percentage (see isPercent()).
- Returns
- the current state of progress as a percentage.
Reimplemented from regina::NProgress.
bool regina::NProgressNumber::isPercent |
( |
| ) |
const |
|
inlinevirtual |
Determines if the state of progress can be expressed as a percentage.
The default implementation returns false
.
- Returns
true
if and only if progress can be expressed as a percentage.
Reimplemented from regina::NProgress.
void regina::NProgressNumber::setCompleted |
( |
long |
newCompleted | ) |
|
|
inline |
Sets the number of items completed.
- Precondition
- The new number of items completed is non-negative.
-
If the expected total is non-negative, then the new number of items completed is at most the expected total.
- Parameters
-
newCompleted | the number of items completed. |
void regina::NProgressNumber::setOutOf |
( |
long |
newOutOf | ) |
|
|
inline |
Sets the expected total number of items.
- Precondition
- If the new expected total is non-negative, then the new expected total is at least the number of items completed.
- Parameters
-
newOutOf | the expected total number of items, or -1 if this total is not known. |
The documentation for this class was generated from the following file: