16void checkEnd(
double end) {
18 std::stringstream msg;
19 msg <<
"Progress range invalid. end=" << end;
20 throw std::invalid_argument(msg.str());
37 :
ProgressBase(start, end, int64_t(numSteps)), m_alg(alg) {
48 :
ProgressBase(start, end, int64_t(numSteps)), m_alg(alg) {
59 :
ProgressBase(start, end, int64_t(numSteps)), m_alg(alg) {
Base class from which all concrete algorithm classes should be derived.
void progress(double p, const std::string &msg="", double estimatedTime=0.0, int progressPrecision=0)
Sends ProgressNotification.
void interruption_point()
This is called during long-running operations, and check if the algorithm has requested that it be ca...
bool getCancel() const
Returns the cancellation state.
Algorithm *const m_alg
Owning algorithm.
Progress()
Default constructor.
void doReport(const std::string &msg="") override
Actually do the reporting, without changing the loop counter.
bool hasCancellationBeenRequested() const override
double m_end
Ending progress.
int64_t m_ifirst
Loop counter initial value.
double m_step
Progress increment at each loop.
int m_notifyStepPrecision
Digits of precision in the reporting.
double getEstimatedTime() const
Returns the estimated number of seconds until the algorithm completes.
double m_start
Starting progress.
std::atomic< int64_t > m_i
Loop counter.