12#include <Poco/NObserver.h>
16Q_DECLARE_METATYPE(std::string)
28class WorkspaceObserver;
56 void renamed(
const std::string &oldName,
const std::string &newName);
63 void handlePostDelete(
const std::string &name);
69 void handleRename(
const std::string &oldName,
const std::string &newName);
71 void handleClearADS();
97 void observePreDelete(
bool on =
true);
99 void observePostDelete(
bool on =
true);
101 void observeAfterReplace(
bool on =
true);
103 void observeRename(
bool on =
true);
105 void observeAdd(
bool on =
true);
107 void observeADSClear(
bool on =
true);
153 virtual void renameHandle(
const std::string &oldName,
const std::string &newName) {
168 m_proxy->preDeleteRequested(pNf->objectName(), pNf->object());
177 m_proxy->postDeleteRequested(pNf->objectName());
186 m_proxy->addRequested(pNf->objectName(), pNf->object());
195 m_proxy->afterReplaced(pNf->objectName(), pNf->object());
204 m_proxy->renamed(pNf->objectName(), pNf->newObjectName());
218 bool m_predel_observed, m_postdel_observed,
m_add_observed, m_repl_observed, m_rename_observed, m_clr_observed;
#define EXPORT_OPT_MANTIDQT_COMMON
IPeaksWorkspace_sptr workspace
A simple callback class so that we avoid multiple inheritance issues with QObject.
ObserverCallback(WorkspaceObserver *observer)
WorkspaceObserver * m_observer
Object to call back to.
void preDeleteRequested(const std::string &name, Mantid::API::Workspace_sptr workspace)
Delete signal handler.
void addRequested(const std::string &name, Mantid::API::Workspace_sptr workspace)
void afterReplaced(const std::string &name, Mantid::API::Workspace_sptr workspace)
void renamed(const std::string &oldName, const std::string &newName)
void postDeleteRequested(const std::string &name)
ObserverCallback()
Default constructor.
Observes AnalysisDataService notifications: add,replace,delete.
void _renameHandle(Mantid::API::WorkspaceRenameNotification_ptr pNf)
Poco notification handler for DataService::RenameNotification.
virtual void afterReplaceHandle(const std::string &wsName, const Mantid::API::Workspace_sptr &ws)
Handler of the AfterReplace notifications.
Poco::NObserver< WorkspaceObserver, Mantid::API::WorkspaceAddNotification > m_addObserver
Poco::NObserver for DataServise::AddNotification.
void _clearADSHandle(Mantid::API::ClearADSNotification_ptr)
ADS clear notification.
virtual void postDeleteHandle(const std::string &wsName)
Handler of the delete notifications.
Poco::NObserver< WorkspaceObserver, Mantid::API::ClearADSNotification > m_clearADSObserver
Clear notification observer.
void _addHandle(Mantid::API::WorkspaceAddNotification_ptr pNf)
Poco notification handler for DataService::DeleteNotification.
void _postDeleteHandle(Mantid::API::WorkspacePostDeleteNotification_ptr pNf)
Poco notification handler for DataService::PostDeleteNotification.
virtual void addHandle(const std::string &wsName, const Mantid::API::Workspace_sptr &ws)
Handler of the add notifications.
virtual void preDeleteHandle(const std::string &wsName, const Mantid::API::Workspace_sptr &ws)
Handler of the delete notifications.
void _afterReplaceHandle(Mantid::API::WorkspaceAfterReplaceNotification_ptr pNf)
Poco notification handler for DataService::AfterReplaceNotification.
Poco::NObserver< WorkspaceObserver, Mantid::API::WorkspaceAfterReplaceNotification > m_afterReplaceObserver
Poco::NObserver for DataServise::AfterReplaceNotification.
Poco::NObserver< WorkspaceObserver, Mantid::API::WorkspaceRenameNotification > m_renameObserver
Poco::NObserver for DataServise::RenameNotification.
virtual void renameHandle(const std::string &oldName, const std::string &newName)
Handler of the Rename notifications.
Poco::NObserver< WorkspaceObserver, Mantid::API::WorkspacePreDeleteNotification > m_preDeleteObserver
Poco::NObserver for DataServise::DeleteNotification.
virtual void clearADSHandle()
Handle an ADS clear notification.
void _preDeleteHandle(Mantid::API::WorkspacePreDeleteNotification_ptr pNf)
Poco notification handler for DataService::PostDeleteNotification.
Poco::NObserver< WorkspaceObserver, Mantid::API::WorkspacePostDeleteNotification > m_postDeleteObserver
Poco::NObserver for DataServise::DeleteNotification.
std::unique_ptr< ObserverCallback > m_proxy
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...
const Poco::AutoPtr< Mantid::Kernel::DataService< Mantid::API::Workspace >::AfterReplaceNotification > & WorkspaceAfterReplaceNotification_ptr
const Poco::AutoPtr< Mantid::Kernel::DataService< Mantid::API::Workspace >::ClearNotification > & ClearADSNotification_ptr
const Poco::AutoPtr< Mantid::Kernel::DataService< Mantid::API::Workspace >::PreDeleteNotification > & WorkspacePreDeleteNotification_ptr
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
const Poco::AutoPtr< Mantid::Kernel::DataService< Mantid::API::Workspace >::RenameNotification > & WorkspaceRenameNotification_ptr
const Poco::AutoPtr< Mantid::Kernel::DataService< Mantid::API::Workspace >::AddNotification > & WorkspaceAddNotification_ptr
const Poco::AutoPtr< Mantid::Kernel::DataService< Mantid::API::Workspace >::PostDeleteNotification > & WorkspacePostDeleteNotification_ptr