Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Mantid::API::AlgorithmObserver Class Reference

Observes Algorithm notifications: start,progress,finish,error. More...

#include <AlgorithmObserver.h>

Inheritance diagram for Mantid::API::AlgorithmObserver:
Mantid::Algorithms::RecordPythonScript Mantid::PythonInterface::AlgorithmObserverAdapter MantidQt::API::AlgorithmDialog MantidQt::MantidWidgets::AlgorithmProgressModel MantidQt::MantidWidgets::FitPropertyBrowser MantidQt::MantidWidgets::SequentialFitDialog MantidQt::API::GenericDialog MantidQt::CustomDialogs::CatalogPublishDialog MantidQt::CustomDialogs::ConvertTableToMatrixWorkspaceDialog MantidQt::CustomDialogs::FitDialog MantidQt::CustomDialogs::LOQScriptInputDialog MantidQt::CustomDialogs::LoadDAEDialog MantidQt::CustomDialogs::LoadDialog MantidQt::CustomDialogs::LoadRawDialog MantidQt::CustomDialogs::PlotAsymmetryByLogValueDialog MantidQt::CustomDialogs::SortTableWorkspaceDialog MantidQt::CustomDialogs::StartLiveDataDialog MantidQt::MantidWidgets::SlicingAlgorithmDialog SmoothNeighboursDialog MantidQt::MantidWidgets::MuonFitPropertyBrowser

Public Member Functions

 AlgorithmObserver ()
 Default constructor. More...
 
 AlgorithmObserver (const IAlgorithm_const_sptr &alg)
 Constructs AlgorithmObserver and connects all its handlers to algorithm alg. More...
 
virtual void errorHandle (const IAlgorithm *alg, const std::string &what)
 
virtual void finishHandle (const IAlgorithm *alg)
 
void observeAll (const IAlgorithm_const_sptr &alg)
 Connect to algorithm alg and observe all its notifications. More...
 
void observeError (const IAlgorithm_const_sptr &alg)
 Connect to algorithm alg and observe its error notification. More...
 
void observeFinish (const IAlgorithm_const_sptr &alg)
 Connect to algorithm alg and observe its finish notification. More...
 
void observeProgress (const IAlgorithm_const_sptr &alg)
 Connect to algorithm alg and observe its progress notification. More...
 
void observeStart (const IAlgorithm_const_sptr &alg)
 Connect to algorithm alg and observe its start notification. More...
 
void observeStarting ()
 Connect to AlgorithmManager and observe its starting notifications. More...
 
virtual void progressHandle (const IAlgorithm *alg, double p, const std::string &msg, const double estimatedTime, const int progressPrecision)
 
virtual void startHandle (const IAlgorithm *alg)
 
virtual void startingHandle (IAlgorithm_sptr alg)
 
void stopObserving (const IAlgorithm_const_sptr &alg)
 Disconnect from algorithm alg. More...
 
void stopObserving (const Mantid::API::IAlgorithm *alg)
 
void stopObservingManager ()
 Disconnect from the algorithm manager. More...
 
virtual ~AlgorithmObserver ()
 Virtual destructor. More...
 

Private Member Functions

void _errorHandle (const Poco::AutoPtr< Algorithm::ErrorNotification > &pNf)
 Poco notification handler for Algorithm::ErrorNotification. More...
 
void _finishHandle (const Poco::AutoPtr< Algorithm::FinishedNotification > &pNf)
 Poco notification handler for Algorithm::FinishedNotification. More...
 
void _progressHandle (const Poco::AutoPtr< Algorithm::ProgressNotification > &pNf)
 Poco notification handler for Algorithm::ProgressNotification. More...
 
void _startHandle (const Poco::AutoPtr< Algorithm::StartedNotification > &pNf)
 Poco notification handler for Algorithm::StartedNotification. More...
 
void _startingHandle (const Poco::AutoPtr< AlgorithmStartingNotification > &pNf)
 Poco notification handler for API::AlgorithmStartingNotification. More...
 

Private Attributes

Poco::NObserver< AlgorithmObserver, Algorithm::ErrorNotificationm_errorObserver
 Poco::NObserver for Algorithm::ErrorNotification. More...
 
