Mantid
|
Helper class for reporting progress from algorithms. More...
#include <Progress.h>
Public Member Functions | |
void | doReport (const std::string &msg="") override |
Actually do the reporting, without changing the loop counter. More... | |
bool | hasCancellationBeenRequested () const override |
Progress () | |
Default constructor. More... | |
Progress (Algorithm *alg, double start, double end, int numSteps) | |
Creates a Progress instance. More... | |
Progress (Algorithm *alg, double start, double end, int64_t numSteps) | |
Creates a Progress instance. More... | |
Progress (Algorithm *alg, double start, double end, size_t numSteps) | |
Creates a Progress instance. More... | |
Public Member Functions inherited from Mantid::Kernel::ProgressBase | |
virtual void | doReport (const std::string &msg="")=0 |
Pure virtual method that does the progress reporting, to be overridden. More... | |
double | getEstimatedTime () const |
Returns the estimated number of seconds until the algorithm completes. More... | |
virtual bool | hasCancellationBeenRequested () const |
Override so that the reporter can inform whether a cancellation request has been used. More... | |
ProgressBase & | operator= (const ProgressBase &rhs) |
ProgressBase () | |
Default constructor. More... | |
ProgressBase (const ProgressBase &source) | |
Copy constructor that builds a new ProgressBase object. More... | |
ProgressBase (double start, double end, int64_t numSteps) | |
Creates a ProgressBase instance. More... | |
void | report () |
Increments the loop counter by 1, then sends the progress notification on behalf of its algorithm. More... | |
void | report (const std::string &msg) |
Increments the loop counter by 1, then sends the progress notification on behalf of its algorithm. More... | |
void | report (int64_t i, const std::string &msg="") |
Sends the progress notification on behalf of its algorithm. More... | |
void | reportIncrement (int inc, const std::string &msg="") |
Sends the progress notification and increment the loop counter by more than one. More... | |
void | reportIncrement (size_t inc, const std::string &msg="") |
Sends the progress notification and increment the loop counter by more than one. More... | |
void | resetNumSteps (int64_t nsteps, double start, double end) |
Change the number of steps between start/end. More... | |
void | setNotifyStep (double notifyStepPct) |
Override the frequency at which notifications are sent out. More... | |
void | setNumSteps (int64_t nsteps) |
Change the number of steps between start/end. More... | |
virtual | ~ProgressBase () |
Destructor. More... | |
Private Attributes | |
Algorithm *const | m_alg |
Owning algorithm. More... | |
Additional Inherited Members | |
Protected Attributes inherited from Mantid::Kernel::ProgressBase | |
double | m_end |
Ending progress. More... | |
std::atomic< int64_t > | m_i |
Loop counter. More... | |
int64_t | m_ifirst |
Loop counter initial value. More... | |
std::atomic< int64_t > | m_last_reported |
Last loop counter value the was a peport. More... | |
int64_t | m_notifyStep |
Frequency of sending the notification (every m_step times) More... | |
double | m_notifyStepPct |
Frequency of sending the notification (as a min percentage step, e.g. More... | |
int | m_notifyStepPrecision |
Digits of precision in the reporting. More... | |
int64_t | m_numSteps |
Loop counter upper bound. More... | |
double | m_start |
Starting progress. More... | |
double | m_step |
Progress increment at each loop. More... | |
std::unique_ptr< Kernel::Timer > | m_timeElapsed |
Timer that is started when the progress bar is constructed. More... | |
Helper class for reporting progress from algorithms.
Definition at line 25 of file Progress.h.
Mantid::API::Progress::Progress | ( | ) |
Default constructor.
Definition at line 28 of file Progress.cpp.
Mantid::API::Progress::Progress | ( | Algorithm * | alg, |
double | start, | ||
double | end, | ||
int | numSteps | ||
) |
Creates a Progress instance.
alg | :: Algorithm reporting its progress |
start | :: Starting progress |
end | :: Ending progress |
numSteps | :: Number of times report(...) method will be called. |
Definition at line 36 of file Progress.cpp.
Mantid::API::Progress::Progress | ( | Algorithm * | alg, |
double | start, | ||
double | end, | ||
int64_t | numSteps | ||
) |
Creates a Progress instance.
alg | :: Algorithm reporting its progress |
start | :: Starting progress |
end | :: Ending progress |
numSteps | :: Number of times report(...) method will be called. |
Definition at line 47 of file Progress.cpp.
Mantid::API::Progress::Progress | ( | Algorithm * | alg, |
double | start, | ||
double | end, | ||
size_t | numSteps | ||
) |
Creates a Progress instance.
alg | :: Algorithm reporting its progress |
start | :: Starting progress |
end | :: Ending progress |
numSteps | :: Number of times report(...) method will be called. |
Definition at line 58 of file Progress.cpp.
|
overridevirtual |
Actually do the reporting, without changing the loop counter.
This is called by report(), and can be called directly in order to force a report. It can be overridden
msg |
Implements Mantid::Kernel::ProgressBase.
Definition at line 70 of file Progress.cpp.
References Mantid::Kernel::ProgressBase::getEstimatedTime(), Mantid::API::Algorithm::interruption_point(), m_alg, Mantid::Kernel::ProgressBase::m_end, Mantid::Kernel::ProgressBase::m_i, Mantid::Kernel::ProgressBase::m_ifirst, Mantid::Kernel::ProgressBase::m_notifyStepPrecision, Mantid::Kernel::ProgressBase::m_start, Mantid::Kernel::ProgressBase::m_step, and Mantid::API::Algorithm::progress().
Referenced by Mantid::Crystal::ConnectedComponentLabeling::calculateDisjointTree(), Mantid::DataHandling::LoadBBY::exec(), Mantid::DataHandling::LoadPreNexus::exec(), Mantid::MDAlgorithms::CreateMD::exec(), Mantid::DataHandling::LoadEMU< FD >::exec(), Mantid::DataHandling::LoadPLN::exec(), Mantid::DataHandling::LoadBBY::loadEvents(), Mantid::DataHandling::EMU::loadEvents(), Mantid::DataHandling::PLN::loadEvents(), Mantid::DataHandling::LoadEventNexus::loadEvents(), and Mantid::DataHandling::ANSTO::ProgressTracker::ProgressTracker().
|
overridevirtual |
Reimplemented from Mantid::Kernel::ProgressBase.
Definition at line 85 of file Progress.cpp.
References Mantid::API::Algorithm::getCancel(), and m_alg.
Referenced by Mantid::DataHandling::SaveParameterFile::exec().
|
private |
Owning algorithm.
Definition at line 36 of file Progress.h.
Referenced by doReport(), and hasCancellationBeenRequested().