Mantid
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
Mantid::Kernel::ProgressBase Class Referenceabstract

ProgressBase. More...

#include <ProgressBase.h>

Inheritance diagram for Mantid::Kernel::ProgressBase:
Mantid::API::Progress ProgressPresenter

Public Member Functions

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...
 
ProgressBaseoperator= (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...
 

Protected Attributes

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::Timerm_timeElapsed
 Timer that is started when the progress bar is constructed. More...
 

Detailed Description

ProgressBase.

A base class for progress reporting, to be overridden by Progress for algorithms.

Author
Janik Zikovsky, SNS
Date
2011-03-28 15:57:54.187764

Definition at line 30 of file ProgressBase.h.

Constructor & Destructor Documentation

◆ ProgressBase() [1/3]

Mantid::Kernel::ProgressBase::ProgressBase ( )

Default constructor.

Definition at line 18 of file ProgressBase.cpp.

References m_timeElapsed.

◆ ProgressBase() [2/3]

Mantid::Kernel::ProgressBase::ProgressBase ( double  start,
double  end,
int64_t  numSteps 
)

Creates a ProgressBase instance.

Parameters
start:: Starting progress
end:: Ending progress
numSteps:: Number of times report(...) method will be called.

Definition at line 31 of file ProgressBase.cpp.

References m_last_reported, m_notifyStep, m_timeElapsed, and setNumSteps().

◆ ProgressBase() [3/3]

Mantid::Kernel::ProgressBase::ProgressBase ( const ProgressBase source)

Copy constructor that builds a new ProgressBase object.

The timer state is copied from the other object

Parameters
sourceThe source of the copy

Definition at line 50 of file ProgressBase.cpp.

◆ ~ProgressBase()

Mantid::Kernel::ProgressBase::~ProgressBase ( )
virtualdefault

Destructor.

Member Function Documentation

◆ doReport()

virtual void Mantid::Kernel::ProgressBase::doReport ( const std::string &  msg = "")
pure virtual

Pure virtual method that does the progress reporting, to be overridden.

Implemented in ProgressPresenter, and Mantid::API::Progress.

Referenced by Mantid::Crystal::FindSXPeaksHelper::FindMaxReduceStrategy::getPeakGroups(), report(), and reportIncrement().

◆ getEstimatedTime()

double Mantid::Kernel::ProgressBase::getEstimatedTime ( ) const

Returns the estimated number of seconds until the algorithm completes.

Returns
seconds estimated to remain. 0 if it cannot calculate it

Definition at line 200 of file ProgressBase.cpp.

References m_i, m_step, and m_timeElapsed.

Referenced by Mantid::API::Progress::doReport(), and export_ProgressBase().

◆ hasCancellationBeenRequested()

virtual bool Mantid::Kernel::ProgressBase::hasCancellationBeenRequested ( ) const
inlinevirtual

Override so that the reporter can inform whether a cancellation request has been used.

Reimplemented in Mantid::API::Progress.

Definition at line 42 of file ProgressBase.h.

Referenced by Mantid::Geometry::InstrumentDefinitionParser::setComponentLinks().

◆ operator=()

ProgressBase & Mantid::Kernel::ProgressBase::operator= ( const ProgressBase rhs)

◆ report() [1/3]

void Mantid::Kernel::ProgressBase::report ( )
inline

Increments the loop counter by 1, then sends the progress notification on behalf of its algorithm.

Definition at line 51 of file ProgressBase.h.

Referenced by Mantid::CurveFitting::Algorithms::QENSFitSequential::addAdditionalLogs(), Mantid::CurveFitting::Algorithms::QENSFitSimultaneous::addAdditionalLogs(), Mantid::MDAlgorithms::ConvToMDEventsWSIndexing::appendEvents(), Mantid::MDAlgorithms::ConvToMDEventsWS::appendEventsFromInputWS(), Mantid::Crystal::LoadIsawPeaks::appendFile(), Mantid::Algorithms::CalculateCountRate::calcRateLog(), Mantid::MDAlgorithms::LoadSQW2::calculateDimLimitsFromData(), Mantid::DataHandling::SaveDspacemap::CalculateDspaceFromCal(), Mantid::Algorithms::MultipleScatteringCorrection::calculateSampleAndContainer(), Mantid::Algorithms::MultipleScatteringCorrection::calculateSingleComponent(), Mantid::Algorithms::ResetNegatives::changeNegatives(), Mantid::Algorithms::ConvertUnits::convertQuickly(), Mantid::Algorithms::ConvertUnits::convertViaTOF(), Mantid::Algorithms::SumEventsByLogValue::createBinnedOutput(), Mantid::Algorithms::Bin2DPowderDiffraction::createOutputWorkspace(), Mantid::Algorithms::SumEventsByLogValue::createTableOutput(), Mantid::Algorithms::PDCalibration::createTOFPeakCenterFitWindowWorkspaces(), Mantid::Algorithms::SumSpectra::doFractionalSum(), Mantid::Algorithms::RebinByPulseTimes::doHistogramming(), Mantid::Algorithms::RebinByTimeAtSample::doHistogramming(), Mantid::MDAlgorithms::MinusMD::doMinus(), Mantid::MDAlgorithms::PlusMD::doPlus(), Mantid::Algorithms::SumSpectra::doSimpleSum(), Mantid::Algorithms::MonteCarloAbsorption::doSimulation(), Mantid::Algorithms::AbsorptionCorrection::exec(), Mantid::Algorithms::AddAbsorptionWeightedPathLengths::exec(), Mantid::Algorithms::CalculateCarpenterSampleCorrection::exec(), Mantid::Algorithms::ChangePulsetime::exec(), Mantid::Algorithms::ChangePulsetime2::exec(), Mantid::Algorithms::ConvertAxisByFormula::exec(), Mantid::Algorithms::ConvertToConstantL2::exec(), Mantid::Algorithms::ConvertToEventWorkspace::exec(), Mantid::Algorithms::ConvertToMatrixWorkspace::exec(), Mantid::Algorithms::CorelliCrossCorrelate::exec(), Mantid::Algorithms::CorrectKiKf::exec(), Mantid::Algorithms::CorrectToFile::exec(), Mantid::Algorithms::CreateCalFileByNames::exec(), Mantid::Algorithms::CreateDummyCalFile::exec(), Mantid::Algorithms::DeleteWorkspaces::exec(), Mantid::Algorithms::DetectorEfficiencyCorUser::exec(), Mantid::Algorithms::DiffractionEventCalibrateDetectors::exec(), Mantid::Algorithms::DiffractionFocussing2::exec(), Mantid::Algorithms::DiscusMultipleScatteringCorrection::exec(), Mantid::Algorithms::ExtractFFTSpectrum::exec(), Mantid::Algorithms::ExtractMask::exec(), Mantid::Algorithms::ExtractSpectra2::exec(), Mantid::Algorithms::FilterByLogValue::exec(), Mantid::Algorithms::FilterByTime::exec(), Mantid::Algorithms::FilterByXValue::exec(), Mantid::Algorithms::FindPeakBackground::exec(), Mantid::Algorithms::GetDetectorOffsets::exec(), Mantid::Algorithms::HyspecScharpfCorrection::exec(), Mantid::Algorithms::IntegrateByComponent::exec(), Mantid::Algorithms::ModeratorTzero::exec(), Mantid::Algorithms::ModeratorTzeroLinear::exec(), Mantid::Algorithms::MonitorEfficiencyCorUser::exec(), Mantid::Algorithms::PaalmanPingsAbsorptionCorrection::exec(), Mantid::Algorithms::PaddingAndApodization::exec(), Mantid::Algorithms::PDCalibration::exec(), Mantid::Algorithms::PointByPointVCorrection::exec(), Mantid::Algorithms::Qxy::exec(), Mantid::Algorithms::RayTracerTester::exec(), Mantid::Algorithms::Rebin::exec(), Mantid::Algorithms::RemoveBackground::exec(), Mantid::Algorithms::RemoveBins::exec(), Mantid::Algorithms::ResampleX::exec(), Mantid::Algorithms::ResetNegatives::exec(), Mantid::Algorithms::MayersSampleCorrection::exec(), Mantid::Algorithms::SetUncertainties::exec(), Mantid::Algorithms::SofQWCentre::exec(), Mantid::Algorithms::SolidAngle::exec(), Mantid::Algorithms::SpatialGrouping::exec(), Mantid::Algorithms::VesuvioL1ThetaResolution::exec(), Mantid::Algorithms::XDataConverter::exec(), Mantid::Crystal::AnvredCorrection::exec(), Mantid::Crystal::IndexSXPeaks::exec(), Mantid::Crystal::IntegratePeakTimeSlices::exec(), Mantid::Crystal::NormaliseVanadium::exec(), Mantid::Crystal::PeakIntegration::exec(), Mantid::Crystal::PeakIntensityVsRadius::exec(), Mantid::Crystal::PredictPeaks::exec(), Mantid::CurveFitting::Algorithms::Fit1D::exec(), Mantid::CurveFitting::Algorithms::SplineInterpolation::exec(), Mantid::CurveFitting::Algorithms::SplineSmoothing::exec(), Mantid::DataHandling::LoadDetectorsGroupingFile::exec(), Mantid::DataHandling::LoadMuonLog::exec(), Mantid::DataHandling::LoadNexusMonitors2::exec(), Mantid::DataHandling::LoadNXSPE::exec(), Mantid::DataHandling::LoadParameterFile::exec(), Mantid::DataHandling::MaskSpectra::exec(), Mantid::DataHandling::NexusTester::exec(), Mantid::DataHandling::SaveCSV::exec(), Mantid::DataHandling::SaveOpenGenieAscii::exec(), Mantid::DataHandling::SaveParameterFile::exec(), Mantid::DataHandling::SaveVTK::exec(), Mantid::MDAlgorithms::CreateMD::exec(), Mantid::MDAlgorithms::SaveIsawQvector::exec(), Mantid::MDAlgorithms::ThresholdMD::exec(), Mantid::WorkflowAlgorithms::DgsReduction::exec(), Mantid::WorkflowAlgorithms::LoadEventAndCompress::exec(), Mantid::WorkflowAlgorithms::MuonProcess::exec(), Mantid::WorkflowAlgorithms::SANSBeamFluxCorrection::exec(), Mantid::Algorithms::CorrectKiKf::execEvent(), Mantid::Algorithms::ExtractSpectra::execEvent(), Mantid::Algorithms::HyspecScharpfCorrection::execEvent(), Mantid::Algorithms::ModeratorTzeroLinear::execEvent(), Mantid::Algorithms::UnaryOperation::execEvent(), Mantid::Crystal::AnvredCorrection::execEvent(), Mantid::Algorithms::SumSpectra::execEvent(), Mantid::Algorithms::ModeratorTzero::execEvent(), Mantid::Algorithms::ExtractSpectra::execHistogram(), Mantid::DataHandling::LoadEventNexus::execLoader(), Mantid::Crystal::PeaksIntersection::executePeaksIntersection(), export_ProgressBase(), Mantid::Algorithms::SmoothNeighbours::findNeighboursRectangular(), Mantid::Algorithms::FitPeaks::fitPeaks(), Mantid::Algorithms::SpectrumAlgorithm::for_each(), Mantid::DataHandling::LoadNexusMonitors2::getMonitorInfo(), Mantid::Algorithms::RebinToWorkspace::histogram(), Mantid::DataHandling::LoadEventNexus::loadEvents(), Mantid::Algorithms::makeGroupingByNames(), Mantid::Algorithms::makeGroupingByNumGroups(), Mantid::Algorithms::CalculateIqt::monteCarloErrorCalculation(), Mantid::DataHandling::SetScalingPSD::movePos(), Mantid::Algorithms::NormaliseToMonitor::normaliseBinByBin(), Mantid::DataObjects::FractionalRebinning::normaliseOutput(), Mantid::DataObjects::EventSortingTask::operator()(), Mantid::Algorithms::InterpolatingRebin::outputYandEValues(), Mantid::Geometry::InstrumentDefinitionParser::parseLocationsForEachTopLevelComponent(), Mantid::Algorithms::NormaliseToMonitor::performHistogramDivision(), Mantid::MDAlgorithms::PreprocessDetectorsToMD::processDetectorsPositions(), Mantid::Algorithms::NormaliseByDetector::processHistogram(), Mantid::DataHandling::SetScalingPSD::processScalingFile(), Mantid::Algorithms::LorentzCorrection::processTOF_PD(), Mantid::Algorithms::LorentzCorrection::processTOF_SCD(), Mantid::Algorithms::ResetNegatives::pushMinimum(), Mantid::MDAlgorithms::IntegrateEllipsoidsTwoStep::qListFromEventWS(), Mantid::MDAlgorithms::IntegrateEllipsoidsV1::qListFromEventWS(), Mantid::MDAlgorithms::IntegrateEllipsoidsV2::qListFromEventWS(), Mantid::MDAlgorithms::IntegrateEllipsoidsTwoStep::qListFromHistoWS(), Mantid::MDAlgorithms::IntegrateEllipsoidsV1::qListFromHistoWS(), Mantid::MDAlgorithms::IntegrateEllipsoidsV2::qListFromHistoWS(), Mantid::DataHandling::LoadRKH::read2D(), Mantid::DataHandling::LoadMcStas::readEventData(), Mantid::MDAlgorithms::LoadSQW::readEvents(), Mantid::Algorithms::readGroupingFile(), Mantid::MDAlgorithms::LoadSQW2::readPixelDataIntoWorkspace(), Mantid::Algorithms::RebinToWorkspace::rebin(), Mantid::API::renameWorkspacesInQENSFit(), Mantid::DataHandling::LoadBankFromDiskTask::run(), Mantid::DataHandling::ProcessBankData::run(), Mantid::Kernel::ThreadPoolRunnable::run(), Mantid::MDAlgorithms::ConvToMDEventsWS::runConversion(), Mantid::MDAlgorithms::ConvToMDHistoWS::runConversion(), Mantid::DataHandling::SaveCSV::saveXerrors(), Mantid::DataHandling::SaveISISNexus::selog(), Mantid::Geometry::InstrumentDefinitionParser::setComponentLinks(), Mantid::Algorithms::ConvertEmptyToTof::setTofInWS(), Mantid::Algorithms::ConvertUnits::setupOutputWorkspace(), Mantid::Algorithms::ChangeTimeZero::shiftTimeOfLogs(), Mantid::DataHandling::ANSTO::ProgressTracker::update(), and Mantid::DataHandling::SaveRKH::write1D().

◆ report() [2/3]

void Mantid::Kernel::ProgressBase::report ( const std::string &  msg)

Increments the loop counter by 1, then sends the progress notification on behalf of its algorithm.

Parameters
msg:: message string that will be displayed in GUI, for example

Definition at line 86 of file ProgressBase.cpp.

References doReport(), m_i, m_last_reported, and m_notifyStep.

◆ report() [3/3]

void Mantid::Kernel::ProgressBase::report ( int64_t  i,
const std::string &  msg = "" 
)

Sends the progress notification on behalf of its algorithm.

Sets the loop counter to a particular value.

Parameters
i:: The new value of the loop counter
msg:: Optional message string

Definition at line 100 of file ProgressBase.cpp.

References doReport(), m_i, m_last_reported, and m_notifyStep.

◆ reportIncrement() [1/2]

void Mantid::Kernel::ProgressBase::reportIncrement ( int  inc,
const std::string &  msg = "" 
)

Sends the progress notification and increment the loop counter by more than one.

Parameters
inc:: Increment the loop counter by this much
msg:: Optional message string

Definition at line 116 of file ProgressBase.cpp.

References doReport(), m_i, m_last_reported, and m_notifyStep.

Referenced by Mantid::DataHandling::ANSTO::ProgressTracker::complete(), Mantid::DataHandling::SaveNexusProcessed::doExec(), Mantid::DataHandling::LoadEmptyInstrument::exec(), export_ProgressBase(), Mantid::DataObjects::EventWorkspace::sortAll(), and Mantid::NeXus::NexusFileIO::writeNexusProcessedData2D().

◆ reportIncrement() [2/2]

void Mantid::Kernel::ProgressBase::reportIncrement ( size_t  inc,
const std::string &  msg = "" 
)

Sends the progress notification and increment the loop counter by more than one.

Parameters
inc:: Increment the loop counter by this much
msg:: Optional message string

Definition at line 132 of file ProgressBase.cpp.

References doReport(), m_i, m_last_reported, and m_notifyStep.

◆ resetNumSteps()

void Mantid::Kernel::ProgressBase::resetNumSteps ( int64_t  nsteps,
double  start,
double  end 
)

◆ setNotifyStep()

void Mantid::Kernel::ProgressBase::setNotifyStep ( double  notifyStepPct)

◆ setNumSteps()

void Mantid::Kernel::ProgressBase::setNumSteps ( int64_t  nsteps)

Change the number of steps between start/end.

Parameters
nsteps:: the number of steps to take between start and end

Definition at line 145 of file ProgressBase.cpp.

References m_end, m_notifyStep, m_notifyStepPct, m_numSteps, m_start, and m_step.

Referenced by export_ProgressBase(), Mantid::Algorithms::makeGroupingByNames(), ProgressBase(), Mantid::MDAlgorithms::LoadSQW::readEvents(), and resetNumSteps().

Member Data Documentation

◆ m_end

double Mantid::Kernel::ProgressBase::m_end
protected

Ending progress.

Definition at line 73 of file ProgressBase.h.

Referenced by Mantid::API::Progress::doReport(), operator=(), resetNumSteps(), setNotifyStep(), and setNumSteps().

◆ m_i

std::atomic<int64_t> Mantid::Kernel::ProgressBase::m_i
protected

◆ m_ifirst

int64_t Mantid::Kernel::ProgressBase::m_ifirst
protected

Loop counter initial value.

Definition at line 75 of file ProgressBase.h.

Referenced by Mantid::API::Progress::doReport(), and operator=().

◆ m_last_reported

std::atomic<int64_t> Mantid::Kernel::ProgressBase::m_last_reported
protected

Last loop counter value the was a peport.

Definition at line 88 of file ProgressBase.h.

Referenced by operator=(), ProgressBase(), report(), reportIncrement(), and resetNumSteps().

◆ m_notifyStep

int64_t Mantid::Kernel::ProgressBase::m_notifyStep
protected

Frequency of sending the notification (every m_step times)

Definition at line 79 of file ProgressBase.h.

Referenced by operator=(), ProgressBase(), report(), reportIncrement(), setNotifyStep(), and setNumSteps().

◆ m_notifyStepPct

double Mantid::Kernel::ProgressBase::m_notifyStepPct
protected

Frequency of sending the notification (as a min percentage step, e.g.

1 for 1 % (default) )

Definition at line 82 of file ProgressBase.h.

Referenced by operator=(), setNotifyStep(), and setNumSteps().

◆ m_notifyStepPrecision

int Mantid::Kernel::ProgressBase::m_notifyStepPrecision
protected

Digits of precision in the reporting.

Definition at line 92 of file ProgressBase.h.

Referenced by Mantid::API::Progress::doReport(), operator=(), and setNotifyStep().

◆ m_numSteps

int64_t Mantid::Kernel::ProgressBase::m_numSteps
protected

Loop counter upper bound.

Definition at line 77 of file ProgressBase.h.

Referenced by operator=(), setNotifyStep(), and setNumSteps().

◆ m_start

double Mantid::Kernel::ProgressBase::m_start
protected

Starting progress.

Definition at line 71 of file ProgressBase.h.

Referenced by Mantid::API::Progress::doReport(), operator=(), resetNumSteps(), setNotifyStep(), and setNumSteps().

◆ m_step

double Mantid::Kernel::ProgressBase::m_step
protected

Progress increment at each loop.

Definition at line 84 of file ProgressBase.h.

Referenced by Mantid::API::Progress::doReport(), getEstimatedTime(), operator=(), and setNumSteps().

◆ m_timeElapsed

std::unique_ptr<Kernel::Timer> Mantid::Kernel::ProgressBase::m_timeElapsed
protected

Timer that is started when the progress bar is constructed.

Definition at line 90 of file ProgressBase.h.

Referenced by getEstimatedTime(), operator=(), ProgressBase(), and resetNumSteps().


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