Mantid
Loading...
Searching...
No Matches
AlgorithmObserverAdapter.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 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 +
9
11
13
14void AlgorithmObserverAdapter::progressHandle(const API::IAlgorithm *alg, double p, const std::string &msg,
15 const double estimatedTime, const int progressPrecision) {
16 UNUSED_ARG(alg)
17 try {
18 return callMethod<void>(getSelf(), "progressHandle", p, msg, estimatedTime, progressPrecision);
19 } catch (UndefinedAttributeError &) {
20 return;
21 }
22}
23
25 try {
26 return callMethod<void>(getSelf(), "startingHandle", alg);
27 } catch (UndefinedAttributeError &) {
28 return;
29 }
30}
31
33 UNUSED_ARG(alg)
34 try {
35 return callMethod<void>(getSelf(), "finishHandle");
36 } catch (UndefinedAttributeError &) {
37 return;
38 }
39}
40
41void AlgorithmObserverAdapter::errorHandle(const API::IAlgorithm *alg, const std::string &what) {
42 UNUSED_ARG(alg)
43 try {
44 return callMethod<void>(getSelf(), "errorHandle", what);
45 } catch (UndefinedAttributeError &) {
46 return;
47 }
48}
49
50} // namespace Mantid::PythonInterface
std::unique_ptr< ConceptT > m_self
#define UNUSED_ARG(x)
Function arguments are sometimes unused in certain implmentations but are required for documentation ...
Definition: System.h:64
Observes Algorithm notifications: start,progress,finish,error.
IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:45
void progressHandle(const API::IAlgorithm *alg, double p, const std::string &msg, const double estimatedTime, const int progressPrecision) override
void errorHandle(const API::IAlgorithm *alg, const std::string &what) override
void startingHandle(API::IAlgorithm_sptr alg) override
void finishHandle(const API::IAlgorithm *alg) override
PyObject * getSelf() const
Return the PyObject that owns this wrapper, i.e. self.
std::shared_ptr< IAlgorithm > IAlgorithm_sptr
shared pointer to Mantid::API::IAlgorithm
Defines an exception for an undefined attribute.
Definition: CallMethod.h:20