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

Observes AnalysisDataService notifications: add,replace,delete. More...

#include <WorkspaceObserver.h>

Inheritance diagram for MantidQt::API::WorkspaceObserver:
MantidQt::MantidWidgets::FitPropertyBrowser MantidQt::MantidWidgets::MuonFitPropertyBrowser

Public Member Functions

void observeAdd (bool on=true)
 Observe additions. More...
 
void observeADSClear (bool on=true)
 Observe clearances. More...
 
void observeAfterReplace (bool on=true)
 Observe replacements. More...
 
void observePostDelete (bool on=true)
 Observe workspace deletes. More...
 
void observePreDelete (bool on=true)
 Observe workspace deletes. More...
 
void observeRename (bool on=true)
 Observe renaming. More...
 
 WorkspaceObserver ()
 Default constructor. More...
 
virtual ~WorkspaceObserver ()
 Destructor. More...
 

Protected Member Functions

void _addHandle (Mantid::API::WorkspaceAddNotification_ptr pNf)
 Poco notification handler for DataService::DeleteNotification. More...
 
void _afterReplaceHandle (Mantid::API::WorkspaceAfterReplaceNotification_ptr pNf)
 Poco notification handler for DataService::AfterReplaceNotification. More...
 
void _clearADSHandle (Mantid::API::ClearADSNotification_ptr)
 ADS clear notification. More...
 
void _postDeleteHandle (Mantid::API::WorkspacePostDeleteNotification_ptr pNf)
 Poco notification handler for DataService::PostDeleteNotification. More...
 
void _preDeleteHandle (Mantid::API::WorkspacePreDeleteNotification_ptr pNf)
 Poco notification handler for DataService::PostDeleteNotification. More...
 
void _renameHandle (Mantid::API::WorkspaceRenameNotification_ptr pNf)
 Poco notification handler for DataService::RenameNotification. More...
 
virtual void addHandle (const std::string &wsName, const Mantid::API::Workspace_sptr &ws)
 Handler of the add notifications. More...
 
virtual void afterReplaceHandle (const std::string &wsName, const Mantid::API::Workspace_sptr &ws)
 Handler of the AfterReplace notifications. More...
 
virtual void clearADSHandle ()
 Handle an ADS clear notification. More...
 
virtual void postDeleteHandle (const std::string &wsName)
 Handler of the delete notifications. More...
 
virtual void preDeleteHandle (const std::string &wsName, const Mantid::API::Workspace_sptr &ws)
 Handler of the delete notifications. More...
 
virtual void renameHandle (const std::string &oldName, const std::string &newName)
 Handler of the Rename notifications. More...
 

Protected Attributes

Poco::NObserver< WorkspaceObserver, Mantid::API::WorkspaceAddNotificationm_addObserver
 Poco::NObserver for DataServise::AddNotification. More...
 
Poco::NObserver< WorkspaceObserver, Mantid::API::WorkspaceAfterReplaceNotificationm_afterReplaceObserver
 Poco::NObserver for DataServise::AfterReplaceNotification. More...
 
Poco::NObserver< WorkspaceObserver, Mantid::API::ClearADSNotificationm_clearADSObserver
 Clear notification observer. More...
 
Poco::NObserver< WorkspaceObserver, Mantid::API::WorkspacePostDeleteNotificationm_postDeleteObserver
 Poco::NObserver for DataServise::DeleteNotification. More...
 
Poco::NObserver< WorkspaceObserver, Mantid::API::WorkspacePreDeleteNotificationm_preDeleteObserver
 Poco::NObserver for DataServise::DeleteNotification. More...
 
Poco::NObserver< WorkspaceObserver, Mantid::API::WorkspaceRenameNotificationm_renameObserver
 Poco::NObserver for DataServise::RenameNotification. More...
 

Private Attributes

bool m_add_observed
 
bool m_clr_observed
 
bool m_postdel_observed
 
bool m_predel_observed
 
std::unique_ptr< ObserverCallbackm_proxy
 
bool m_rename_observed
 
bool m_repl_observed
 

Friends

class ObserverCallback
 

Detailed Description

Observes AnalysisDataService notifications: add,replace,delete.

Hides Poco::Notification API from the user.

