Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Mantid::PythonInterface::AlgorithmObserverAdapter Class Referencefinal

A wrapper class helping to export AlgorithmObserver to python. More...

#include <AlgorithmObserverAdapter.h>

Inheritance diagram for Mantid::PythonInterface::AlgorithmObserverAdapter:
Mantid::API::AlgorithmObserver

Public Member Functions

 AlgorithmObserverAdapter (const AlgorithmObserverAdapter &)=delete
 
 AlgorithmObserverAdapter (PyObject *self)
 
void errorHandle (const API::IAlgorithm *alg, const std::string &what) override
 
void finishHandle (const API::IAlgorithm *alg) override
 
AlgorithmObserverAdapteroperator= (const AlgorithmObserverAdapter &)=delete
 
void progressHandle (const API::IAlgorithm *alg, double p, const std::string &msg, const double estimatedTime, const int progressPrecision) override
 
void startingHandle (API::IAlgorithm_sptr alg) override
 
- Public Member Functions inherited from Mantid::API::AlgorithmObserver
 AlgorithmObserver ()
 Default constructor. More...
 
 AlgorithmObserver (const IAlgorithm_const_sptr &alg)
 Constructs AlgorithmObserver and connects all its handlers to algorithm alg. More...
 
virtual void errorHandle (const IAlgorithm *alg, const std::string &what)
 
virtual void finishHandle (const IAlgorithm *alg)
 
void observeAll (const IAlgorithm_const_sptr &alg)
 Connect to algorithm alg and observe all its notifications. More...
 
void observeError (const IAlgorithm_const_sptr &alg)
 Connect to algorithm alg and observe its error notification. More...
 
void observeFinish (const IAlgorithm_const_sptr &alg)
 Connect to algorithm alg and observe its finish notification. More...
 
void observeProgress (const IAlgorithm_const_sptr &alg)
 Connect to algorithm alg and observe its progress notification. More...
 
void observeStart (const IAlgorithm_const_sptr &alg)
 Connect to algorithm alg and observe its start notification. More...
 
void observeStarting ()
 Connect to AlgorithmManager and observe its starting notifications. More...
 
virtual void progressHandle (const IAlgorithm *alg, double p, const std::string &msg, const double estimatedTime, const int progressPrecision)
 
virtual void startHandle (const IAlgorithm *alg)
 
virtual void startingHandle (IAlgorithm_sptr alg)
 
void stopObserving (const IAlgorithm_const_sptr &alg)
 Disconnect from algorithm alg. More...
 
void stopObserving (const Mantid::API::IAlgorithm *alg)
 
void stopObservingManager ()
 Disconnect from the algorithm manager. More...
 
virtual ~AlgorithmObserver ()
 Virtual destructor. More...
 

Private Member Functions

PyObject * getSelf () const
 Return the PyObject that owns this wrapper, i.e. self. More...
 

Private Attributes

PyObject * m_self
 Value of "self" used by python to refer to an instance of this class. More...
 

Detailed Description

A wrapper class helping to export AlgorithmObserver to python.

It provides access from the C++ side to methods defined in python on subclasses of AlgorithmObserver. This allows the virtual methods to be overriden by python subclasses.

Definition at line 22 of file AlgorithmObserverAdapter.h.

Constructor & Destructor Documentation

◆ AlgorithmObserverAdapter() [1/2]

Mantid::PythonInterface::AlgorithmObserverAdapter::AlgorithmObserverAdapter ( PyObject *  self)
explicit

Definition at line 12 of file AlgorithmObserverAdapter.cpp.

◆ AlgorithmObserverAdapter() [2/2]

Mantid::PythonInterface::AlgorithmObserverAdapter::AlgorithmObserverAdapter ( const AlgorithmObserverAdapter )
delete

Member Function Documentation

◆ errorHandle()

void Mantid::PythonInterface::AlgorithmObserverAdapter::errorHandle ( const API::IAlgorithm alg,
const std::string &  what 
)
overridevirtual

Reimplemented from Mantid::API::AlgorithmObserver.

Definition at line 41 of file AlgorithmObserverAdapter.cpp.

References getSelf(), and UNUSED_ARG.

◆ finishHandle()

void Mantid::PythonInterface::AlgorithmObserverAdapter::finishHandle ( const API::IAlgorithm alg)
overridevirtual

Reimplemented from Mantid::API::AlgorithmObserver.

Definition at line 32 of file AlgorithmObserverAdapter.cpp.

References getSelf(), and UNUSED_ARG.

◆ getSelf()

PyObject * Mantid::PythonInterface::AlgorithmObserverAdapter::getSelf ( ) const
inlineprivate

Return the PyObject that owns this wrapper, i.e. self.

Definition at line 35 of file AlgorithmObserverAdapter.h.

References m_self.

Referenced by errorHandle(), finishHandle(), progressHandle(), and startingHandle().

◆ operator=()

AlgorithmObserverAdapter & Mantid::PythonInterface::AlgorithmObserverAdapter::operator= ( const AlgorithmObserverAdapter )
delete

◆ progressHandle()

void Mantid::PythonInterface::AlgorithmObserverAdapter::progressHandle ( const API::IAlgorithm alg,
double  p,
const std::string &  msg,
const double  estimatedTime,
const int  progressPrecision 
)
overridevirtual

Reimplemented from Mantid::API::AlgorithmObserver.

Definition at line 14 of file AlgorithmObserverAdapter.cpp.

References getSelf(), and UNUSED_ARG.

◆ startingHandle()

void Mantid::PythonInterface::AlgorithmObserverAdapter::startingHandle ( API::IAlgorithm_sptr  alg)
overridevirtual

Reimplemented from Mantid::API::AlgorithmObserver.

Definition at line 24 of file AlgorithmObserverAdapter.cpp.

References getSelf().

Member Data Documentation

◆ m_self

PyObject* Mantid::PythonInterface::AlgorithmObserverAdapter::m_self
private

Value of "self" used by python to refer to an instance of this class.

Definition at line 37 of file AlgorithmObserverAdapter.h.


The documentation for this class was generated from the following files: