15#include <Poco/ActiveMethod.h>
16#include <Poco/ActiveResult.h>
17#include <Poco/NObserver.h>
96 std::unique_ptr<Mantid::API::IAlgorithmRuntimeProps> props);
98 void setQueue(std::deque<IConfiguredAlgorithm_sptr> algorithm);
102 size_t queueLength();
107 void executeBatchAsync();
114 void stopOnFailure(
bool stopOnFailure);
126 bool executeBatchAsyncImpl(
const Poco::Void & );
130 void postNotification(Poco::Notification *notification);
132 void setCancelRequested(
bool const cancel);
135 void handleBatchComplete(
const Poco::AutoPtr<BatchCompleteNotification> &pNf);
136 void handleBatchCancelled(
const Poco::AutoPtr<BatchCancelledNotification> &pNf);
137 void handleAlgorithmStarted(
const Poco::AutoPtr<AlgorithmStartedNotification> &pNf);
138 void handleAlgorithmComplete(
const Poco::AutoPtr<AlgorithmCompleteNotification> &pNf);
139 void handleAlgorithmError(
const Poco::AutoPtr<AlgorithmErrorNotification> &pNf);
156 bool cancelRequested();
172 void addAllObservers();
173 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
const std::string & errorMessage() const
IConfiguredAlgorithm_sptr algorithm() 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::recursive_mutex m_cancelMutex
std::recursive_mutex m_notificationMutex
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.
std::recursive_mutex m_executeMutex
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