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

#include <AnalysisDataServiceObserver.h>

Inheritance diagram for Mantid::API::AnalysisDataServiceObserver:
Mantid::PythonInterface::AnalysisDataServiceObserverAdapter MantidQt::MantidWidgets::FitScriptGeneratorView

Public Member Functions

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

void _addHandle (const Poco::AutoPtr< AnalysisDataServiceImpl::AddNotification > &pNf)
 
void _clearHandle (const Poco::AutoPtr< AnalysisDataServiceImpl::ClearNotification > &pNf)
 
void _deleteHandle (const Poco::AutoPtr< AnalysisDataServiceImpl::PreDeleteNotification > &pNf)
 
void _groupHandle (const Poco::AutoPtr< AnalysisDataServiceImpl::GroupWorkspacesNotification > &pNf)
 
void _groupUpdateHandle (const Poco::AutoPtr< AnalysisDataServiceImpl::GroupUpdatedNotification > &pNf)
 
void _renameHandle (const Poco::AutoPtr< AnalysisDataServiceImpl::RenameNotification > &pNf)
 
void _replaceHandle (const Poco::AutoPtr< AnalysisDataServiceImpl::AfterReplaceNotification > &pNf)
 
void _unGroupHandle (const Poco::AutoPtr< AnalysisDataServiceImpl::UnGroupingWorkspaceNotification > &pNf)
 

Private Attributes

Poco::NObserver< AnalysisDataServiceObserver, AnalysisDataServiceImpl::AddNotification > m_addObserver
 Poco::NObserver for AddNotification. More...
 
Poco::NObserver< AnalysisDataServiceObserver, AnalysisDataServiceImpl::ClearNotification > m_clearObserver
 Poco::NObserver for ClearNotification. More...
 
Poco::NObserver< AnalysisDataServiceObserver, AnalysisDataServiceImpl::PreDeleteNotification > m_deleteObserver
 Poco::NObserver for DeleteNotification. More...
 
Poco::NObserver< AnalysisDataServiceObserver, AnalysisDataServiceImpl::GroupWorkspacesNotificationm_groupObserver
 Poco::NObserver for GroupNotification. More...
 
Poco::NObserver< AnalysisDataServiceObserver, AnalysisDataServiceImpl::GroupUpdatedNotificationm_groupUpdatedObserver
 Poco::NObserver for GroupUpdateNotification. More...
 
bool m_observingAdd {false}
 
bool m_observingClear {false}
 
bool m_observingDelete {false}
 
bool m_observingGroup {false}
 
bool m_observingGroupUpdate {false}
 
bool m_observingRename {false}
 
bool m_observingReplace {false}
 
bool m_observingUnGroup {false}
 
Poco::NObserver< AnalysisDataServiceObserver, AnalysisDataServiceImpl::RenameNotification > m_renameObserver
 Poco::NObserver for RenameNotification. More...
 
Poco::NObserver< AnalysisDataServiceObserver, AnalysisDataServiceImpl::AfterReplaceNotification > m_replaceObserver
 Poco::NObserver for ReplaceNotification. More...
 
Poco::NObserver< AnalysisDataServiceObserver, AnalysisDataServiceImpl::UnGroupingWorkspaceNotificationm_unGroupObserver
 Poco::NObserver for UnGroupNotification. More...
 

Detailed Description

Definition at line 38 of file AnalysisDataServiceObserver.h.

Constructor & Destructor Documentation

◆ AnalysisDataServiceObserver()

Mantid::API::AnalysisDataServiceObserver::AnalysisDataServiceObserver ( )

Definition at line 22 of file AnalysisDataServiceObserver.cpp.

◆ ~AnalysisDataServiceObserver()

Mantid::API::AnalysisDataServiceObserver::~AnalysisDataServiceObserver ( )
virtual

Definition at line 32 of file AnalysisDataServiceObserver.cpp.

References observeAll().

Member Function Documentation

◆ _addHandle()

void Mantid::API::AnalysisDataServiceObserver::_addHandle ( const Poco::AutoPtr< AnalysisDataServiceImpl::AddNotification > &  pNf)
private

