15#include <Poco/DOM/DOMParser.h>
16#include <Poco/DOM/Document.h>
17#include <Poco/DOM/Element.h>
18#include <Poco/DOM/NodeFilter.h>
19#include <Poco/DOM/NodeIterator.h>
20#include <Poco/DOM/NodeList.h>
27#include <boost/lexical_cast.hpp>
40template <
class SingleValueParameterType>
45 SingleValueParameterType *createWithoutDelegation(Poco::XML::Element *parameterElement);
58template <
class SingleValueParameterType>
61 using ValType =
typename SingleValueParameterType::ValueType;
62 std::string typeName = parameterElement->getChildElement(
"Type")->innerText();
63 if (SingleValueParameterType::parameterName() != typeName) {
64 return m_successor->createParameter(parameterElement);
66 std::string sParameterValue = parameterElement->getChildElement(
"Value")->innerText();
67 ValType
value = boost::lexical_cast<ValType>(sParameterValue);
68 return new SingleValueParameterType(
value);
78template <
class SingleValueParameterType>
79SingleValueParameterType *
81 using ValType =
typename SingleValueParameterType::ValueType;
82 std::string typeName = parameterElement->getChildElement(
"Type")->innerText();
83 if (SingleValueParameterType::parameterName() != typeName) {
84 throw std::runtime_error(
"The attempted ::createWithoutDelegation failed. "
85 "The type provided does not match this parser.");
87 std::string sParameterValue = parameterElement->getChildElement(
"Value")->innerText();
88 ValType
value = boost::lexical_cast<ValType>(sParameterValue);
89 return new SingleValueParameterType(
value);
98template <
class SingleValueParameterType>
102 m_successor.swap(temp);
double value
The value of the point.
#define DLLExport
Definitions of the DLLImport compiler directives for MSVC.
boost::interprocess::unique_ptr< ImplicitFunctionParameterParser, DeleterPolicy< ImplicitFunctionParameterParser > > SuccessorType
Successor type.
Abstract parameter type for use with IImplicitFunctions.
XML Parser for single value parameter types.
SingleValueParameterType * createWithoutDelegation(Poco::XML::Element *parameterElement)
void setSuccessorParser(Mantid::API::ImplicitFunctionParameterParser *paramParser) override
Mantid::API::ImplicitFunctionParameter * createParameter(Poco::XML::Element *parameterElement) override
Helper class which provides the Collimation Length for SANS instruments.