Mantid
Loading...
Searching...
No Matches
Comment.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 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 +
9
10namespace Mantid::Algorithms {
11
16
17// Register the algorithm into the AlgorithmFactory
18DECLARE_ALGORITHM(Comment)
19
20//----------------------------------------------------------------------------------------------
21
22
23const std::string Comment::name() const { return "Comment"; }
24
26int Comment::version() const { return 1; }
27
29const std::string Comment::category() const { return "Utility\\Workspaces"; }
30
32const std::string Comment::summary() const { return "Adds a comment into the history record of a workspace"; }
33
34//----------------------------------------------------------------------------------------------
38 declareProperty(std::make_unique<WorkspaceProperty<Workspace>>("Workspace", "", Direction::InOut),
39 "An InOut workspace that will store the new history comment");
40
41 declareProperty("Text", "", std::make_shared<MandatoryValidator<std::string>>(),
42 "The text you want to store in the history of the workspace", Direction::Input);
43
44 // always record history for this algorithm
46}
47
48//----------------------------------------------------------------------------------------------
52 // do nothing
53}
54
55} // namespace Mantid::Algorithms
#define DECLARE_ALGORITHM(classname)
Definition: Algorithm.h:576
void declareProperty(std::unique_ptr< Kernel::Property > p, const std::string &doc="") override
Add a property to the list of managed properties.
Definition: Algorithm.cpp:1913
void enableHistoryRecordingForChild(const bool on) override
Change the state of the history recording flag.
Definition: Algorithm.cpp:176
A property class for workspaces.
Base Workspace Abstract Class.
Definition: Workspace.h:30
Comment : Adds a note into the history record of a workspace.
Definition: Comment.h:16
void init() override
Initialize the algorithm's properties.
Definition: Comment.cpp:37
const std::string category() const override
Algorithm's category for identification.
Definition: Comment.cpp:29
const std::string summary() const override
Algorithm's summary for use in the GUI and help.
Definition: Comment.cpp:32
void exec() override
Execute the algorithm.
Definition: Comment.cpp:51
int version() const override
Algorithm's version for identification.
Definition: Comment.cpp:26
Validator to check that a property is not left empty.
STL namespace.
Describes the direction (within an algorithm) of a Property.
Definition: Property.h:50
@ InOut
Both an input & output workspace.
Definition: Property.h:55
@ Input
An input workspace.
Definition: Property.h:53