Definition at line 247 of file AnalysisDataServiceObserver.cpp.

References addHandle(), and anyChangeHandle().

◆ _clearHandle()

void Mantid::API::AnalysisDataServiceObserver::_clearHandle ( const Poco::AutoPtr< AnalysisDataServiceImpl::ClearNotification > &  pNf)
private

Definition at line 264 of file AnalysisDataServiceObserver.cpp.

References anyChangeHandle(), clearHandle(), and UNUSED_ARG.

◆ _deleteHandle()

void Mantid::API::AnalysisDataServiceObserver::_deleteHandle ( const Poco::AutoPtr< AnalysisDataServiceImpl::PreDeleteNotification > &  pNf)
private

Definition at line 258 of file AnalysisDataServiceObserver.cpp.

References anyChangeHandle(), and deleteHandle().

◆ _groupHandle()

void Mantid::API::AnalysisDataServiceObserver::_groupHandle ( const Poco::AutoPtr< AnalysisDataServiceImpl::GroupWorkspacesNotification > &  pNf)
private

Definition at line 275 of file AnalysisDataServiceObserver.cpp.

References anyChangeHandle(), and groupHandle().

◆ _groupUpdateHandle()

void Mantid::API::AnalysisDataServiceObserver::_groupUpdateHandle ( const Poco::AutoPtr< AnalysisDataServiceImpl::GroupUpdatedNotification > &  pNf)
private

Definition at line 287 of file AnalysisDataServiceObserver.cpp.

References anyChangeHandle(), and groupUpdateHandle().

◆ _renameHandle()

void Mantid::API::AnalysisDataServiceObserver::_renameHandle ( const Poco::AutoPtr< AnalysisDataServiceImpl::RenameNotification > &  pNf)
private

Definition at line 270 of file AnalysisDataServiceObserver.cpp.

References anyChangeHandle(), and renameHandle().

◆ _replaceHandle()

void Mantid::API::AnalysisDataServiceObserver::_replaceHandle ( const Poco::AutoPtr< AnalysisDataServiceImpl::AfterReplaceNotification > &  pNf)
private

Definition at line 252 of file AnalysisDataServiceObserver.cpp.

References anyChangeHandle(), and replaceHandle().

◆ _unGroupHandle()

void Mantid::API::AnalysisDataServiceObserver::_unGroupHandle ( const Poco::AutoPtr< AnalysisDataServiceImpl::UnGroupingWorkspaceNotification > &  pNf)
private

Definition at line 281 of file AnalysisDataServiceObserver.cpp.

References anyChangeHandle(), and unGroupHandle().

◆ addHandle()

void Mantid::API::AnalysisDataServiceObserver::addHandle ( const std::string &  wsName,
const Workspace_sptr ws 
)
virtual

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 in Mantid::PythonInterface::AnalysisDataServiceObserverAdapter.

Definition at line 160 of file AnalysisDataServiceObserver.cpp.

References UNUSED_ARG.

Referenced by _addHandle().

◆ anyChangeHandle()

void Mantid::API::AnalysisDataServiceObserver::anyChangeHandle ( )
virtual

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

Reimplemented in Mantid::PythonInterface::AnalysisDataServiceObserverAdapter.

Definition at line 151 of file AnalysisDataServiceObserver.cpp.

Referenced by _addHandle(), _clearHandle(), _deleteHandle(), _groupHandle(), _groupUpdateHandle(), _renameHandle(), _replaceHandle(), and _unGroupHandle().

◆ clearHandle()

void Mantid::API::AnalysisDataServiceObserver::clearHandle ( )
virtual

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

Reimplemented in Mantid::PythonInterface::AnalysisDataServiceObserverAdapter, and MantidQt::MantidWidgets::FitScriptGeneratorView.

Definition at line 193 of file AnalysisDataServiceObserver.cpp.

Referenced by _clearHandle().

◆ deleteHandle()

void Mantid::API::AnalysisDataServiceObserver::deleteHandle ( const std::string &  wsName,
const Workspace_sptr ws 
)
virtual

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 in Mantid::PythonInterface::AnalysisDataServiceObserverAdapter, and MantidQt::MantidWidgets::FitScriptGeneratorView.

Definition at line 184 of file AnalysisDataServiceObserver.cpp.

References UNUSED_ARG.

Referenced by _deleteHandle().

◆ groupHandle()

void Mantid::API::AnalysisDataServiceObserver::groupHandle ( const std::string &  wsName,
const Workspace_sptr ws 
)
virtual

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 in Mantid::PythonInterface::AnalysisDataServiceObserverAdapter.

Definition at line 214 of file AnalysisDataServiceObserver.cpp.

References UNUSED_ARG.

Referenced by _groupHandle().

◆ groupUpdateHandle()

void Mantid::API::AnalysisDataServiceObserver::groupUpdateHandle ( const std::string &  wsName,
const Workspace_sptr ws 
)
virtual

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 in Mantid::PythonInterface::AnalysisDataServiceObserverAdapter.

Definition at line 239 of file AnalysisDataServiceObserver.cpp.

References UNUSED_ARG.

Referenced by _groupUpdateHandle().

◆ observeAdd()

void Mantid::API::AnalysisDataServiceObserver::observeAdd ( bool  turnOn = true)

Function will add/remove the observer to the ADS for when a workspace is added to it.

Parameters
turnOnbool; if this is True then, if not already present, the observer will be added else removed if it's false.

Definition at line 65 of file AnalysisDataServiceObserver.cpp.

References m_addObserver, and m_observingAdd.

Referenced by export_AnalysisDataServiceObserver(), and observeAll().

◆ observeAll()

void Mantid::API::AnalysisDataServiceObserver::observeAll ( bool  turnOn = true)

Function will turn on/off all observers for the ADS.

Parameters
turnOnbool; if this is True, then if not already present, the observer will be added else removed if it's false.

Definition at line 47 of file AnalysisDataServiceObserver.cpp.

References observeAdd(), observeClear(), observeDelete(), observeGroup(), observeGroupUpdate(), observeRename(), observeReplace(), and observeUnGroup().

Referenced by export_AnalysisDataServiceObserver(), and ~AnalysisDataServiceObserver().

◆ observeClear()

void Mantid::API::AnalysisDataServiceObserver::observeClear ( bool  turnOn = true)

Function will add/remove the observer to the ADS for when the ADS is cleared.

Parameters
turnOnbool; if this is True then, if not already present, the observer will be added else removed if it's false.

Definition at line 96 of file AnalysisDataServiceObserver.cpp.

References m_clearObserver, and m_observingClear.

Referenced by export_AnalysisDataServiceObserver(), MantidQt::MantidWidgets::FitScriptGeneratorView::FitScriptGeneratorView(), observeAll(), and MantidQt::MantidWidgets::FitScriptGeneratorView::~FitScriptGeneratorView().

◆ observeDelete()

void Mantid::API::AnalysisDataServiceObserver::observeDelete ( bool  turnOn = true)

Function will add/remove the observer to the ADS for when a workspace is deleted.

Parameters
turnOnbool; if this is True then, if not already present, the observer will be added else removed if it's false.

Definition at line 85 of file AnalysisDataServiceObserver.cpp.

References m_deleteObserver, and m_observingDelete.

Referenced by export_AnalysisDataServiceObserver(), MantidQt::MantidWidgets::FitScriptGeneratorView::FitScriptGeneratorView(), observeAll(), and MantidQt::MantidWidgets::FitScriptGeneratorView::~FitScriptGeneratorView().

◆ observeGroup()

void Mantid::API::AnalysisDataServiceObserver::observeGroup ( bool  turnOn = true)

Function will add/remove the observer to the ADS for when a group is added/created in the ADS.

Parameters
turnOnbool; if this is True then, if not already present, the observer will be added else removed if it's false.

Definition at line 118 of file AnalysisDataServiceObserver.cpp.

References m_groupObserver, and m_observingGroup.

Referenced by export_AnalysisDataServiceObserver(), and observeAll().

◆ observeGroupUpdate()

void Mantid::API::AnalysisDataServiceObserver::observeGroupUpdate ( bool  turnOn = true)

