Mantid
Loading...
Searching...
No Matches
IAlgorithm.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2007 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9//----------------------------------------------------------------------
10// Includes
11//----------------------------------------------------------------------
12#include "MantidAPI/DllConfig.h"
15
16namespace Poco {
17class AbstractObserver;
18template <class T> class ActiveResult;
19} // namespace Poco
20
21namespace Mantid {
22namespace API {
23
28using AlgorithmID = void *;
29
34
45class MANTID_API_DLL IAlgorithm : virtual public Kernel::IPropertyManager {
46public:
49 virtual const std::string name() const = 0;
50
53 virtual int version() const = 0;
54
57 virtual const std::string summary() const = 0;
58
60 virtual const std::string category() const = 0;
61
63 virtual const std::vector<std::string> categories() const = 0;
64
66 virtual const std::string categorySeparator() const = 0;
67
69 virtual const std::vector<std::string> seeAlso() const = 0;
70
72 virtual const std::string aliasDeprecated() const = 0;
73
75 virtual const std::string alias() const = 0;
76
79 virtual const std::string helpURL() const = 0;
80
85 virtual const std::string workspaceMethodName() const = 0;
88 virtual const std::vector<std::string> workspaceMethodOn() const = 0;
91 virtual const std::string workspaceMethodInputProperty() const = 0;
93
96 virtual AlgorithmID getAlgorithmID() const = 0;
97
103 virtual void initialize() = 0;
104
107 virtual std::map<std::string, std::string> validateInputs() = 0;
108
111 virtual bool execute() = 0;
112
115
117 virtual void executeAsChildAlg() = 0;
118
120 virtual ExecutionState executionState() const = 0;
121
123 virtual ResultState resultState() const = 0;
124
126 virtual bool isInitialized() const = 0;
128 virtual bool isExecuted() const = 0;
129
133 virtual void cancel() = 0;
134
136 virtual bool isRunning() const = 0;
137
139 virtual bool isReadyForGarbageCollection() const = 0;
140
142 virtual bool isChild() const = 0;
143
145 virtual bool getAlwaysStoreInADS() const = 0;
146
151 virtual void setChild(const bool isChild) = 0;
152
154 virtual void enableHistoryRecordingForChild(const bool on) = 0;
155
157 virtual void setAlwaysStoreInADS(const bool doStore) = 0;
158
160 virtual void setRethrows(const bool rethrow) = 0;
161
163 virtual void addObserver(const Poco::AbstractObserver &observer) const = 0;
164
166 virtual void removeObserver(const Poco::AbstractObserver &observer) const = 0;
167
169 virtual void setLogging(const bool value) = 0;
171 virtual bool isLogging() const = 0;
173 virtual void setLoggingOffset(const int value) = 0;
175 virtual int getLoggingOffset() const = 0;
177 virtual void setAlgStartupLogging(const bool enabled) = 0;
179 virtual bool getAlgStartupLogging() const = 0;
181 virtual void setChildStartProgress(const double startProgress) const = 0;
183 virtual void setChildEndProgress(const double endProgress) const = 0;
185 virtual std::string toString() const = 0;
187 virtual ::Json::Value toJson() const = 0;
188
189private:
190 using Kernel::IPropertyManager::asJson;
191};
192
193} // namespace API
194} // namespace Mantid
double value
The value of the point.
Definition: FitMW.cpp:51
IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:45
virtual const std::string workspaceMethodInputProperty() const =0
Returns the name of the input workspace property used by the calling object.
virtual std::string toString() const =0
Serialize an algorithm.
virtual ::Json::Value toJson() const =0
Serialize an algorithm as Json.
virtual Poco::ActiveResult< bool > executeAsync()=0
Asynchronous execution of the algorithm.
virtual bool isExecuted() const =0
Check whether the algorithm has been executed sucessfully.
virtual bool isInitialized() const =0
Check whether the algorithm is initialized properly.
virtual const std::string alias() const =0
function to return any aliases of the algorithm.
virtual void removeObserver(const Poco::AbstractObserver &observer) const =0
Remove an observer.
virtual bool isChild() const =0
To query whether algorithm is a child. Default to false.
virtual int version() const =0
function to return a version of the algorithm, must be overridden in all algorithms
virtual const std::string aliasDeprecated() const =0
Expiration date (in ISO8601 format) for the algorithm aliases. Empty if no expiration date.
virtual const std::string categorySeparator() const =0
Function to return the separator token for the category string.
virtual const std::string helpURL() const =0
function to return an optional URL for documentation.
virtual void setChildStartProgress(const double startProgress) const =0
setting the child start progress
virtual const std::vector< std::string > categories() const =0
Function to return all of the categories that contain this algorithm.
virtual bool isLogging() const =0
returns the status of logging, True = enabled
virtual ExecutionState executionState() const =0
Gets the current execution state.
virtual const std::vector< std::string > seeAlso() const =0
Function to return all of the seeAlso algorithms related to this algorithm.
virtual bool isRunning() const =0
True if the algorithm is running.
virtual const std::string category() const =0
function to return a category of the algorithm.
virtual bool isReadyForGarbageCollection() const =0
True if the algorithm is ready for garbage collection.
virtual void setChild(const bool isChild)=0
To set whether algorithm is a child.
virtual const std::string workspaceMethodName() const =0
virtual void executeAsChildAlg()=0
Execute as a Child Algorithm, with try/catch.
virtual const std::vector< std::string > workspaceMethodOn() const =0
Returns a set of class names that will have the method attached.
virtual bool getAlgStartupLogging() const =0
get the state of Logging of start and end messages
virtual const std::string summary() const =0
function returns a summary message that will be displayed in the default GUI, and in the help.
virtual void enableHistoryRecordingForChild(const bool on)=0
If true history will be recorded for a child.
virtual bool getAlwaysStoreInADS() const =0
To query whether the output is stored in the analysis data service.
virtual void setLogging(const bool value)=0
Logging can be disabled by passing a value of false.
virtual void cancel()=0
Raises the cancel flag.
virtual void setLoggingOffset(const int value)=0
gets the logging priority offset
virtual void setAlwaysStoreInADS(const bool doStore)=0
Set whether we always store the output in the analysis data service.
virtual void setRethrows(const bool rethrow)=0
To query whether an algorithm should rethrow exceptions when executing.
virtual void setAlgStartupLogging(const bool enabled)=0
disable Logging of start and end messages
virtual const std::string name() const =0
function to return a name of the algorithm, must be overridden in all algorithms
virtual bool execute()=0
System execution.
virtual void setChildEndProgress(const double endProgress) const =0
setting the child end progress
virtual void addObserver(const Poco::AbstractObserver &observer) const =0
Add an observer for a notification.
virtual int getLoggingOffset() const =0
returns the logging priority offset
virtual std::map< std::string, std::string > validateInputs()=0
Method checking errors on ALL the inputs, before execution.
virtual AlgorithmID getAlgorithmID() const =0
Algorithm ID.
virtual ResultState resultState() const =0
Gets the currnet result State.
virtual void initialize()=0
Initialization method invoked by the framework.
Interface to PropertyManager.
ResultState
The validity of the results of the algorithm object.
Definition: IAlgorithm.h:33
ExecutionState
The current state of the algorithm object.
Definition: IAlgorithm.h:31
void * AlgorithmID
As we have multiple interfaces to the same logical algorithm we need a way of uniquely identifying ma...
Definition: IAlgorithm.h:28
Helper class which provides the Collimation Length for SANS instruments.
Definition: Algorithm.h:30