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

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

#include <AnalysisDataServiceObserverAdapter.h>

Inheritance diagram for Mantid::PythonInterface::AnalysisDataServiceObserverAdapter:
Mantid::API::AnalysisDataServiceObserver

Public Member Functions

void addHandle (const std::string &wsName, const Workspace_sptr &ws) override
 If a workspace is added to the ADS, then this function will trigger, works by overloading this class and overriding this function. More...
 
 AnalysisDataServiceObserverAdapter (const AnalysisDataServiceObserverAdapter &)=delete
 
 AnalysisDataServiceObserverAdapter (PyObject *self)
 
void anyChangeHandle () override
 If anyChange to the ADS occurs then this function will trigger, works by overloading this class and overriding this function. More...
 
void clearHandle () override
 If the ADS is cleared, then this function will trigger, works by overloading this class and overriding this function. More...
 
void deleteHandle (const std::string &wsName, const Workspace_sptr &ws) override
 If a workspace is deleted from the ADS, then this function will trigger, works by overloading this class and overriding this function. More...
 
void groupHandle (const std::string &wsName, const Workspace_sptr &ws) override
 If a group is created/added to the ADS, then this function will trigger, works by overloading this class and overriding this function. More...
 
void groupUpdateHandle (const std::string &wsName, const Workspace_sptr &ws) override
 If a group has a workspace added/removed in the ADS, then this function will trigger, works by overloading this class and overriding this function. More...
 
AnalysisDataServiceObserverAdapteroperator= (const AnalysisDataServiceObserverAdapter &)=delete
 
void renameHandle (const std::string &wsName, const std::string &newName) override
 If a workspace is renamed in the ADS, then this function will trigger, works by overloading this class and overriding this function. More...
 
void replaceHandle (const std::string &wsName, const Workspace_sptr &ws) override
 If a workspace is replaced in the ADS, then this function will trigger, works by overloading this class and overriding this function. More...
 
void unGroupHandle (const std::string &wsName, const Workspace_sptr &ws) override
 If a group is removed from the ADS, then this function will trigger, works by overloading this class and overriding this function. More...
 
- Public Member Functions inherited from Mantid::API::AnalysisDataServiceObserver
virtual void addHandle (const std::string &wsName, const Workspace_sptr &ws)
 If a workspace is added to the ADS, then this function will trigger, works by overloading this class and overriding this function. More...
 
 AnalysisDataServiceObserver ()
 
virtual void anyChangeHandle ()
 If anyChange to the ADS occurs then this function will trigger, works by overloading this class and overriding this function. More...
 
virtual void clearHandle ()
 If the ADS is cleared, then this function will trigger, works by overloading this class and overriding this function. More...
 
virtual void deleteHandle (const std::string &wsName, const Workspace_sptr &ws)
 If a workspace is deleted from the ADS, then this function will trigger, works by overloading this class and overriding this function. More...
 
virtual void groupHandle (const std::string &wsName, const Workspace_sptr &ws)
 If a group is created/added to the ADS, then this function will trigger, works by overloading this class and overriding this function. More...
 
virtual void groupUpdateHandle (const std::string &wsName, const Workspace_sptr &ws)
 If a group has a workspace added/removed in the ADS, then this function will trigger, works by overloading this class and overriding this function. More...
 
void observeAdd (bool turnOn=true)
 Function will add/remove the observer to the ADS for when a workspace is added to it. More...
 
void observeAll (bool turnOn=true)
 Function will turn on/off all observers for the ADS. More...
 
void observeClear (bool turnOn=true)
 Function will add/remove the observer to the ADS for when the ADS is cleared. More...
 
void observeDelete (bool turnOn=true)
 Function will add/remove the observer to the ADS for when a workspace is deleted. More...
 
void observeGroup (bool turnOn=true)
 Function will add/remove the observer to the ADS for when a group is added/created in the ADS. More...
 
void observeGroupUpdate (bool turnOn=true)
 Function will add/remove the observer to the ADS for if a workspace is added to a group or removed. More...
 
void observeRename (bool turnOn=true)
 Function will add/remove the observer to the ADS for when a workspace is renamed. More...
 
void observeReplace (bool turnOn=true)
 Function will add/remove the observer to the ADS for when a workspace is replaced. More...
 
void observeUnGroup (bool turnOn=true)
 Function will add/remove the observer to the ADS for when a group is removed/delete from the ADS. More...
 
virtual void renameHandle (const std::string &wsName, const std::string &newName)
 If a workspace is renamed in the ADS, then this function will trigger, works by overloading this class and overriding this function. More...
 
virtual void replaceHandle (const std::string &wsName, const Workspace_sptr &ws)
 If a workspace is replaced in the ADS, then this function will trigger, works by overloading this class and overriding this function. More...
 
virtual void unGroupHandle (const std::string &wsName, const Workspace_sptr &ws)
 If a group is removed from the ADS, then this function will trigger, works by overloading this class and overriding this function. More...
 
virtual ~AnalysisDataServiceObserver ()
 

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 AnalysisDataServiceObserver to python.

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

Definition at line 22 of file AnalysisDataServiceObserverAdapter.h.

Constructor & Destructor Documentation

◆ AnalysisDataServiceObserverAdapter() [1/2]

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

Definition at line 13 of file AnalysisDataServiceObserverAdapter.cpp.

◆ AnalysisDataServiceObserverAdapter() [2/2]

Mantid::PythonInterface::AnalysisDataServiceObserverAdapter::AnalysisDataServiceObserverAdapter ( const AnalysisDataServiceObserverAdapter )
delete

