52 m_predel_observed(false), m_postdel_observed(false), m_add_observed(false), m_repl_observed(false),
53 m_rename_observed(false), m_clr_observed(false) {}
100 m_proxy->connect(
m_proxy.get(), SIGNAL(postDeleteRequested(
const std::string &)),
101 SLOT(handlePostDelete(
const std::string &)), Qt::QueuedConnection);
106 SLOT(handlePostDelete(
const std::string &)));
138 m_proxy->connect(
m_proxy.get(), SIGNAL(renamed(
const std::string &,
const std::string &)),
139 SLOT(handleRename(
const std::string &,
const std::string &)), Qt::QueuedConnection);
142 m_proxy->disconnect(
m_proxy.get(), SIGNAL(renamed(
const std::string &,
const std::string &)),
m_proxy.get(),
143 SLOT(handleRename(
const std::string &,
const std::string &)));
174 m_proxy->connect(
m_proxy.get(), SIGNAL(adsCleared()), SLOT(handleClearADS()), Qt::QueuedConnection);
IPeaksWorkspace_sptr workspace
A simple callback class so that we avoid multiple inheritance issues with QObject.
void handleClearADS()
Clear slot.
void handleAdd(const std::string &name, const Mantid::API::Workspace_sptr &workspace)
Add slot.
void handlePostDelete(const std::string &name)
Post Delete slot.
WorkspaceObserver * m_observer
Object to call back to.
void handlePreDelete(const std::string &name, const Mantid::API::Workspace_sptr &workspace)
Pre Delete slot.
void handleAfterReplace(const std::string &name, const Mantid::API::Workspace_sptr &workspace)
Replace slot.
void handleRename(const std::string &oldName, const std::string &newName)
Rename slot.
Observes AnalysisDataService notifications: add,replace,delete.
void observeADSClear(bool on=true)
Observe clearances.
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 observeAdd(bool on=true)
Observe additions.
virtual void postDeleteHandle(const std::string &wsName)
Handler of the delete notifications.
Poco::NObserver< WorkspaceObserver, Mantid::API::ClearADSNotification > m_clearADSObserver
Clear notification observer.
WorkspaceObserver()
Default constructor.
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 observePostDelete(bool on=true)
Observe workspace deletes.
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.
void observeAfterReplace(bool on=true)
Observe replacements.
virtual void renameHandle(const std::string &oldName, const std::string &newName)
Handler of the Rename notifications.
void observePreDelete(bool on=true)
Observe workspace deletes.
Poco::NObserver< WorkspaceObserver, Mantid::API::WorkspacePreDeleteNotification > m_preDeleteObserver
Poco::NObserver for DataServise::DeleteNotification.
virtual ~WorkspaceObserver()
Destructor.
virtual void clearADSHandle()
Handle an ADS clear notification.
void observeRename(bool on=true)
Observe renaming.
Poco::NObserver< WorkspaceObserver, Mantid::API::WorkspacePostDeleteNotification > m_postDeleteObserver
Poco::NObserver for DataServise::DeleteNotification.
std::unique_ptr< ObserverCallback > m_proxy
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace