Mantid
Loading...
Searching...
No Matches
AlgorithmObserverAdapter.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2013 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
10#include <boost/python/wrapper.hpp>
11
12namespace Mantid {
13namespace PythonInterface {
14
23public:
24 explicit AlgorithmObserverAdapter(PyObject *self);
27 void progressHandle(const API::IAlgorithm *alg, double p, const std::string &msg, const double estimatedTime,
28 const int progressPrecision) override;
29 void startingHandle(API::IAlgorithm_sptr alg) override;
30 void finishHandle(const API::IAlgorithm *alg) override;
31 void errorHandle(const API::IAlgorithm *alg, const std::string &what) override;
32
33private:
35 inline PyObject *getSelf() const { return m_self; }
37 PyObject *m_self;
38};
39
40} // namespace PythonInterface
41} // namespace Mantid
std::unique_ptr< ConceptT > m_self
#define DLLExport
Definitions of the DLLImport compiler directives for MSVC.
Definition: System.h:53
Observes Algorithm notifications: start,progress,finish,error.
IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:45
A wrapper class helping to export AlgorithmObserver to python.
PyObject * m_self
Value of "self" used by python to refer to an instance of this class.
AlgorithmObserverAdapter(const AlgorithmObserverAdapter &)=delete
AlgorithmObserverAdapter & operator=(const AlgorithmObserverAdapter &)=delete
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
Helper class which provides the Collimation Length for SANS instruments.