Mantid
Loading...
Searching...
No Matches
Algorithm.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#include <atomic>
10#include <memory>
11
12#include "MantidAPI/DllConfig.h"
18
19// -- These headers will (most-likely) be used by every inheriting algorithm
20#include "MantidAPI/AlgorithmFactory.h" //for the factory macro
21#include "MantidAPI/Progress.h"
26
27#include "MantidParallel/ExecutionMode.h"
28#include "MantidParallel/StorageMode.h"
29
30namespace Poco {
31template <class R, class A, class O, class S> class ActiveMethod;
32template <class O> class ActiveStarter;
33class NotificationCenter;
34template <class C, class N> class NObserver;
35class Void;
36} // namespace Poco
37
38namespace Json {
39class Value;
40}
41
42namespace Mantid {
43namespace Kernel {
44// this is declared in MantidKernel/Timer.h
45using time_point_ns = std::chrono::time_point<std::chrono::high_resolution_clock>;
46} // namespace Kernel
47namespace Indexing {
48class SpectrumIndexSet;
49}
50namespace Parallel {
51class Communicator;
52}
53namespace API {
54//----------------------------------------------------------------------
55// Forward Declaration
56//----------------------------------------------------------------------
59
61using Algorithm_sptr = std::shared_ptr<Algorithm>;
62
85class MANTID_API_DLL Algorithm : public IAlgorithm {
86public:
88 class MANTID_API_DLL AlgorithmNotification : public Poco::Notification {
89 public:
90 AlgorithmNotification(const Algorithm *const alg);
91 const IAlgorithm *algorithm() const;
92
93 private:
94 const IAlgorithm *const m_algorithm;
95 };
96
98 class MANTID_API_DLL StartedNotification : public AlgorithmNotification {
99 public:
100 StartedNotification(const Algorithm *const alg);
101 std::string name() const override;
102 };
103
105 class MANTID_API_DLL FinishedNotification : public AlgorithmNotification {
106 public:
107 FinishedNotification(const Algorithm *const alg, bool res);
108 std::string name() const override;
109 bool success;
111 };
112
115 class MANTID_API_DLL ProgressNotification : public AlgorithmNotification {
116 public:
118 ProgressNotification(const Algorithm *const alg, double p, std::string msg, double estimatedTime,
119 int progressPrecision);
120 std::string name() const override;
121 double progress;
122 std::string message;
126 };
127
130 class MANTID_API_DLL ErrorNotification : public AlgorithmNotification {
131 public:
133 ErrorNotification(const Algorithm *const alg, std::string str);
134 std::string name() const override;
135 std::string what;
136 };
137
145 class MANTID_API_DLL CancelException : public std::exception {
146 public:
148 const char *what() const noexcept override;
149 };
150
151 //============================================================================
152 Algorithm();
153 Algorithm(const Algorithm &) = delete;
154 Algorithm &operator=(const Algorithm &) = delete;
155 ~Algorithm() override;
156
160 const std::string name() const override = 0;
163 int version() const override = 0;
166 const std::string summary() const override = 0;
169 const std::string category() const override { return "Misc"; }
171 const std::vector<std::string> categories() const override;
174 const std::string categorySeparator() const override { return ";"; }
177 const std::vector<std::string> seeAlso() const override { return {}; };
179 const std::string alias() const override { return ""; }
181 bool calledByAlias = false;
182
184 const std::string aliasDeprecated() const override { return ""; }
185
189 const std::string helpURL() const override { return ""; }
190
191 template <typename T, typename = typename std::enable_if<std::is_convertible<T *, MatrixWorkspace *>::value>::type>
192 std::tuple<std::shared_ptr<T>, Indexing::SpectrumIndexSet> getWorkspaceAndIndices(const std::string &name) const;
193
194 template <typename T1, typename T2,
195 typename = typename std::enable_if<std::is_convertible<T1 *, MatrixWorkspace *>::value>::type,
196 typename = typename std::enable_if<std::is_convertible<T2 *, std::string *>::value ||
197 std::is_convertible<T2 *, std::vector<int64_t> *>::value>::type>
198 void setWorkspaceInputProperties(const std::string &name, const std::shared_ptr<T1> &wksp, IndexType type,
199 const T2 &list);
200
201 template <typename T1, typename T2,
202 typename = typename std::enable_if<std::is_convertible<T1 *, MatrixWorkspace *>::value>::type,
203 typename = typename std::enable_if<std::is_convertible<T2 *, std::string *>::value ||
204 std::is_convertible<T2 *, std::vector<int64_t> *>::value>::type>
205 void setWorkspaceInputProperties(const std::string &name, const std::string &wsName, IndexType type, const T2 &list);
206
207 const std::string workspaceMethodName() const override;
208 const std::vector<std::string> workspaceMethodOn() const override;
209 const std::string workspaceMethodInputProperty() const override;
210
213 AlgorithmID getAlgorithmID() const override { return m_algorithmID; }
214
216 void initialize() override;
217 bool execute() override final;
218 void addTimer(const std::string &name, const Kernel::time_point_ns &begin, const Kernel::time_point_ns &end);
219 void executeAsChildAlg() override;
220 std::map<std::string, std::string> validateInputs() override;
221
223 ExecutionState executionState() const override;
225 ResultState resultState() const override;
226 bool isInitialized() const override;
227 bool isExecuted() const override;
228 bool isRunning() const override;
229 bool isReadyForGarbageCollection() const override;
230
231 bool isChild() const override;
232 void setChild(const bool isChild) override;
233 void enableHistoryRecordingForChild(const bool on) override;
234 bool isRecordingHistoryForChild() { return m_recordHistoryForChild; }
235 void setAlwaysStoreInADS(const bool doStore) override;
236 bool getAlwaysStoreInADS() const override;
237 void setRethrows(const bool rethrow) override;
238
240 Poco::ActiveResult<bool> executeAsync() override;
241
243 void addObserver(const Poco::AbstractObserver &observer) const override;
244
246 void removeObserver(const Poco::AbstractObserver &observer) const override;
247
249 void cancel() override;
250 bool getCancel() const;
251
252 Kernel::Logger &getLogger() const;
253 void setLogging(const bool value) override;
254 bool isLogging() const override;
255 void setLoggingOffset(const int value) override;
256 int getLoggingOffset() const override;
258 void setAlgStartupLogging(const bool enabled) override;
260 bool getAlgStartupLogging() const override;
261
263 void setChildStartProgress(const double startProgress) const override { m_startChildProgress = startProgress; }
265 void setChildEndProgress(const double endProgress) const override { m_endChildProgress = endProgress; }
266
270 std::string toString() const override;
272 ::Json::Value toJson() const override;
274 static IAlgorithm_sptr fromString(const std::string &input);
276 static IAlgorithm_sptr fromJson(const Json::Value &input);
278 static IAlgorithm_sptr fromHistory(const AlgorithmHistory &history);
280
281 virtual std::shared_ptr<Algorithm> createChildAlgorithm(const std::string &name, const double startProgress = -1.,
282 const double endProgress = -1.,
283 const bool enableLogging = true, const int &version = -1);
284 void setupAsChildAlgorithm(const Algorithm_sptr &algorithm, const double startProgress = -1.,
285 const double endProgress = -1., const bool enableLogging = true);
286
289 void trackAlgorithmHistory(std::shared_ptr<AlgorithmHistory> parentHist);
290
291 using WorkspaceVector = std::vector<std::shared_ptr<Workspace>>;
292
293 void findWorkspaces(WorkspaceVector &workspaces, unsigned int direction, bool checkADS = false) const;
294
295 // ------------------ For WorkspaceGroups ------------------------------------
296 virtual bool checkGroups();
297
298 virtual bool processGroups();
299
300 void copyNonWorkspaceProperties(IAlgorithm *alg, int periodNum);
301
302 const Parallel::Communicator &communicator() const;
303 void setCommunicator(const Parallel::Communicator &communicator);
304
305 // Function to declare properties (i.e. store them)
306 void declareProperty(std::unique_ptr<Kernel::Property> p, const std::string &doc = "") override;
307
308 // Function to declare properties (i.e. store them)
309 void declareOrReplaceProperty(std::unique_ptr<Kernel::Property> p, const std::string &doc = "") override;
310 void resetProperties() override;
311 using IPropertyManager::declareProperty;
312 // Sets all the declared properties from
313 void setProperties(const std::string &propertiesJson,
314 const std::unordered_set<std::string> &ignoreProperties = std::unordered_set<std::string>(),
315 bool createMissing = false) override;
316
317 // Sets all the declared properties from a json object
318 void setProperties(const ::Json::Value &jsonValue,
319 const std::unordered_set<std::string> &ignoreProperties = std::unordered_set<std::string>(),
320 bool createMissing = false) override;
321
322 // sets all the declared properties using a simple string format
323 void setPropertiesWithString(
324 const std::string &propertiesString,
325 const std::unordered_set<std::string> &ignoreProperties = std::unordered_set<std::string>()) override;
326
327 void setPropertyValue(const std::string &name, const std::string &value) override;
328 void setPropertyValueFromJson(const std::string &name, const Json::Value &value) override;
329 void setPropertyOrdinal(const int &index, const std::string &value) override;
330
332 virtual void copyPropertiesFrom(const Algorithm &alg) { m_properties.copyPropertiesFrom(alg.m_properties); }
333
334 bool existsProperty(const std::string &name) const override;
335 bool validateProperties() const override;
336 size_t propertyCount() const override;
337
338 std::string getPropertyValue(const std::string &name) const override;
339 const std::vector<Kernel::Property *> &getProperties() const override;
340 std::vector<std::string> getDeclaredPropertyNames() const noexcept override;
341
343 TypedValue getProperty(const std::string &name) const override;
344
346 std::string asString(bool withDefaultValues = false) const override;
347
349 ::Json::Value asJson(bool withDefaultValues = false) const override;
350
351 bool isDefault(const std::string &name) const;
352
354 void removeProperty(const std::string &name, const bool delproperty = true) override;
356 std::unique_ptr<Kernel::Property> takeProperty(const size_t index) override;
357
359 void clear() override;
363 void afterPropertySet(const std::string &) override;
364
365 void filterByTime(const Types::Core::DateAndTime & /*start*/, const Types::Core::DateAndTime & /*stop*/) override {
366 throw(std::runtime_error("Not yet implmented"));
367 }
368 void splitByTime(std::vector<Kernel::SplittingInterval> & /*splitter*/,
369 std::vector<Kernel::PropertyManager *> /* outputs*/) const override {
370 throw(std::runtime_error("Not yet implmented"));
371 }
372
373 void filterByProperty(const Kernel::TimeSeriesProperty<bool> & /*filter*/, const std::vector<std::string> &
374 /* excludedFromFiltering */) override {
375 throw(std::runtime_error("Not yet implmented"));
376 }
377 Kernel::Property *getPointerToProperty(const std::string &name) const override;
378 Kernel::Property *getPointerToPropertyOrdinal(const int &index) const override;
379
380protected:
382 virtual void init() = 0;
384 virtual void exec() = 0;
385
386 void exec(Parallel::ExecutionMode executionMode);
387 virtual void execDistributed();
388 virtual void execMasterOnly();
389
390 virtual Parallel::ExecutionMode
391 getParallelExecutionMode(const std::map<std::string, Parallel::StorageMode> &storageModes) const;
392
395 virtual const std::string workspaceMethodOnTypes() const { return ""; }
396
397 void cacheWorkspaceProperties();
398 void cacheInputWorkspaceHistories();
399
400 void setExecutionState(const ExecutionState state);
401 void setResultState(const ResultState state);
402
403 void store();
404
406 friend class Progress;
407 void progress(double p, const std::string &msg = "", double estimatedTime = 0.0, int progressPrecision = 0);
408 void interruption_point();
409
411 Poco::NotificationCenter &notificationCenter() const;
412
415 void handleChildProgressNotification(const Poco::AutoPtr<ProgressNotification> &pNf);
417 const Poco::AbstractObserver &progressObserver() const;
418
421 template <typename NumT> static bool isEmpty(const NumT toCheck);
422
424 bool isWorkspaceProperty(const Kernel::Property *const prop) const;
425
427 bool trackingHistory();
430 virtual void fillHistory();
431
433 std::atomic<bool> m_cancel;
435 std::atomic<bool> m_parallelException;
436
437 friend class WorkspaceHistory; // Allow workspace history loading to adjust
438 // g_execCount
439 static size_t g_execCount;
440
441 virtual void setOtherProperties(IAlgorithm *alg, const std::string &propertyName, const std::string &propertyValue,
442 int periodNum);
443
445 std::vector<IWorkspaceProperty *> m_inputWorkspaceProps;
447 std::shared_ptr<AlgorithmHistory> m_history;
448
452
454 std::shared_ptr<AlgorithmHistory> m_parentHistory;
455
458 std::vector<WorkspaceVector> m_unrolledInputWorkspaces;
463 bool m_usingBaseProcessGroups = false;
464
465 template <typename T, const int AllowedIndexTypes = static_cast<int>(IndexType::WorkspaceIndex),
466 typename... WSPropArgs,
467 typename = typename std::enable_if<std::is_convertible<T *, MatrixWorkspace *>::value>::type>
468 void declareWorkspaceInputProperties(const std::string &propertyName, const std::string &doc,
469 WSPropArgs &&...wsPropArgs);
470
471private:
472 template <typename T1, typename T2, typename WsType>
473 void doSetInputProperties(const std::string &name, const T1 &wksp, IndexType type, const T2 &list);
474 void lockWorkspaces();
475
476 void unlockWorkspaces();
477
478 void clearWorkspaceCaches();
479
480 void linkHistoryWithLastChild();
481
482 void logAlgorithmInfo() const;
483
484 bool executeInternal();
485
486 bool executeAsyncImpl(const Poco::Void &i);
487
488 bool doCallProcessGroups(Mantid::Types::Core::DateAndTime &start_time);
489
490 void fillHistory(const std::vector<Workspace_sptr> &outputWorkspaces);
491
492 // Report that the algorithm has completed.
493 void reportCompleted(const double &duration, const bool groupProcessing = false);
494
495 void registerFeatureUsage() const;
496
497 Parallel::ExecutionMode getExecutionMode() const;
498 std::map<std::string, Parallel::StorageMode> getInputWorkspaceStorageModes() const;
499 void setupSkipValidationMasterOnly();
500
501 bool isCompoundProperty(const std::string &name) const;
502
503 // --------------------- Private Members -----------------------------------
505 std::unique_ptr<Poco::ActiveMethod<bool, Poco::Void, Algorithm, Poco::ActiveStarter<Algorithm>>> m_executeAsync;
506
510 mutable std::unique_ptr<Poco::NotificationCenter> m_notificationCenter;
512 mutable std::unique_ptr<Poco::NObserver<Algorithm, ProgressNotification>> m_progressObserver;
513
514 std::atomic<ExecutionState> m_executionState;
515 std::atomic<ResultState> m_resultState;
525 mutable double m_startChildProgress;
527 mutable double m_endChildProgress;
530 std::vector<std::weak_ptr<IAlgorithm>> m_ChildAlgorithms;
535
540
542 std::vector<IWorkspaceProperty *> m_outputWorkspaceProps;
544 std::vector<IWorkspaceProperty *> m_pureOutputWorkspaceProps;
545
547 std::vector<std::shared_ptr<WorkspaceGroup>> m_groupWorkspaces;
554 std::vector<Workspace_sptr> m_inputWorkspaceHistories;
555
557 std::vector<std::string> m_reservedList;
558
560 std::unique_ptr<Parallel::Communicator> m_communicator;
561
563 Mantid::Types::Core::DateAndTime m_gcTime;
564
566};
567
568} // namespace API
569} // namespace Mantid
570
571/* Used to register classes into the factory. creates a global object in an
572 * anonymous namespace. The object itself does nothing, but the comma operator
573 * is used in the call to its constructor to effect a call to the factory's
574 * subscribe method.
575 */
576#define DECLARE_ALGORITHM(classname) \
577 namespace { \
578 Mantid::Kernel::RegistrationHelper \
579 register_alg_##classname(((Mantid::API::AlgorithmFactory::Instance().subscribe<classname>()), 0)); \
580 }
double value
The value of the point.
Definition: FitMW.cpp:51
std::map< DeltaEMode::Type, std::string > index
Definition: DeltaEMode.cpp:19
std::vector< history_type > history
history information
This class stores information about the Command History used by algorithms on a workspace.
Base class for algorithm notifications.
Definition: Algorithm.h:88
const IAlgorithm *const m_algorithm
The algorithm.
Definition: Algorithm.h:94
CancelException is thrown to cancel execution of the algorithm.
Definition: Algorithm.h:145
ErrorNotification is sent when an exception is caught during execution of the algorithm.
Definition: Algorithm.h:130
std::string what
message string
Definition: Algorithm.h:135
FinishedNotification is sent after the algorithm finishes its execution.
Definition: Algorithm.h:105
bool success
true if the finished algorithm was successful or false if it failed.
Definition: Algorithm.h:109
An algorithm can report its progress by sending ProgressNotification.
Definition: Algorithm.h:115
double estimatedTime
Estimated time to completion.
Definition: Algorithm.h:123
double progress
Current progress. Value must be between 0 and 1.
Definition: Algorithm.h:121
int progressPrecision
Digits of precision to the progress (after the decimal).
Definition: Algorithm.h:124
std::string message
Message sent with notification.
Definition: Algorithm.h:122
StartedNotification is sent when the algorithm begins execution.
Definition: Algorithm.h:98
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
const std::string categorySeparator() const override
Function to return the separator token for the category string.
Definition: Algorithm.h:174
std::vector< std::shared_ptr< WorkspaceGroup > > m_groupWorkspaces
Pointer to the WorkspaceGroup (if any) for each input workspace property.
Definition: Algorithm.h:547
std::vector< Workspace_sptr > m_inputWorkspaceHistories
Store a pointer to the input workspace histories so they can be copied to the outputs to avoid anythi...
Definition: Algorithm.h:554
virtual const std::string workspaceMethodOnTypes() const
Returns a semi-colon separated list of workspace types to attach this algorithm.
Definition: Algorithm.h:395
void doSetInputProperties(const std::string &name, const T1 &wksp, IndexType type, const T2 &list)
void setWorkspaceInputProperties(const std::string &name, const std::string &wsName, IndexType type, const T2 &list)
AlgorithmID m_algorithmID
Algorithm ID for managed algorithms.
Definition: Algorithm.h:529
std::unique_ptr< Poco::NObserver< Algorithm, ProgressNotification > > m_progressObserver
Child algorithm progress observer.
Definition: Algorithm.h:512
std::vector< std::string > m_reservedList
Reserved property names.
Definition: Algorithm.h:557
AlgorithmID getAlgorithmID() const override
Algorithm ID.
Definition: Algorithm.h:213
int m_singleGroup
If only one input is a group, this is its index. -1 if they are all groups.
Definition: Algorithm.h:549
std::vector< IWorkspaceProperty * > m_inputWorkspaceProps
All the WorkspaceProperties that are Input or InOut. Set in execute()
Definition: Algorithm.h:445
void setChildEndProgress(const double endProgress) const override
setting the child end progress
Definition: Algorithm.h:265
WorkspaceVector m_writeLockedWorkspaces
Vector of all the workspaces that have been write-locked.
Definition: Algorithm.h:539
bool m_rethrow
Algorithm should rethrow exceptions while executing.
Definition: Algorithm.h:521
void declareWorkspaceInputProperties(const std::string &propertyName, const std::string &doc, WSPropArgs &&...wsPropArgs)
double m_startChildProgress
Whether to log alg startup and closedown messages from the base class (default = true)
Definition: Algorithm.h:525
void filterByProperty(const Kernel::TimeSeriesProperty< bool > &, const std::vector< std::string > &) override
Definition: Algorithm.h:373
const std::string aliasDeprecated() const override
Expiration date (in ISO8601 format) for the algorithm aliases; default implementation for no expirati...
Definition: Algorithm.h:184
std::vector< std::weak_ptr< IAlgorithm > > m_ChildAlgorithms
A list of weak pointers to any child algorithms created.
Definition: Algorithm.h:530
std::atomic< bool > m_cancel
Set to true to stop execution.
Definition: Algorithm.h:433
std::shared_ptr< AlgorithmHistory > m_parentHistory
Pointer to the parent history object (if set)
Definition: Algorithm.h:454
Algorithm(const Algorithm &)=delete
std::shared_ptr< AlgorithmHistory > m_history
Pointer to the history for the algorithm being executed.
Definition: Algorithm.h:447
std::vector< IWorkspaceProperty * > m_outputWorkspaceProps
All the WorkspaceProperties that are Output or InOut. Set in execute()
Definition: Algorithm.h:542
std::vector< IWorkspaceProperty * > m_pureOutputWorkspaceProps
All the WorkspaceProperties that are Output (not inOut). Set in execute()
Definition: Algorithm.h:544
virtual void copyPropertiesFrom(const Algorithm &alg)
Make m_properties point to the same PropertyManager as alg.m_properties.
Definition: Algorithm.h:332
size_t m_groupSize
Size of the group(s) being processed.
Definition: Algorithm.h:460
std::atomic< bool > m_parallelException
Set if an exception is thrown, and not caught, within a parallel region.
Definition: Algorithm.h:435
WorkspaceVector m_readLockedWorkspaces
Vector of all the workspaces that have been read-locked.
Definition: Algorithm.h:537
virtual void init()=0
Virtual method - must be overridden by concrete algorithm.
Kernel::Logger & g_log
Definition: Algorithm.h:451
std::vector< std::shared_ptr< Workspace > > WorkspaceVector
Definition: Algorithm.h:291
void setChildStartProgress(const double startProgress) const override
setting the child start progress
Definition: Algorithm.h:263
bool m_alwaysStoreInADS
Always store in the ADS, even for child algos.
Definition: Algorithm.h:519
bool m_isAlgStartupLoggingEnabled
Definition: Algorithm.h:522
void splitByTime(std::vector< Kernel::SplittingInterval > &, std::vector< Kernel::PropertyManager * >) const override
Definition: Algorithm.h:368
void setWorkspaceInputProperties(const std::string &name, const std::shared_ptr< T1 > &wksp, IndexType type, const T2 &list)
std::atomic< ResultState > m_resultState
the current result State
Definition: Algorithm.h:515
const std::string alias() const override
function to return any aliases to the algorithm; A default implementation is provided
Definition: Algorithm.h:179
std::unique_ptr< Poco::ActiveMethod< bool, Poco::Void, Algorithm, Poco::ActiveStarter< Algorithm > > > m_executeAsync
Poco::ActiveMethod used to implement asynchronous execution.
Definition: Algorithm.h:505
Algorithm & operator=(const Algorithm &)=delete
std::vector< WorkspaceVector > m_unrolledInputWorkspaces
One vector of workspaces for each input workspace property.
Definition: Algorithm.h:458
bool m_isChildAlgorithm
Algorithm is a child algorithm.
Definition: Algorithm.h:516
Mantid::Kernel::PropertyManagerOwner m_properties
Definition: Algorithm.h:565
const std::string category() const override
function to return a category of the algorithm.
Definition: Algorithm.h:169
virtual void exec()=0
Virtual method - must be overridden by concrete algorithm.
~Algorithm() override
Virtual destructor.
bool m_runningAsync
Algorithm is running asynchronously.
Definition: Algorithm.h:520
const std::string helpURL() const override
function to return URL for algorithm documentation; A default implementation is provided.
Definition: Algorithm.h:189
int version() const override=0
function to return a version of the algorithm, must be overridden in all algorithms
std::atomic< ExecutionState > m_executionState
the current execution state
Definition: Algorithm.h:514
static bool isEmpty(const NumT toCheck)
checks that the value was not set by users, uses the value in empty double/int.
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
Definition: Algorithm.h:177
bool m_groupsHaveSimilarNames
All the groups have similar names (group_1, group_2 etc.)
Definition: Algorithm.h:551
const std::string summary() const override=0
function returns a summary message that will be displayed in the default GUI, and in the help.
std::unique_ptr< Parallel::Communicator > m_communicator
(MPI) communicator used when executing the algorithm.
Definition: Algorithm.h:560
double m_endChildProgress
Keeps value for algorithm's progress at Child Algorithm's finish.
Definition: Algorithm.h:527
Mantid::Types::Core::DateAndTime m_gcTime
The earliest this class should be considered for garbage collection.
Definition: Algorithm.h:563
std::unique_ptr< Poco::NotificationCenter > m_notificationCenter
Sends notifications to observers.
Definition: Algorithm.h:510
Kernel::Logger m_log
Logger for this algorithm.
Definition: Algorithm.h:450
static size_t g_execCount
Counter to keep track of algorithm execution order.
Definition: Algorithm.h:439
bool m_recordHistoryForChild
Flag to indicate whether history should be recorded.
Definition: Algorithm.h:517
std::tuple< std::shared_ptr< T >, Indexing::SpectrumIndexSet > getWorkspaceAndIndices(const std::string &name) const
const std::string name() const override=0
function to return a name of the algorithm, must be overridden in all algorithms
IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:45
Helper class for reporting progress from algorithms.
Definition: Progress.h:25
This class stores information about the Workspace History used by algorithms on a workspace and the e...
The Logger class is in charge of the publishing messages from the framework through various channels.
Definition: Logger.h:52
Kernel/PropertyManagerOwner.h.
Base class for properties.
Definition: Property.h:94
A specialised Property class for holding a series of time-value pairs.
Definition: Algorithm.h:38
std::shared_ptr< IAlgorithm > IAlgorithm_sptr
shared pointer to Mantid::API::IAlgorithm
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
std::shared_ptr< Algorithm > Algorithm_sptr
Typedef for a shared pointer to an Algorithm.
Definition: Algorithm.h:61
std::chrono::time_point< std::chrono::high_resolution_clock > time_point_ns
Definition: Algorithm.h:45
Helper class which provides the Collimation Length for SANS instruments.
Definition: Algorithm.h:30
STL namespace.