Mantid
Loading...
Searching...
No Matches
FunctionProperty.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"
13#include "MantidAPI/IFunction.h"
17
18#include <string>
19
20namespace Mantid {
21namespace API {
29class MANTID_API_DLL FunctionProperty : public Kernel::PropertyWithValue<std::shared_ptr<IFunction>> {
30public:
32 FunctionProperty(const std::string &name, const unsigned int direction = Kernel::Direction::Input,
33 const PropertyMode::Type optional = PropertyMode::Type::Mandatory);
34
37
41
44 FunctionProperty &operator=(const std::shared_ptr<IFunction> &value) override;
45
48
50 FunctionProperty *clone() const override { return new FunctionProperty(*this); }
51
53 std::string value() const override;
54
56 Json::Value valueAsJson() const override;
57
59 std::string getDefault() const override;
60
62 std::string setValue(const std::string &value) override;
63
65 std::string setValueFromJson(const Json::Value &value) override;
66
68 std::string isValid() const override;
69
71 bool isDefault() const override;
72
74 const Kernel::PropertyHistory createHistory() const override;
75
76private:
78 bool isOptional() const;
79
83 std::string m_definition;
84};
85
86} // namespace API
87} // namespace Mantid
double value
The value of the point.
Definition: FitMW.cpp:51
double right
Definition: LineProfile.cpp:81
A property class for functions.
std::string m_definition
The function definition string (as used by the FunctionFactory)
FunctionProperty(const FunctionProperty &right)=default
Copy constructor.
PropertyMode::Type m_optional
A flag indicating whether the property should be considered optional.
FunctionProperty & operator=(const FunctionProperty &right)=default
Copy assignment operator.
FunctionProperty * clone() const override
'Virtual copy constructor'
This class stores information about the parameters used by an algorithm.
The concrete, templated class for properties.
Base class for properties.
Definition: Property.h:94
MatrixWorkspace_sptr MANTID_API_DLL operator+=(const MatrixWorkspace_sptr &lhs, const MatrixWorkspace_sptr &rhs)
Adds two workspaces.
Helper class which provides the Collimation Length for SANS instruments.