15#include <Poco/ActiveMethod.h>
16#include <Poco/ActiveResult.h>
17#include <Poco/NObserver.h>
97 void setQueue(std::deque<IConfiguredAlgorithm_sptr> algorithm);
101 size_t queueLength();
106 void executeBatchAsync();
111 void stopOnFailure(
bool stopOnFailure);
123 bool executeBatchAsyncImpl(
const Poco::Void & );
128 void handleBatchComplete(
const Poco::AutoPtr<BatchCompleteNotification> &pNf);
129 void handleBatchCancelled(
const Poco::AutoPtr<BatchCancelledNotification> &pNf);
130 void handleAlgorithmStarted(
const Poco::AutoPtr<AlgorithmStartedNotification> &pNf);
131 void handleAlgorithmComplete(
const Poco::AutoPtr<AlgorithmCompleteNotification> &pNf);
132 void handleAlgorithmError(
const Poco::AutoPtr<AlgorithmErrorNotification> &pNf);
147 bool cancelRequested();
163 void addAllObservers();
164 void removeAllObservers();
#define EXPORT_OPT_MANTIDQT_COMMON
AlgorithmCompleteNotification(IConfiguredAlgorithm_sptr algorithm)
IConfiguredAlgorithm_sptr m_algorithm
IConfiguredAlgorithm_sptr algorithm() const
AlgorithmErrorNotification(IConfiguredAlgorithm_sptr algorithm, std::string const &errorMessage)
std::string m_errorMessage
IConfiguredAlgorithm_sptr algorithm() const
std::string errorMessage() const
IConfiguredAlgorithm_sptr m_algorithm
IConfiguredAlgorithm_sptr m_algorithm
IConfiguredAlgorithm_sptr algorithm() const
AlgorithmStartedNotification(IConfiguredAlgorithm_sptr algorithm)
Algorithm runner for execution of a queue of algorithms.
bool m_cancelRequested
User has requested to cancel processing.
void algorithmStarted(MantidQt::API::IConfiguredAlgorithm_sptr algorithm)
Mantid::API::IAlgorithm_sptr m_currentAlgorithm
The current algorithm being executed.
std::deque< IConfiguredAlgorithm_sptr > m_algorithms
The queue of algorithms to be executed.
bool m_stopOnFailure
If execution should be stopped on algorithm failure.
Poco::NObserver< BatchAlgorithmRunner, AlgorithmStartedNotification > m_algorithmStartedObserver
Poco::NObserver< BatchAlgorithmRunner, BatchCompleteNotification > m_batchCompleteObserver
Observer for notifications.
Poco::NotificationCenter m_notificationCenter
Notification center used to handle notifications from active method.
Poco::ActiveResult< bool > executeAsync()
Holds result of async execution.
Poco::ActiveMethod< bool, Poco::Void, BatchAlgorithmRunner, Poco::ActiveStarter< BatchAlgorithmRunner > > m_executeAsync
Active method to run batch runner on separate thread.
Poco::NObserver< BatchAlgorithmRunner, AlgorithmErrorNotification > m_algorithmErrorObserver
void algorithmError(MantidQt::API::IConfiguredAlgorithm_sptr algorithm, std::string errorMessage)
void algorithmComplete(MantidQt::API::IConfiguredAlgorithm_sptr algorithm)
Poco::NObserver< BatchAlgorithmRunner, AlgorithmCompleteNotification > m_algorithmCompleteObserver
void batchComplete(bool error)
Emitted when a batch has finished executing.
Poco::NObserver< BatchAlgorithmRunner, BatchCancelledNotification > m_batchCancelledObserver
BatchCancelledNotification()
bool isInProgress() const
BatchCompleteNotification(bool inProgress, bool error)
std::shared_ptr< IConfiguredAlgorithm > IConfiguredAlgorithm_sptr
std::shared_ptr< IAlgorithm > IAlgorithm_sptr
shared pointer to Mantid::API::IAlgorithm