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

A simple callback class so that we avoid multiple inheritance issues with QObject. More...

#include <WorkspaceObserver.h>

Inheritance diagram for MantidQt::API::ObserverCallback:

Signals

void addRequested (const std::string &name, Mantid::API::Workspace_sptr workspace)
 
void adsCleared ()
 
void afterReplaced (const std::string &name, Mantid::API::Workspace_sptr workspace)
 
void postDeleteRequested (const std::string &name)
 
void preDeleteRequested (const std::string &name, Mantid::API::Workspace_sptr workspace)
 Delete signal handler. More...
 
void renamed (const std::string &oldName, const std::string &newName)
 

Public Member Functions

 ObserverCallback (WorkspaceObserver *observer)
 

Private Slots

void handleAdd (const std::string &name, const Mantid::API::Workspace_sptr &workspace)
 Add slot. More...
 
void handleAfterReplace (const std::string &name, const Mantid::API::Workspace_sptr &workspace)
 Replace slot. More...
 
void handleClearADS ()
 Clear slot. More...
 
void handlePostDelete (const std::string &name)
 Post Delete slot. More...
 
void handlePreDelete (const std::string &name, const Mantid::API::Workspace_sptr &workspace)
 Pre Delete slot. More...
 
void handleRename (const std::string &oldName, const std::string &newName)
 Rename slot. More...
 

Private Member Functions

 ObserverCallback ()
 Default constructor. More...
 

Private Attributes

WorkspaceObserverm_observer
 Object to call back to. More...
 

Friends

class WorkspaceObserver
 

Detailed Description

A simple callback class so that we avoid multiple inheritance issues with QObject.

This adds an extra level of indirection to the call between a Poco notification handler and the call to the correct WorkspaceObserver handler. It is necessary to do this rather than just call the function directly so that the function call gets executed in the object's thread rather than in the thread that the notification was received in.

Multiple inheritance is not used in WorkspaceObserver as their seems to be some problem using it and QObject

Definition at line 44 of file WorkspaceObserver.h.

Constructor & Destructor Documentation

◆ ObserverCallback() [1/2]

MantidQt::API::ObserverCallback::ObserverCallback ( WorkspaceObserver observer)
inline

Definition at line 48 of file WorkspaceObserver.h.

◆ ObserverCallback() [2/2]

MantidQt::API::ObserverCallback::ObserverCallback ( )
private

Default constructor.

Member Function Documentation

◆ addRequested

void MantidQt::API::ObserverCallback::addRequested ( const std::string &  name,
Mantid::API::Workspace_sptr  workspace 
)
signal

◆ adsCleared

void MantidQt::API::ObserverCallback::adsCleared ( )
signal

◆ afterReplaced

void MantidQt::API::ObserverCallback::afterReplaced ( const std::string &  name,
Mantid::API::Workspace_sptr  workspace 
)
signal

◆ handleAdd

void MantidQt::API::ObserverCallback::handleAdd ( const std::string &  name,
const Mantid::API::Workspace_sptr workspace 
)
privateslot

Add slot.

Definition at line 26 of file WorkspaceObserver.cpp.

References MantidQt::API::WorkspaceObserver::addHandle(), m_observer, and workspace.

◆ handleAfterReplace

void MantidQt::API::ObserverCallback::handleAfterReplace ( const std::string &  name,
const Mantid::API::Workspace_sptr workspace 
)
privateslot

Replace slot.

Definition at line 30 of file WorkspaceObserver.cpp.

References MantidQt::API::WorkspaceObserver::afterReplaceHandle(), m_observer, and workspace.

◆ handleClearADS

void MantidQt::API::ObserverCallback::handleClearADS ( )
privateslot

Clear slot.

Definition at line 38 of file WorkspaceObserver.cpp.

References MantidQt::API::WorkspaceObserver::clearADSHandle(), and m_observer.

◆ handlePostDelete

void MantidQt::API::ObserverCallback::handlePostDelete ( const std::string &  name)
privateslot

Post Delete slot.

Definition at line 24 of file WorkspaceObserver.cpp.

References m_observer, and MantidQt::API::WorkspaceObserver::postDeleteHandle().

◆ handlePreDelete

void MantidQt::API::ObserverCallback::handlePreDelete ( const std::string &  name,
const Mantid::API::Workspace_sptr workspace 
)
privateslot

Pre Delete slot.

Definition at line 20 of file WorkspaceObserver.cpp.

References m_observer, MantidQt::API::WorkspaceObserver::preDeleteHandle(), and workspace.

◆ handleRename

void MantidQt::API::ObserverCallback::handleRename ( const std::string &  oldName,
const std::string &  newName 
)
privateslot

Rename slot.

Definition at line 34 of file WorkspaceObserver.cpp.

References m_observer, and MantidQt::API::WorkspaceObserver::renameHandle().

◆ postDeleteRequested

void MantidQt::API::ObserverCallback::postDeleteRequested ( const std::string &  name)
signal

◆ preDeleteRequested

void MantidQt::API::ObserverCallback::preDeleteRequested ( const std::string &  name,
Mantid::API::Workspace_sptr  workspace 
)
signal

Delete signal handler.

◆ renamed

void MantidQt::API::ObserverCallback::renamed ( const std::string &  oldName,
const std::string &  newName 
)
signal

Friends And Related Function Documentation

◆ WorkspaceObserver

friend class WorkspaceObserver
friend

Definition at line 74 of file WorkspaceObserver.h.

Member Data Documentation

◆ m_observer

WorkspaceObserver* MantidQt::API::ObserverCallback::m_observer
private

Object to call back to.

Definition at line 78 of file WorkspaceObserver.h.

Referenced by handleAdd(), handleAfterReplace(), handleClearADS(), handlePostDelete(), handlePreDelete(), and handleRename().


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