9#include <Poco/ActiveResult.h>
20 : QObject(parent), m_finishedObserver(*this, &
AlgorithmRunner::handleAlgorithmFinishedNotification),
21 m_progressObserver(*this, &
AlgorithmRunner::handleAlgorithmProgressNotification),
22 m_errorObserver(*this, &
AlgorithmRunner::handleAlgorithmErrorNotification), m_asyncResult(nullptr) {}
67 throw std::invalid_argument(
"AlgorithmRunner::startAlgorithm() given a NULL Algorithm");
68 if (!alg->isInitialized())
69 throw std::invalid_argument(
"AlgorithmRunner::startAlgorithm() given an uninitialized Algorithm");
#define UNUSED_ARG(x)
Function arguments are sometimes unused in certain implmentations but are required for documentation ...
The AlgorithmRunner is a QObject that encapsulates methods for running an algorithm asynchronously (i...
void algorithmComplete(bool error)
Signal emitted when the algorithm has completed execution/encountered an error.
virtual void cancelRunningAlgorithm()
If an algorithm is already running, cancel it.
Mantid::API::IAlgorithm_sptr m_asyncAlg
Reference to the algorithm executing asynchronously.
Poco::ActiveResult< bool > * m_asyncResult
For the asynchronous call in dynamic rebinning.
virtual void startAlgorithm(Mantid::API::IAlgorithm_sptr alg)
Begin asynchronous execution of an algorithm and observe its execution.
void handleAlgorithmProgressNotification(const Poco::AutoPtr< Mantid::API::Algorithm::ProgressNotification > &pNf)
Observer called when the async algorithm has progress to report.
Poco::NObserver< AlgorithmRunner, Mantid::API::Algorithm::FinishedNotification > m_finishedObserver
void handleAlgorithmErrorNotification(const Poco::AutoPtr< Mantid::API::Algorithm::ErrorNotification > &pNf)
Observer called when the async algorithm has encountered an error.
~AlgorithmRunner() override
Destructor.
AlgorithmRunner(QObject *parent=nullptr)
Constructor.
Poco::NObserver< AlgorithmRunner, Mantid::API::Algorithm::ProgressNotification > m_progressObserver
Poco::NObserver< AlgorithmRunner, Mantid::API::Algorithm::ErrorNotification > m_errorObserver
virtual Mantid::API::IAlgorithm_sptr getAlgorithm() const
Get back a pointer to the running algorithm.
void algorithmProgress(double p, const std::string &msg)
Signal emitted when the algorithm reports progress.
void handleAlgorithmFinishedNotification(const Poco::AutoPtr< Mantid::API::Algorithm::FinishedNotification > &pNf)
Algorithm notification handlers.
std::shared_ptr< IAlgorithm > IAlgorithm_sptr
shared pointer to Mantid::API::IAlgorithm