Author
Roman Tolchenov, Tessella plc
Date
18/09/2009

Definition at line 89 of file WorkspaceObserver.h.

Constructor & Destructor Documentation

◆ WorkspaceObserver()

MantidQt::API::WorkspaceObserver::WorkspaceObserver ( )

Default constructor.

Definition at line 45 of file WorkspaceObserver.cpp.

◆ ~WorkspaceObserver()

MantidQt::API::WorkspaceObserver::~WorkspaceObserver ( )
virtual

Member Function Documentation

◆ _addHandle()

void MantidQt::API::WorkspaceObserver::_addHandle ( Mantid::API::WorkspaceAddNotification_ptr  pNf)
inlineprotected

Poco notification handler for DataService::DeleteNotification.

Parameters
pNf:: The pointer to the notification.

Definition at line 185 of file WorkspaceObserver.h.

◆ _afterReplaceHandle()

void MantidQt::API::WorkspaceObserver::_afterReplaceHandle ( Mantid::API::WorkspaceAfterReplaceNotification_ptr  pNf)
inlineprotected

Poco notification handler for DataService::AfterReplaceNotification.

Parameters
pNf:: The pointer to the notification.

Definition at line 194 of file WorkspaceObserver.h.

◆ _clearADSHandle()

void MantidQt::API::WorkspaceObserver::_clearADSHandle ( Mantid::API::ClearADSNotification_ptr  )
inlineprotected

ADS clear notification.

Definition at line 212 of file WorkspaceObserver.h.

◆ _postDeleteHandle()

void MantidQt::API::WorkspaceObserver::_postDeleteHandle ( Mantid::API::WorkspacePostDeleteNotification_ptr  pNf)
inlineprotected

Poco notification handler for DataService::PostDeleteNotification.

Parameters
pNf:: The pointer to the notification.

Definition at line 176 of file WorkspaceObserver.h.

◆ _preDeleteHandle()

void MantidQt::API::WorkspaceObserver::_preDeleteHandle ( Mantid::API::WorkspacePreDeleteNotification_ptr  pNf)
inlineprotected

Poco notification handler for DataService::PostDeleteNotification.

Parameters
pNf:: The pointer to the notification.

Definition at line 167 of file WorkspaceObserver.h.

◆ _renameHandle()

void MantidQt::API::WorkspaceObserver::_renameHandle ( Mantid::API::WorkspaceRenameNotification_ptr  pNf)
inlineprotected

Poco notification handler for DataService::RenameNotification.

Parameters
pNf:: The pointer to the notification.

Definition at line 203 of file WorkspaceObserver.h.

◆ addHandle()

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

Handler of the add notifications.

Could be overriden in inherited classes. The default handler is provided (doing nothing).

Parameters
wsName:: The name of the added workspace.
ws:: The shared pointer to the workspace to be added.

Definition at line 132 of file WorkspaceObserver.h.

Referenced by MantidQt::API::ObserverCallback::handleAdd().

◆ afterReplaceHandle()

virtual void MantidQt::API::WorkspaceObserver::afterReplaceHandle ( const std::string &  wsName,
const Mantid::API::Workspace_sptr ws 
)
inlineprotectedvirtual

Handler of the AfterReplace notifications.

Could be overriden in inherited classes. The default handler is provided (doing nothing).

Parameters
wsName:: The name of the deleted workspace.
ws:: The shared pointer to the workspace to be deleted.

Definition at line 142 of file WorkspaceObserver.h.

Referenced by MantidQt::API::ObserverCallback::handleAfterReplace().

◆ clearADSHandle()

virtual void MantidQt::API::WorkspaceObserver::clearADSHandle ( )
inlineprotectedvirtual

Handle an ADS clear notification.

Definition at line 161 of file WorkspaceObserver.h.

Referenced by MantidQt::API::ObserverCallback::handleClearADS().

◆ observeAdd()

void MantidQt::API::WorkspaceObserver::observeAdd ( bool  turnOn = true)

Observe additions.

Turn on observations of workspace add notifications from the ADS.

Parameters
turnOn:: If true observe the notifications, otherwise disable observation [default=true]

Definition at line 153 of file WorkspaceObserver.cpp.

