Mantid
|
Observes AnalysisDataService notifications: add,replace,delete. More...
#include <WorkspaceObserver.h>
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::WorkspaceAddNotification > | m_addObserver |
Poco::NObserver for DataServise::AddNotification. More... | |
Poco::NObserver< WorkspaceObserver, Mantid::API::WorkspaceAfterReplaceNotification > | m_afterReplaceObserver |
Poco::NObserver for DataServise::AfterReplaceNotification. More... | |
Poco::NObserver< WorkspaceObserver, Mantid::API::ClearADSNotification > | m_clearADSObserver |
Clear notification observer. More... | |
Poco::NObserver< WorkspaceObserver, Mantid::API::WorkspacePostDeleteNotification > | m_postDeleteObserver |
Poco::NObserver for DataServise::DeleteNotification. More... | |
Poco::NObserver< WorkspaceObserver, Mantid::API::WorkspacePreDeleteNotification > | m_preDeleteObserver |
Poco::NObserver for DataServise::DeleteNotification. More... | |
Poco::NObserver< WorkspaceObserver, Mantid::API::WorkspaceRenameNotification > | m_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< ObserverCallback > | m_proxy |
bool | m_rename_observed |
bool | m_repl_observed |
Friends | |
class | ObserverCallback |
Observes AnalysisDataService notifications: add,replace,delete.
Hides Poco::Notification API from the user.
Definition at line 89 of file WorkspaceObserver.h.
MantidQt::API::WorkspaceObserver::WorkspaceObserver | ( | ) |
Default constructor.
Definition at line 45 of file WorkspaceObserver.cpp.
|
virtual |
Destructor.
Definition at line 56 of file WorkspaceObserver.cpp.
References Mantid::Kernel::SingletonHolder< T >::Instance(), m_addObserver, m_afterReplaceObserver, m_clearADSObserver, m_postDeleteObserver, m_preDeleteObserver, m_proxy, and m_renameObserver.
|
inlineprotected |
Poco notification handler for DataService::DeleteNotification.
pNf | :: The pointer to the notification. |
Definition at line 185 of file WorkspaceObserver.h.
|
inlineprotected |
Poco notification handler for DataService::AfterReplaceNotification.
pNf | :: The pointer to the notification. |
Definition at line 194 of file WorkspaceObserver.h.
|
inlineprotected |
ADS clear notification.
Definition at line 212 of file WorkspaceObserver.h.
|
inlineprotected |
Poco notification handler for DataService::PostDeleteNotification.
pNf | :: The pointer to the notification. |
Definition at line 176 of file WorkspaceObserver.h.
|
inlineprotected |
Poco notification handler for DataService::PostDeleteNotification.
pNf | :: The pointer to the notification. |
Definition at line 167 of file WorkspaceObserver.h.
|
inlineprotected |
Poco notification handler for DataService::RenameNotification.
pNf | :: The pointer to the notification. |
Definition at line 203 of file WorkspaceObserver.h.
|
inlineprotectedvirtual |
Handler of the add notifications.
Could be overriden in inherited classes. The default handler is provided (doing nothing).
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().
|
inlineprotectedvirtual |
Handler of the AfterReplace notifications.
Could be overriden in inherited classes. The default handler is provided (doing nothing).
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().
|
inlineprotectedvirtual |
Handle an ADS clear notification.
Definition at line 161 of file WorkspaceObserver.h.
Referenced by MantidQt::API::ObserverCallback::handleClearADS().
void MantidQt::API::WorkspaceObserver::observeAdd | ( | bool | turnOn = true | ) |
Observe additions.
Turn on observations of workspace add notifications from the ADS.
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().
void MantidQt::API::WorkspaceObserver::observeADSClear | ( | bool | turnOn = true | ) |
Observe clearances.
Turn on observations of workspace clear notifications from the ADS.
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.
void MantidQt::API::WorkspaceObserver::observeAfterReplace | ( | bool | turnOn = true | ) |
Observe replacements.
Turn on observations of workspace replacement notifications from the ADS.
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.
void MantidQt::API::WorkspaceObserver::observePostDelete | ( | bool | turnOn = true | ) |
Observe workspace deletes.
Turn on observations of workspace post delete notifications from the ADS.
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().
void MantidQt::API::WorkspaceObserver::observePreDelete | ( | bool | turnOn = true | ) |
Observe workspace deletes.
Turn on observations of workspace delete notifications from the ADS.
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.
void MantidQt::API::WorkspaceObserver::observeRename | ( | bool | turnOn = true | ) |
Observe renaming.
Turn on observations of workspace renaming notifications from the ADS.
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().
|
inlineprotectedvirtual |
Handler of the delete notifications.
Could be overriden in inherited classes. The default handler is provided (doing nothing).
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().
|
inlineprotectedvirtual |
Handler of the delete notifications.
Could be overriden in inherited classes. The default handler is provided (doing nothing).
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().
|
inlineprotectedvirtual |
Handler of the Rename notifications.
Could be overriden in inherited classes. The default handler is provided (doing nothing).
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().
|
friend |
Definition at line 215 of file WorkspaceObserver.h.
|
private |
Definition at line 218 of file WorkspaceObserver.h.
Referenced by observeAdd().
|
protected |
Poco::NObserver for DataServise::AddNotification.
Definition at line 189 of file WorkspaceObserver.h.
Referenced by observeAdd(), and ~WorkspaceObserver().
|
protected |
Poco::NObserver for DataServise::AfterReplaceNotification.
Definition at line 198 of file WorkspaceObserver.h.
Referenced by observeAfterReplace(), and ~WorkspaceObserver().
|
protected |
Clear notification observer.
Definition at line 210 of file WorkspaceObserver.h.
Referenced by observeADSClear(), and ~WorkspaceObserver().
|
private |
Definition at line 218 of file WorkspaceObserver.h.
Referenced by observeADSClear().
|
private |
Definition at line 218 of file WorkspaceObserver.h.
Referenced by observePostDelete().
|
protected |
Poco::NObserver for DataServise::DeleteNotification.
Definition at line 180 of file WorkspaceObserver.h.
Referenced by observePostDelete(), and ~WorkspaceObserver().
|
private |
Definition at line 218 of file WorkspaceObserver.h.
Referenced by observePreDelete().
|
protected |
Poco::NObserver for DataServise::DeleteNotification.
Definition at line 171 of file WorkspaceObserver.h.
Referenced by observePreDelete(), and ~WorkspaceObserver().
|
private |
Definition at line 216 of file WorkspaceObserver.h.
Referenced by observeAdd(), observeADSClear(), observeAfterReplace(), observePostDelete(), observePreDelete(), observeRename(), and ~WorkspaceObserver().
|
private |
Definition at line 218 of file WorkspaceObserver.h.
Referenced by observeRename().
|
protected |
Poco::NObserver for DataServise::RenameNotification.
Definition at line 207 of file WorkspaceObserver.h.
Referenced by observeRename(), and ~WorkspaceObserver().
|
private |
Definition at line 218 of file WorkspaceObserver.h.
Referenced by observeAfterReplace().