Poco::NObserver< AlgorithmObserver, Algorithm::FinishedNotificationm_finishObserver
 Poco::NObserver for Algorithm::FinishedNotification. More...
 
Poco::NObserver< AlgorithmObserver, Algorithm::ProgressNotificationm_progressObserver
 Poco::NObserver for Algorithm::ProgressNotification. More...
 
Poco::NObserver< AlgorithmObserver, AlgorithmStartingNotificationm_startingObserver
 Poco::NObserver for API::AlgorithmStartingNotification. More...
 
Poco::NObserver< AlgorithmObserver, Algorithm::StartedNotificationm_startObserver
 Poco::NObserver for Algorithm::StartedNotification. More...
 

Detailed Description

Observes Algorithm notifications: start,progress,finish,error.

Hides Poco::Notification API from the user.

Definition at line 23 of file AlgorithmObserver.h.

Constructor & Destructor Documentation

◆ AlgorithmObserver() [1/2]

Mantid::API::AlgorithmObserver::AlgorithmObserver ( )

Default constructor.

Notification handlers are not connected to any algorithm

Definition at line 19 of file AlgorithmObserver.cpp.

◆ AlgorithmObserver() [2/2]

Mantid::API::AlgorithmObserver::AlgorithmObserver ( const IAlgorithm_const_sptr alg)

Constructs AlgorithmObserver and connects all its handlers to algorithm alg.

Parameters
alg:: Algorithm to be observed

Definition at line 30 of file AlgorithmObserver.cpp.

References observeAll().

◆ ~AlgorithmObserver()

Mantid::API::AlgorithmObserver::~AlgorithmObserver ( )
virtualdefault

Virtual destructor.

Member Function Documentation

◆ _errorHandle()

void Mantid::API::AlgorithmObserver::_errorHandle ( const Poco::AutoPtr< Algorithm::ErrorNotification > &  pNf)
private

Poco notification handler for Algorithm::ErrorNotification.

Parameters
pNf:: An pointer to the notification.

Definition at line 171 of file AlgorithmObserver.cpp.

References errorHandle().

◆ _finishHandle()

void Mantid::API::AlgorithmObserver::_finishHandle ( const Poco::AutoPtr< Algorithm::FinishedNotification > &  pNf)
private

Poco notification handler for Algorithm::FinishedNotification.

Parameters
pNf:: An pointer to the notification.

Definition at line 164 of file AlgorithmObserver.cpp.

References finishHandle().

◆ _progressHandle()

void Mantid::API::AlgorithmObserver::_progressHandle ( const Poco::AutoPtr< Algorithm::ProgressNotification > &  pNf)
private

Poco notification handler for Algorithm::ProgressNotification.

Parameters
pNf:: An pointer to the notification.

Definition at line 150 of file AlgorithmObserver.cpp.

References progressHandle().

◆ _startHandle()

void Mantid::API::AlgorithmObserver::_startHandle ( const Poco::AutoPtr< Algorithm::StartedNotification > &  pNf)
private

Poco notification handler for Algorithm::StartedNotification.

Parameters
pNf:: An pointer to the notification.

Definition at line 157 of file AlgorithmObserver.cpp.

References startHandle().

◆ _startingHandle()

void Mantid::API::AlgorithmObserver::_startingHandle ( const Poco::AutoPtr< AlgorithmStartingNotification > &  pNf)
private

Poco notification handler for API::AlgorithmStartingNotification.

Parameters
pNf:: An pointer to the notification.

Definition at line 178 of file AlgorithmObserver.cpp.

References startingHandle().

◆ errorHandle()

virtual void Mantid::API::AlgorithmObserver::errorHandle ( const IAlgorithm alg,
const std::string &  what 
)
virtual

◆ finishHandle()

virtual void Mantid::API::AlgorithmObserver::finishHandle ( const IAlgorithm alg)
virtual

◆ observeAll()

void Mantid::API::AlgorithmObserver::observeAll ( const IAlgorithm_const_sptr alg)

Connect to algorithm alg and observe all its notifications.

