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 Parser Parser
15#define DECLARE_IMPLICIT_FUNCTION_PARAMETER_PARSER(classname) \
16 namespace { \
17 Mantid::Kernel::RegistrationHelper register_alg_##classname( \
18 ((Mantid::API::ImplicitFunctionParameterParserFactory::Instance().subscribe<classname>(#classname)), 0)); \
19 }
20
21//----------------------------------------------------------------------
22// Includes
23//----------------------------------------------------------------------
24#include <memory>
25#include <vector>
26
27#ifndef Q_MOC_RUN
28#include <boost/interprocess/smart_ptr/unique_ptr.hpp>
29#include <memory>
30#endif
31
33#include "MantidAPI/DllConfig.h"
35
36namespace Poco {
37namespace DOM {
38class Element;
39}
40} // namespace Poco
41
48namespace Mantid {
49namespace API {
50
51/*
52 * Deletion policy for unique pointers.
53 */
54template <typename T> class DLLExport DeleterPolicy {
55public:
56 void operator()(T *pParser) { delete pParser; }
57};
58
59/*
60 * ImplicitFunctionParameterParser definition. Used to parse implicit function
61 * xml.
62 */
63class MANTID_API_DLL ImplicitFunctionParameterParser {
64public:
68 boost::interprocess::unique_ptr<ImplicitFunctionParameterParser, DeleterPolicy<ImplicitFunctionParameterParser>>;
69
70 virtual ImplicitFunctionParameter *createParameter(Poco::XML::Element *parameterElement) = 0;
73
74protected:
76};
77} // namespace API
78} // namespace Mantid
#define DLLExport
Definitions of the DLLImport compiler directives for MSVC.
Definition: System.h:53
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.
Definition: Algorithm.h:30