Member Function Documentation

◆ addHandle()

void Mantid::PythonInterface::AnalysisDataServiceObserverAdapter::addHandle ( const std::string &  wsName,
const Workspace_sptr ws 
)
overridevirtual

If a workspace is added to the ADS, then this function will trigger, works by overloading this class and overriding this function.

Parameters
wsNamestd::string; the name of the workspace added
wsWorkspace_sptr; the Workspace that is added

Reimplemented from Mantid::API::AnalysisDataServiceObserver.

Definition at line 24 of file AnalysisDataServiceObserverAdapter.cpp.

References getSelf().

◆ anyChangeHandle()

void Mantid::PythonInterface::AnalysisDataServiceObserverAdapter::anyChangeHandle ( )
overridevirtual

If anyChange to the ADS occurs then this function will trigger, works by overloading this class and overriding this function.

Reimplemented from Mantid::API::AnalysisDataServiceObserver.

Definition at line 16 of file AnalysisDataServiceObserverAdapter.cpp.

References getSelf().

◆ clearHandle()

void Mantid::PythonInterface::AnalysisDataServiceObserverAdapter::clearHandle ( )
overridevirtual

If the ADS is cleared, then this function will trigger, works by overloading this class and overriding this function.

Reimplemented from Mantid::API::AnalysisDataServiceObserver.

Definition at line 48 of file AnalysisDataServiceObserverAdapter.cpp.

References getSelf().

◆ deleteHandle()

void Mantid::PythonInterface::AnalysisDataServiceObserverAdapter::deleteHandle ( const std::string &  wsName,
const Workspace_sptr ws 
)
overridevirtual

If a workspace is deleted from the ADS, then this function will trigger, works by overloading this class and overriding this function.

Parameters
wsNamestd::string; the name of the workspace
wsWorkspace_sptr; the Workspace that is deleted

Reimplemented from Mantid::API::AnalysisDataServiceObserver.

Definition at line 40 of file AnalysisDataServiceObserverAdapter.cpp.

References getSelf().

◆ getSelf()

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

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

Definition at line 40 of file AnalysisDataServiceObserverAdapter.h.

References m_self.

Referenced by addHandle(), anyChangeHandle(), clearHandle(), deleteHandle(), groupHandle(), groupUpdateHandle(), renameHandle(), replaceHandle(), and unGroupHandle().

◆ groupHandle()

void Mantid::PythonInterface::AnalysisDataServiceObserverAdapter::groupHandle ( const std::string &  wsName,
const Workspace_sptr ws 
)
overridevirtual

If a group is created/added to the ADS, then this function will trigger, works by overloading this class and overriding this function.

Parameters
wsNamestd::string; the name of the workspace
wsWorkspace_sptr; the WorkspaceGroup that was added/created

Reimplemented from Mantid::API::AnalysisDataServiceObserver.

Definition at line 64 of file AnalysisDataServiceObserverAdapter.cpp.

References getSelf().

◆ groupUpdateHandle()

void Mantid::PythonInterface::AnalysisDataServiceObserverAdapter::groupUpdateHandle ( const std::string &  wsName,
const Workspace_sptr ws 
)
overridevirtual

If a group has a workspace added/removed in the ADS, then this function will trigger, works by overloading this class and overriding this function.

Parameters
wsNamestd::string; the name of the workspace
wsWorkspace_sptr; the WorkspaceGroup that was updated

Reimplemented from Mantid::API::AnalysisDataServiceObserver.

Definition at line 80 of file AnalysisDataServiceObserverAdapter.cpp.

References getSelf().

◆ operator=()

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

◆ renameHandle()

void Mantid::PythonInterface::AnalysisDataServiceObserverAdapter::renameHandle ( const std::string &  wsName,
const std::string &  newName 
)
overridevirtual

If a workspace is renamed in the ADS, then this function will trigger, works by overloading this class and overriding this function.

Parameters
wsNamestd::string; the name of the workspace
newNamestd::string; the new name of the workspace

Reimplemented from Mantid::API::AnalysisDataServiceObserver.

Definition at line 56 of file AnalysisDataServiceObserverAdapter.cpp.

References getSelf().

◆ replaceHandle()

void Mantid::PythonInterface::AnalysisDataServiceObserverAdapter::replaceHandle ( const std::string &  wsName,
const Workspace_sptr ws 
)
overridevirtual

If a workspace is replaced in the ADS, then this function will trigger, works by overloading this class and overriding this function.

Parameters
wsNamestd::string; the name of the workspace replacing
wsWorkspace_sptr; the Workspace that is replacing

Reimplemented from Mantid::API::AnalysisDataServiceObserver.

Definition at line 32 of file AnalysisDataServiceObserverAdapter.cpp.

References getSelf().

◆ unGroupHandle()

void Mantid::PythonInterface::AnalysisDataServiceObserverAdapter::unGroupHandle ( const std::string &  wsName,
const Workspace_sptr ws 
)
overridevirtual

If a group is removed from the ADS, then this function will trigger, works by overloading this class and overriding this function.

Parameters
wsNamestd::string; the name of the workspace
wsWorkspace_sptr; the WorkspaceGroup that was ungrouped

Reimplemented from Mantid::API::AnalysisDataServiceObserver.

Definition at line 72 of file AnalysisDataServiceObserverAdapter.cpp.

References getSelf().

Member Data Documentation

◆ m_self

PyObject* Mantid::PythonInterface::AnalysisDataServiceObserverAdapter::m_self
private

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

Definition at line 42 of file AnalysisDataServiceObserverAdapter.h.


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