10template <
typename Observer>
void modifyObserver(
const bool turnOn,
bool &isObserving,
Observer &observer) {
11 if (turnOn && !isObserving) {
13 }
else if (!turnOn && isObserving) {
249 this->
addHandle(pNf->objectName(), pNf->object());
253 const Poco::AutoPtr<AnalysisDataServiceImpl::AfterReplaceNotification> &pNf) {
259 const Poco::AutoPtr<AnalysisDataServiceImpl::PreDeleteNotification> &pNf) {
272 this->
renameHandle(pNf->objectName(), pNf->newObjectName());
276 const Poco::AutoPtr<AnalysisDataServiceImpl::GroupWorkspacesNotification> &pNf) {
278 this->
groupHandle(pNf->objectName(), pNf->object());
282 const Poco::AutoPtr<AnalysisDataServiceImpl::UnGroupingWorkspaceNotification> &pNf) {
288 const Poco::AutoPtr<AnalysisDataServiceImpl::GroupUpdatedNotification> &pNf) {
#define UNUSED_ARG(x)
Function arguments are sometimes unused in certain implmentations but are required for documentation ...
void _unGroupHandle(const Poco::AutoPtr< AnalysisDataServiceImpl::UnGroupingWorkspaceNotification > &pNf)
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 ...
Poco::NObserver< AnalysisDataServiceObserver, AnalysisDataServiceImpl::AddNotification > m_addObserver
Poco::NObserver for AddNotification.
void _renameHandle(const Poco::AutoPtr< AnalysisDataServiceImpl::RenameNotification > &pNf)
void _groupHandle(const Poco::AutoPtr< AnalysisDataServiceImpl::GroupWorkspacesNotification > &pNf)
void observeGroup(bool turnOn=true)
Function will add/remove the observer to the ADS for when a group is added/created in the ADS.
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 ...
bool m_observingGroupUpdate
AnalysisDataServiceObserver()
Poco::NObserver< AnalysisDataServiceObserver, AnalysisDataServiceImpl::ClearNotification > m_clearObserver
Poco::NObserver for ClearNotification.
virtual ~AnalysisDataServiceObserver()
void observeReplace(bool turnOn=true)
Function will add/remove the observer to the ADS for when a workspace is replaced.
Poco::NObserver< AnalysisDataServiceObserver, AnalysisDataServiceImpl::PreDeleteNotification > m_deleteObserver
Poco::NObserver for DeleteNotification.
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 cla...
void observeAll(bool turnOn=true)
Function will turn on/off all observers for the ADS.
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 cl...
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 cl...
void observeRename(bool turnOn=true)
Function will add/remove the observer to the ADS for when a workspace is renamed.
void _replaceHandle(const Poco::AutoPtr< AnalysisDataServiceImpl::AfterReplaceNotification > &pNf)
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,...
Poco::NObserver< AnalysisDataServiceObserver, AnalysisDataServiceImpl::RenameNotification > m_renameObserver
Poco::NObserver for RenameNotification.
void observeUnGroup(bool turnOn=true)
Function will add/remove the observer to the ADS for when a group is removed/delete from the ADS.
void _clearHandle(const Poco::AutoPtr< AnalysisDataServiceImpl::ClearNotification > &pNf)
void observeDelete(bool turnOn=true)
Function will add/remove the observer to the ADS for when a workspace is deleted.
Poco::NObserver< AnalysisDataServiceObserver, AnalysisDataServiceImpl::GroupUpdatedNotification > m_groupUpdatedObserver
Poco::NObserver for GroupUpdateNotification.
Poco::NObserver< AnalysisDataServiceObserver, AnalysisDataServiceImpl::UnGroupingWorkspaceNotification > m_unGroupObserver
Poco::NObserver for UnGroupNotification.
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 clas...
void _groupUpdateHandle(const Poco::AutoPtr< AnalysisDataServiceImpl::GroupUpdatedNotification > &pNf)
Poco::NObserver< AnalysisDataServiceObserver, AnalysisDataServiceImpl::GroupWorkspacesNotification > m_groupObserver
Poco::NObserver for GroupNotification.
void _deleteHandle(const Poco::AutoPtr< AnalysisDataServiceImpl::PreDeleteNotification > &pNf)
void observeClear(bool turnOn=true)
Function will add/remove the observer to the ADS for when the ADS is cleared.
void observeAdd(bool turnOn=true)
Function will add/remove the observer to the ADS for when a workspace is added to it.
virtual void anyChangeHandle()
If anyChange to the ADS occurs then this function will trigger, works by overloading this class and o...
virtual void clearHandle()
If the ADS is cleared, then this function will trigger, works by overloading this class and overridin...
void _addHandle(const Poco::AutoPtr< AnalysisDataServiceImpl::AddNotification > &pNf)
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.
Poco::NObserver< AnalysisDataServiceObserver, AnalysisDataServiceImpl::AfterReplaceNotification > m_replaceObserver
Poco::NObserver for ReplaceNotification.
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