Mantid
Loading...
Searching...
No Matches
AlgorithmRunner.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2024 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
10
11namespace MantidQt::API {
12
13AlgorithmRunner::AlgorithmRunner(std::unique_ptr<IJobRunner> jobRunner)
14 : m_jobRunner(std::move(jobRunner)), m_subscriber(), m_lastAlgorithm() {
15 m_jobRunner->subscribe(this);
16}
17
19
21 m_jobRunner->executeAlgorithm(std::move(algorithm));
22}
23
24void AlgorithmRunner::execute(std::deque<IConfiguredAlgorithm_sptr> algorithmQueue) {
25 m_jobRunner->setAlgorithmQueue(std::move(algorithmQueue));
26 m_jobRunner->executeAlgorithmQueue();
27}
28
30
32
36
41
42void AlgorithmRunner::notifyAlgorithmError(IConfiguredAlgorithm_sptr &algorithm, std::string const &message) {
43 m_subscriber->notifyAlgorithmError(algorithm, message);
44 m_lastAlgorithm = algorithm;
45}
46
47} // namespace MantidQt::API
double error
void subscribe(IAlgorithmRunnerSubscriber *subscriber) override
IAlgorithmRunnerSubscriber * m_subscriber
void execute(IConfiguredAlgorithm_sptr algorithm) override
IConfiguredAlgorithm_sptr m_lastAlgorithm
void notifyBatchComplete(bool error) override
AlgorithmRunner(std::unique_ptr< IJobRunner > jobRunner)
void notifyAlgorithmError(IConfiguredAlgorithm_sptr &algorithm, std::string const &message) override
std::unique_ptr< IJobRunner > m_jobRunner
void notifyAlgorithmComplete(IConfiguredAlgorithm_sptr &algorithm) override
void notifyAlgorithmStarted(IConfiguredAlgorithm_sptr &algorithm) override
virtual void notifyAlgorithmComplete(IConfiguredAlgorithm_sptr &algorithm)
virtual void notifyAlgorithmStarted(IConfiguredAlgorithm_sptr &algorithm)
virtual void notifyAlgorithmError(IConfiguredAlgorithm_sptr &algorithm, std::string const &message)
virtual void notifyBatchComplete(IConfiguredAlgorithm_sptr &lastAlgorithm, bool error)
std::shared_ptr< IConfiguredAlgorithm > IConfiguredAlgorithm_sptr
STL namespace.