Parameters
alg:: Algorithm to be observed

Definition at line 45 of file AlgorithmObserver.cpp.

References m_errorObserver, m_finishObserver, m_progressObserver, and m_startObserver.

Referenced by AlgorithmObserver().

◆ observeError()

void Mantid::API::AlgorithmObserver::observeError ( const IAlgorithm_const_sptr alg)

Connect to algorithm alg and observe its error notification.

Parameters
alg:: Algorithm to be observed

Definition at line 76 of file AlgorithmObserver.cpp.

References m_errorObserver.

Referenced by MantidQt::API::AlgorithmDialog::executeAlgorithmAsync(), observeError(), and MantidQt::MantidWidgets::AlgorithmProgressModel::startingHandle().

◆ observeFinish()

void Mantid::API::AlgorithmObserver::observeFinish ( const IAlgorithm_const_sptr alg)

◆ observeProgress()

void Mantid::API::AlgorithmObserver::observeProgress ( const IAlgorithm_const_sptr alg)

Connect to algorithm alg and observe its progress notification.

Parameters
alg:: Algorithm to be observed

Definition at line 55 of file AlgorithmObserver.cpp.

References m_progressObserver.

Referenced by observeProgress(), and MantidQt::MantidWidgets::AlgorithmProgressModel::startingHandle().

◆ observeStart()

void Mantid::API::AlgorithmObserver::observeStart ( const IAlgorithm_const_sptr alg)

Connect to algorithm alg and observe its start notification.

Parameters
alg:: Algorithm to be observed

Definition at line 66 of file AlgorithmObserver.cpp.

References m_startObserver.

Referenced by MantidQt::MantidWidgets::AlgorithmProgressModel::startingHandle().

◆ observeStarting()

void Mantid::API::AlgorithmObserver::observeStarting ( )

◆ progressHandle()

virtual void Mantid::API::AlgorithmObserver::progressHandle ( const IAlgorithm alg,
double  p,
const std::string &  msg,
const double  estimatedTime,
const int  progressPrecision 
)
virtual

◆ startHandle()

virtual void Mantid::API::AlgorithmObserver::startHandle ( const IAlgorithm alg)
virtual

◆ startingHandle()

virtual void Mantid::API::AlgorithmObserver::startingHandle ( IAlgorithm_sptr  alg)
virtual

◆ stopObserving() [1/2]

void Mantid::API::AlgorithmObserver::stopObserving ( const IAlgorithm_const_sptr alg)

Disconnect from algorithm alg.

Should be called in the destructor of inherited classes.

Parameters
alg:: Algorithm to be disconnected

Definition at line 82 of file AlgorithmObserver.cpp.

References stopObserving().

Referenced by MantidQt::API::AlgorithmDialog::executeAlgorithmAsync(), MantidQt::MantidWidgets::AlgorithmProgressModel::removeFrom(), stopObserving(), stopObserving(), and MantidQt::API::AlgorithmDialog::~AlgorithmDialog().

◆ stopObserving() [2/2]

void Mantid::API::AlgorithmObserver::stopObserving ( const Mantid::API::IAlgorithm alg)

◆ stopObservingManager()

void Mantid::API::AlgorithmObserver::stopObservingManager ( )

Member Data Documentation

◆ m_errorObserver

Poco::NObserver<AlgorithmObserver, Algorithm::ErrorNotification> Mantid::API::AlgorithmObserver::m_errorObserver
private

◆ m_finishObserver

Poco::NObserver<AlgorithmObserver, Algorithm::FinishedNotification> Mantid::API::AlgorithmObserver::m_finishObserver
private

◆ m_progressObserver

Poco::NObserver<AlgorithmObserver, Algorithm::ProgressNotification> Mantid::API::AlgorithmObserver::m_progressObserver
private

◆ m_startingObserver

Poco::NObserver<AlgorithmObserver, AlgorithmStartingNotification> Mantid::API::AlgorithmObserver::m_startingObserver
private

◆ m_startObserver

Poco::NObserver<AlgorithmObserver, Algorithm::StartedNotification> Mantid::API::AlgorithmObserver::m_startObserver
private

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