References Mantid::Kernel::SingletonHolder< T >::Instance(), m_add_observed, m_addObserver, and m_proxy.

Referenced by MantidQt::MantidWidgets::FitPropertyBrowser::setADSObserveEnabled().

◆ observeADSClear()

void MantidQt::API::WorkspaceObserver::observeADSClear ( bool  turnOn = true)

Observe clearances.

Turn on observations of workspace clear notifications from the ADS.

Parameters
turnOn:: If true observe the notifications, otherwise disable observation [default=true]

Definition at line 171 of file WorkspaceObserver.cpp.

References Mantid::Kernel::SingletonHolder< T >::Instance(), m_clearADSObserver, m_clr_observed, and m_proxy.

◆ observeAfterReplace()

void MantidQt::API::WorkspaceObserver::observeAfterReplace ( bool  turnOn = true)

Observe replacements.

Turn on observations of workspace replacement notifications from the ADS.

Parameters
turnOn:: If true observe the notifications, otherwise disable observation [default=true]

Definition at line 117 of file WorkspaceObserver.cpp.

References Mantid::Kernel::SingletonHolder< T >::Instance(), m_afterReplaceObserver, m_proxy, and m_repl_observed.

◆ observePostDelete()

void MantidQt::API::WorkspaceObserver::observePostDelete ( bool  turnOn = true)

Observe workspace deletes.

Turn on observations of workspace post delete notifications from the ADS.

Parameters
turnOn:: If true observe the notifications, other wise disable observation [default=true]

Definition at line 96 of file WorkspaceObserver.cpp.

References Mantid::Kernel::SingletonHolder< T >::Instance(), m_postdel_observed, m_postDeleteObserver, and m_proxy.

Referenced by MantidQt::MantidWidgets::FitPropertyBrowser::setADSObserveEnabled().

◆ observePreDelete()

void MantidQt::API::WorkspaceObserver::observePreDelete ( bool  turnOn = true)

Observe workspace deletes.

Turn on observations of workspace delete notifications from the ADS.

Parameters
turnOn:: If true observe the notifications, otherwise disable observation [default=true]

Definition at line 75 of file WorkspaceObserver.cpp.

References Mantid::Kernel::SingletonHolder< T >::Instance(), m_predel_observed, m_preDeleteObserver, and m_proxy.

◆ observeRename()

void MantidQt::API::WorkspaceObserver::observeRename ( bool  turnOn = true)

Observe renaming.

Turn on observations of workspace renaming notifications from the ADS.

Parameters
turnOn:: If true observe the notifications, otherwise disable observation [default=true]

Definition at line 135 of file WorkspaceObserver.cpp.

References Mantid::Kernel::SingletonHolder< T >::Instance(), m_proxy, m_rename_observed, and m_renameObserver.

Referenced by MantidQt::MantidWidgets::FitPropertyBrowser::setADSObserveEnabled().

◆ postDeleteHandle()

virtual void MantidQt::API::WorkspaceObserver::postDeleteHandle ( const std::string &  wsName)
inlineprotectedvirtual

Handler of the delete notifications.

Could be overriden in inherited classes. The default handler is provided (doing nothing).

Parameters
wsName:: The name of the deleted workspace.

Reimplemented in MantidQt::MantidWidgets::FitPropertyBrowser.

Definition at line 126 of file WorkspaceObserver.h.

Referenced by MantidQt::API::ObserverCallback::handlePostDelete().

◆ preDeleteHandle()

virtual void MantidQt::API::WorkspaceObserver::preDeleteHandle ( const std::string &  wsName,
const Mantid::API::Workspace_sptr ws 
)
inlineprotectedvirtual

Handler of the delete notifications.

Could be overriden in inherited classes. The default handler is provided (doing nothing).

Parameters
wsName:: The name of the deleted workspace.
ws:: Pointer to the workspace to be deleted.

Definition at line 116 of file WorkspaceObserver.h.

Referenced by MantidQt::API::ObserverCallback::handlePreDelete().

◆ renameHandle()

virtual void MantidQt::API::WorkspaceObserver::renameHandle ( const std::string &  oldName,
const std::string &  newName 
)
inlineprotectedvirtual

