Mantid
Loading...
Searching...
No Matches
ImplicitFunctionParameterParser.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2010 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/* Used to register classes into the factory. creates a global object in an
10 * anonymous namespace. The object itself does nothing, but the comma operator
11 * is used in the call to its constructor to effect a call to the factory's
12 * subscribe method.
13 */
14#define DECLARE_IMPLICIT_FUNCTION_PARAMETER_PARSER(classname) \
15 namespace { \
16 Mantid::Kernel::RegistrationHelper register_alg_##classname( \
17 ((Mantid::API::ImplicitFunctionParameterParserFactory::Instance().subscribe<classname>(#classname)), 0)); \
18 }
19
20//----------------------------------------------------------------------
21// Includes
22//----------------------------------------------------------------------
23#include <memory>
24#include <vector>
25
26#ifndef Q_MOC_RUN
27#include <boost/interprocess/smart_ptr/unique_ptr.hpp>
28#include <memory>
29#endif
30
32#include "MantidAPI/DllConfig.h"
34
35namespace Poco {
36namespace DOM {
37class Element;
38}
39} // namespace Poco
40
47namespace Mantid {
48namespace API {
49
50/*
51 * Deletion policy for unique pointers.
52 */
53// clang-format off
54template <typename T> class DLLExport DeleterPolicy{
55public:
56 void operator()(T *pParser){ delete pParser; }
57};
58// clang-format on
59
60/*
61 * ImplicitFunctionParameterParser definition. Used to parse implicit function
62 * xml.
63 */
64class MANTID_API_DLL ImplicitFunctionParameterParser {
65public:
69 boost::interprocess::unique_ptr<ImplicitFunctionParameterParser, DeleterPolicy<ImplicitFunctionParameterParser>>;
70
71 virtual ImplicitFunctionParameter *createParameter(Poco::XML::Element *parameterElement) = 0;
74
75protected:
77};
78} // namespace API
79} // namespace Mantid
#define DLLExport
Definitions of the DLLImport compiler directives for MSVC.
Definition System.h:37
boost::interprocess::unique_ptr< ImplicitFunctionParameterParser, DeleterPolicy< ImplicitFunctionParameterParser > > SuccessorType
Successor type.
virtual void setSuccessorParser(ImplicitFunctionParameterParser *paramParser)=0
virtual ImplicitFunctionParameter * createParameter(Poco::XML::Element *parameterElement)=0
Abstract parameter type for use with IImplicitFunctions.
Helper class which provides the Collimation Length for SANS instruments.