Function will add/remove the observer to the ADS for if a workspace is added to a group or removed.

Parameters
turnOnbool; if this is True then, if not already present, the observer will be added else removed if it's false.

Definition at line 140 of file AnalysisDataServiceObserver.cpp.

References m_groupUpdatedObserver, and m_observingGroupUpdate.

Referenced by export_AnalysisDataServiceObserver(), and observeAll().

◆ observeRename()

void Mantid::API::AnalysisDataServiceObserver::observeRename ( bool  turnOn = true)

Function will add/remove the observer to the ADS for when a workspace is renamed.

Parameters
turnOnbool; if this is True then, if not already present, the observer will be added else removed if it's false.

Definition at line 107 of file AnalysisDataServiceObserver.cpp.

References m_observingRename, and m_renameObserver.

Referenced by export_AnalysisDataServiceObserver(), MantidQt::MantidWidgets::FitScriptGeneratorView::FitScriptGeneratorView(), observeAll(), and MantidQt::MantidWidgets::FitScriptGeneratorView::~FitScriptGeneratorView().

◆ observeReplace()

void Mantid::API::AnalysisDataServiceObserver::observeReplace ( bool  turnOn = true)

Function will add/remove the observer to the ADS for when a workspace is replaced.

Parameters
turnOnbool; if this is True then, if not already present, the observer will be added else removed if it's false.

Definition at line 74 of file AnalysisDataServiceObserver.cpp.

References m_observingReplace, and m_replaceObserver.

Referenced by export_AnalysisDataServiceObserver(), and observeAll().

◆ observeUnGroup()

void Mantid::API::AnalysisDataServiceObserver::observeUnGroup ( bool  turnOn = true)

Function will add/remove the observer to the ADS for when a group is removed/delete from the ADS.

Parameters
turnOnbool; if this is True then, if not already present, the observer will be added else removed if it's false.

Definition at line 129 of file AnalysisDataServiceObserver.cpp.

References m_observingUnGroup, and m_unGroupObserver.

Referenced by export_AnalysisDataServiceObserver(), and observeAll().

◆ renameHandle()

void Mantid::API::AnalysisDataServiceObserver::renameHandle ( const std::string &  wsName,
const std::string &  newName 
)
virtual

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 in Mantid::PythonInterface::AnalysisDataServiceObserverAdapter, and MantidQt::MantidWidgets::FitScriptGeneratorView.

Definition at line 202 of file AnalysisDataServiceObserver.cpp.

References UNUSED_ARG.

Referenced by _renameHandle().

◆ replaceHandle()

void Mantid::API::AnalysisDataServiceObserver::replaceHandle ( const std::string &  wsName,
const Workspace_sptr ws 
)
virtual

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 in Mantid::PythonInterface::AnalysisDataServiceObserverAdapter.

Definition at line 172 of file AnalysisDataServiceObserver.cpp.

References UNUSED_ARG.

Referenced by _replaceHandle().

◆ unGroupHandle()

void Mantid::API::AnalysisDataServiceObserver::unGroupHandle ( const std::string &  wsName,
const Workspace_sptr ws 
)
virtual

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 in Mantid::PythonInterface::AnalysisDataServiceObserverAdapter.

Definition at line 226 of file AnalysisDataServiceObserver.cpp.

References UNUSED_ARG.

Referenced by _unGroupHandle().

Member Data Documentation

◆ m_addObserver

Poco::NObserver<AnalysisDataServiceObserver, AnalysisDataServiceImpl::AddNotification> Mantid::API::AnalysisDataServiceObserver::m_addObserver
private

Poco::NObserver for AddNotification.

Definition at line 77 of file AnalysisDataServiceObserver.h.

Referenced by observeAdd().

◆ m_clearObserver

Poco::NObserver<AnalysisDataServiceObserver, AnalysisDataServiceImpl::ClearNotification> Mantid::API::AnalysisDataServiceObserver::m_clearObserver
private

Poco::NObserver for ClearNotification.

Definition at line 86 of file AnalysisDataServiceObserver.h.

