12#include "MantidAPI/DllConfig.h"
28class CompositeFunction;
30class MultiDomainFunction;
51 std::shared_ptr<IFunction> createFunction(
const std::string &type)
const;
54 std::shared_ptr<IFunction> createInitialized(
const std::string &input)
const;
58 std::shared_ptr<MultiDomainFunction> createInitializedMultiDomainFunction(
const std::string &input,
59 size_t domainNumber)
const;
62 template <
typename FunctionType> std::vector<std::string> getFunctionNames()
const;
64 std::vector<std::string> getFunctionNamesGUI()
const;
67 void subscribe(
const std::string &className, std::unique_ptr<AbstractFactory> pAbstractFactory,
70 void unsubscribe(
const std::string &className);
84 std::shared_ptr<IFunction> createSimple(
const Expression &expr,
85 std::map<std::string, std::string> &parentAttributes)
const;
88 std::shared_ptr<CompositeFunction> createComposite(
const Expression &expr,
89 std::map<std::string, std::string> &parentAttributes)
const;
92 void inputError(
const std::string &str =
"")
const;
94 void addConstraints(
const std::shared_ptr<IFunction> &fun,
const Expression &expr)
const;
96 void addConstraint(
const std::shared_ptr<IFunction> &fun,
const Expression &expr)
const;
98 void addConstraint(
const std::shared_ptr<IFunction> &fun,
const Expression &constraint_expr,
101 void addTies(
const std::shared_ptr<IFunction> &fun,
const Expression &expr)
const;
103 void addTie(
const std::shared_ptr<IFunction> &fun,
const Expression &expr)
const;
115 std::lock_guard<std::mutex> _lock(
m_mutex);
117 const std::string soughtType(
typeid(FunctionType).name());
124 const std::vector<std::string> names = this->
getKeys();
125 std::copy_if(names.cbegin(), names.cend(), std::back_inserter(typeNames), [
this](
const std::string &name) {
126 std::shared_ptr<IFunction> func = this->createFunction(name);
127 return std::dynamic_pointer_cast<FunctionType>(func);
151#define DECLARE_FUNCTION(classname) \
153 Mantid::Kernel::RegistrationHelper \
154 register_function_##classname(((Mantid::API::FunctionFactory::Instance().subscribe<classname>(#classname)), 0)); \
This class represents an expression made up of names, binary operators and brackets.
The FunctionFactory class is in charge of the creation of concrete instances of fitting functions.
~FunctionFactoryImpl() override=default
Private Destructor.
FunctionFactoryImpl(const FunctionFactoryImpl &)=delete
std::shared_ptr< IPeakFunction > createPeakFunction(const Expression &expr, const std::string &name) const
std::vector< std::string > getFunctionNames() const
Query available functions based on the template type.
std::map< std::string, std::vector< std::string > > m_cachedFunctionNames
FunctionFactoryImpl & operator=(const FunctionFactoryImpl &)=delete
This is an interface to a fitting function - a semi-abstarct class.
The dynamic factory is a base dynamic factory for serving up objects in response to requests from oth...
virtual const std::vector< std::string > getKeys() const
Returns the keys in the map.
SubscribeAction
Defines replacement behaviour.
Manage the lifetime of a class intended to be a singleton.
const Poco::AutoPtr< FunctionFactoryUpdateNotification > & FunctionFactoryUpdateNotification_ptr
Convenient typedef for an UpdateNotification AutoPtr.
FunctionFactoryImpl::UpdateNotification FunctionFactoryUpdateNotification
Convenient typedef for an UpdateNotification.
Helper class which provides the Collimation Length for SANS instruments.
Policy class controlling creation of the singleton Implementation classes should mark their default c...