13#include "MantidAPI/DllConfig.h"
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>
43template <
class SingleValueParameterType>
61template <
class SingleValueParameterType>
64 using ValType =
typename SingleValueParameterType::ValueType;
65 std::string typeName = parameterElement->getChildElement(
"Type")->innerText();
66 if (SingleValueParameterType::parameterName() != typeName) {
67 return m_successor->createParameter(parameterElement);
69 std::string sParameterValue = parameterElement->getChildElement(
"Value")->innerText();
70 ValType
value = boost::lexical_cast<ValType>(sParameterValue);
71 return new SingleValueParameterType(
value);
81template <
class SingleValueParameterType>
82SingleValueParameterType *
84 using ValType =
typename SingleValueParameterType::ValueType;
85 std::string typeName = parameterElement->getChildElement(
"Type")->innerText();
86 if (SingleValueParameterType::parameterName() != typeName) {
87 throw std::runtime_error(
"The attempted ::createWithoutDelegation failed. "
88 "The type provided does not match this parser.");
90 std::string sParameterValue = parameterElement->getChildElement(
"Value")->innerText();
91 ValType
value = boost::lexical_cast<ValType>(sParameterValue);
92 return new SingleValueParameterType(
value);
101template <
class SingleValueParameterType>
105 m_successor.swap(temp);
double value
The value of the point.
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.