Mantid
Loading...
Searching...
No Matches
QtJobRunner.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2022 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 +
7#pragma once
8
9#include "DllOption.h"
10#include "IJobRunner.h"
13
14#include <QObject>
15
16#include <deque>
17#include <vector>
18
19namespace MantidQt::API {
20class JobRunnerSubscriber;
21
22class EXPORT_OPT_MANTIDQT_COMMON QtJobRunner : public QObject, public IJobRunner {
23 Q_OBJECT
24public:
25 QtJobRunner(bool const stopOnFailure = false);
26 void subscribe(JobRunnerSubscriber *notifyee) override;
27 void clearAlgorithmQueue() override;
28 void setAlgorithmQueue(std::deque<MantidQt::API::IConfiguredAlgorithm_sptr> algorithms) override;
29 void executeAlgorithmQueue() override;
30 void executeAlgorithm(MantidQt::API::IConfiguredAlgorithm_sptr algorithm) override;
31 void cancelAlgorithmQueue() override;
32
33private slots:
34 void onBatchComplete(bool error);
35 void onBatchCancelled();
36 void onAlgorithmStarted(MantidQt::API::IConfiguredAlgorithm_sptr algorithm);
37 void onAlgorithmComplete(MantidQt::API::IConfiguredAlgorithm_sptr algorithm);
38 void onAlgorithmError(MantidQt::API::IConfiguredAlgorithm_sptr algorithm, const std::string &errorMessage);
39
40private:
43 void connectBatchAlgoRunnerSlots();
44};
45} // namespace MantidQt::API
#define EXPORT_OPT_MANTIDQT_COMMON
Definition DllOption.h:15
double error
Algorithm runner for execution of a queue of algorithms.
IJobRunner is an interface to a class that provides functionality to run a batch algorithm queue.
Definition IJobRunner.h:39
JobRunnerSubscriber is an interface to a class that subscribes to notifications from an IJobRunner.
Definition IJobRunner.h:24
MantidQt::API::BatchAlgorithmRunner m_batchAlgoRunner
Definition QtJobRunner.h:41
JobRunnerSubscriber * m_notifyee
Definition QtJobRunner.h:42
std::shared_ptr< IConfiguredAlgorithm > IConfiguredAlgorithm_sptr