Mantid
Loading...
Searching...
No Matches
ConstraintFactory.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#include <vector>
16
17namespace Mantid {
18
19namespace API {
20
21//----------------------------------------------------------------------
22// Forward declarations
23//----------------------------------------------------------------------
24class IConstraint;
25class IFunction;
26class Expression;
27
39class MANTID_API_DLL ConstraintFactoryImpl final : public Kernel::DynamicFactory<IConstraint> {
40public:
44 IConstraint *createInitialized(IFunction *fun, const std::string &input, bool isDefault = false) const;
46 IConstraint *createInitialized(IFunction *fun, const Expression &expr, bool isDefault = false) const;
47
48private:
50
54 ~ConstraintFactoryImpl() override = default;
55};
56
58
59} // namespace API
60} // namespace Mantid
61
62namespace Mantid {
63namespace Kernel {
64EXTERN_MANTID_API template class MANTID_API_DLL Mantid::Kernel::SingletonHolder<Mantid::API::ConstraintFactoryImpl>;
65}
66} // namespace Mantid
67
72#define DECLARE_CONSTRAINT(classname) \
73 namespace { \
74 Mantid::Kernel::RegistrationHelper register_constraint_##classname( \
75 ((Mantid::API::ConstraintFactory::Instance().subscribe<classname>(#classname)), 0)); \
76 }
The ConstraintFactory class is in charge of the creation of concrete instances of Constraints.
ConstraintFactoryImpl & operator=(const ConstraintFactoryImpl &)=delete
ConstraintFactoryImpl(const ConstraintFactoryImpl &)=delete
~ConstraintFactoryImpl() override=default
Private Destructor.
This class represents an expression made up of names, binary operators and brackets.
Definition: Expression.h:36
An interface to a constraint.
Definition: IConstraint.h:26
This is an interface to a fitting function - a semi-abstarct class.
Definition: IFunction.h:163
The dynamic factory is a base dynamic factory for serving up objects in response to requests from oth...
Manage the lifetime of a class intended to be a singleton.
Helper class which provides the Collimation Length for SANS instruments.
Policy class controlling creation of the singleton Implementation classes should mark their default c...