Handler of the Rename notifications.

Could be overriden in inherited classes. The default handler is provided (doing nothing).

Parameters
oldName:: The old name of a workspace
newName:: The new name of a workspace

Reimplemented in MantidQt::MantidWidgets::FitPropertyBrowser.

Definition at line 153 of file WorkspaceObserver.h.

Referenced by MantidQt::API::ObserverCallback::handleRename().

Friends And Related Function Documentation

◆ ObserverCallback

friend class ObserverCallback
friend

Definition at line 215 of file WorkspaceObserver.h.

Member Data Documentation

◆ m_add_observed

bool MantidQt::API::WorkspaceObserver::m_add_observed
private

Definition at line 218 of file WorkspaceObserver.h.

Referenced by observeAdd().

◆ m_addObserver

Poco::NObserver<WorkspaceObserver, Mantid::API::WorkspaceAddNotification> MantidQt::API::WorkspaceObserver::m_addObserver
protected

Poco::NObserver for DataServise::AddNotification.

Definition at line 189 of file WorkspaceObserver.h.

Referenced by observeAdd(), and ~WorkspaceObserver().

◆ m_afterReplaceObserver

Poco::NObserver<WorkspaceObserver, Mantid::API::WorkspaceAfterReplaceNotification> MantidQt::API::WorkspaceObserver::m_afterReplaceObserver
protected

Poco::NObserver for DataServise::AfterReplaceNotification.

Definition at line 198 of file WorkspaceObserver.h.

Referenced by observeAfterReplace(), and ~WorkspaceObserver().

◆ m_clearADSObserver

Poco::NObserver<WorkspaceObserver, Mantid::API::ClearADSNotification> MantidQt::API::WorkspaceObserver::m_clearADSObserver
protected

Clear notification observer.

Definition at line 210 of file WorkspaceObserver.h.

Referenced by observeADSClear(), and ~WorkspaceObserver().

◆ m_clr_observed

bool MantidQt::API::WorkspaceObserver::m_clr_observed
private

Definition at line 218 of file WorkspaceObserver.h.

Referenced by observeADSClear().

◆ m_postdel_observed

bool MantidQt::API::WorkspaceObserver::m_postdel_observed
private

Definition at line 218 of file WorkspaceObserver.h.

Referenced by observePostDelete().

◆ m_postDeleteObserver

Poco::NObserver<WorkspaceObserver, Mantid::API::WorkspacePostDeleteNotification> MantidQt::API::WorkspaceObserver::m_postDeleteObserver
protected

Poco::NObserver for DataServise::DeleteNotification.

Definition at line 180 of file WorkspaceObserver.h.

Referenced by observePostDelete(), and ~WorkspaceObserver().

◆ m_predel_observed

bool MantidQt::API::WorkspaceObserver::m_predel_observed
private

Definition at line 218 of file WorkspaceObserver.h.

Referenced by observePreDelete().

◆ m_preDeleteObserver

Poco::NObserver<WorkspaceObserver, Mantid::API::WorkspacePreDeleteNotification> MantidQt::API::WorkspaceObserver::m_preDeleteObserver
protected

Poco::NObserver for DataServise::DeleteNotification.

Definition at line 171 of file WorkspaceObserver.h.

Referenced by observePreDelete(), and ~WorkspaceObserver().

◆ m_proxy

std::unique_ptr<ObserverCallback> MantidQt::API::WorkspaceObserver::m_proxy
private

◆ m_rename_observed

bool MantidQt::API::WorkspaceObserver::m_rename_observed
private

Definition at line 218 of file WorkspaceObserver.h.

Referenced by observeRename().

◆ m_renameObserver

Poco::NObserver<WorkspaceObserver, Mantid::API::WorkspaceRenameNotification> MantidQt::API::WorkspaceObserver::m_renameObserver
protected

Poco::NObserver for DataServise::RenameNotification.

Definition at line 207 of file WorkspaceObserver.h.

Referenced by observeRename(), and ~WorkspaceObserver().

◆ m_repl_observed

bool MantidQt::API::WorkspaceObserver::m_repl_observed
private

Definition at line 218 of file WorkspaceObserver.h.

Referenced by observeAfterReplace().


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