Referenced by observeClear().

◆ m_deleteObserver

Poco::NObserver<AnalysisDataServiceObserver, AnalysisDataServiceImpl::PreDeleteNotification> Mantid::API::AnalysisDataServiceObserver::m_deleteObserver
private

Poco::NObserver for DeleteNotification.

Definition at line 83 of file AnalysisDataServiceObserver.h.

Referenced by observeDelete().

◆ m_groupObserver

Poco::NObserver<AnalysisDataServiceObserver, AnalysisDataServiceImpl::GroupWorkspacesNotification> Mantid::API::AnalysisDataServiceObserver::m_groupObserver
private

Poco::NObserver for GroupNotification.

Definition at line 92 of file AnalysisDataServiceObserver.h.

Referenced by observeGroup().

◆ m_groupUpdatedObserver

Poco::NObserver<AnalysisDataServiceObserver, AnalysisDataServiceImpl::GroupUpdatedNotification> Mantid::API::AnalysisDataServiceObserver::m_groupUpdatedObserver
private

Poco::NObserver for GroupUpdateNotification.

Definition at line 100 of file AnalysisDataServiceObserver.h.

Referenced by observeGroupUpdate().

◆ m_observingAdd

bool Mantid::API::AnalysisDataServiceObserver::m_observingAdd {false}
private

Definition at line 64 of file AnalysisDataServiceObserver.h.

Referenced by observeAdd().

◆ m_observingClear

bool Mantid::API::AnalysisDataServiceObserver::m_observingClear {false}
private

Definition at line 64 of file AnalysisDataServiceObserver.h.

Referenced by observeClear().

◆ m_observingDelete

bool Mantid::API::AnalysisDataServiceObserver::m_observingDelete {false}
private

Definition at line 64 of file AnalysisDataServiceObserver.h.

Referenced by observeDelete().

◆ m_observingGroup

bool Mantid::API::AnalysisDataServiceObserver::m_observingGroup {false}
private

Definition at line 65 of file AnalysisDataServiceObserver.h.

Referenced by observeGroup().

◆ m_observingGroupUpdate

bool Mantid::API::AnalysisDataServiceObserver::m_observingGroupUpdate {false}
private

Definition at line 65 of file AnalysisDataServiceObserver.h.

Referenced by observeGroupUpdate().

◆ m_observingRename

bool Mantid::API::AnalysisDataServiceObserver::m_observingRename {false}
private

Definition at line 65 of file AnalysisDataServiceObserver.h.

Referenced by observeRename().

◆ m_observingReplace

bool Mantid::API::AnalysisDataServiceObserver::m_observingReplace {false}
private

Definition at line 64 of file AnalysisDataServiceObserver.h.

Referenced by observeReplace().

◆ m_observingUnGroup

bool Mantid::API::AnalysisDataServiceObserver::m_observingUnGroup {false}
private

Definition at line 65 of file AnalysisDataServiceObserver.h.

Referenced by observeUnGroup().

◆ m_renameObserver

Poco::NObserver<AnalysisDataServiceObserver, AnalysisDataServiceImpl::RenameNotification> Mantid::API::AnalysisDataServiceObserver::m_renameObserver
private

Poco::NObserver for RenameNotification.

Definition at line 89 of file AnalysisDataServiceObserver.h.

Referenced by observeRename().

◆ m_replaceObserver

Poco::NObserver<AnalysisDataServiceObserver, AnalysisDataServiceImpl::AfterReplaceNotification> Mantid::API::AnalysisDataServiceObserver::m_replaceObserver
private

Poco::NObserver for ReplaceNotification.

Definition at line 80 of file AnalysisDataServiceObserver.h.

Referenced by observeReplace().

◆ m_unGroupObserver

Poco::NObserver<AnalysisDataServiceObserver, AnalysisDataServiceImpl::UnGroupingWorkspaceNotification> Mantid::API::AnalysisDataServiceObserver::m_unGroupObserver
private

Poco::NObserver for UnGroupNotification.

Definition at line 96 of file AnalysisDataServiceObserver.h.

Referenced by observeUnGroup().


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