9#include "MantidKernel/DllConfig.h"
33 ProgressBase(
double start,
double end, int64_t numSteps);
39 virtual void doReport(
const std::string &msg =
"") = 0;
53 if (++m_i - m_last_reported < m_notifyStep)
55 m_last_reported.store(m_i.load());
59 void report(
const std::string &msg);
60 void report(int64_t i,
const std::string &msg =
"");
61 void reportIncrement(
int inc,
const std::string &msg =
"");
62 void reportIncrement(
size_t inc,
const std::string &msg =
"");
63 void setNumSteps(int64_t nsteps);
64 void resetNumSteps(int64_t nsteps,
double start,
double end);
65 void setNotifyStep(
double notifyStepPct);
67 double getEstimatedTime()
const;
86 std::atomic<int64_t>
m_i;
const std::vector< double > & rhs
double m_end
Ending progress.
int64_t m_numSteps
Loop counter upper bound.
int64_t m_ifirst
Loop counter initial value.
virtual void doReport(const std::string &msg="")=0
Pure virtual method that does the progress reporting, to be overridden.
std::unique_ptr< Kernel::Timer > m_timeElapsed
Timer that is started when the progress bar is constructed.
double m_step
Progress increment at each loop.
virtual bool hasCancellationBeenRequested() const
Override so that the reporter can inform whether a cancellation request has been used.
double m_notifyStepPct
Frequency of sending the notification (as a min percentage step, e.g.
int m_notifyStepPrecision
Digits of precision in the reporting.
void report()
Increments the loop counter by 1, then sends the progress notification on behalf of its algorithm.
double m_start
Starting progress.
int64_t m_notifyStep
Frequency of sending the notification (every m_step times)
std::atomic< int64_t > m_i
Loop counter.
virtual ~ProgressBase()
Destructor.
std::atomic< int64_t > m_last_reported
Last loop counter value the was a peport.
Helper class which provides the Collimation Length for SANS instruments.