9#include <Poco/DOM/DOMParser.h>
10#include <Poco/DOM/Document.h>
11#include <Poco/DOM/Element.h>
12#include <Poco/DOM/NodeList.h>
18 throw std::runtime_error(
"Use of create in this context is forbidden. Use "
19 "createUnwrappedInstead.");
24 const std::string &name = functionElement->localName();
25 if (name !=
"Function") {
26 throw std::runtime_error(
"Root node must be a Funtion element. Unable to determine parsers.");
29 Poco::XML::Element *typeElement = functionElement->getChildElement(
"Type");
30 std::string functionParserName = typeElement->innerText() +
"Parser";
33 Poco::XML::Element *parametersElement = functionElement->getChildElement(
"ParameterList");
42 Poco::AutoPtr<Poco::XML::NodeList> childFunctions = functionElement->getElementsByTagName(
"Function");
44 for (
unsigned long i = 0; i < childFunctions->length(); i++) {
49 childParser = tempParser;
56 childParser = tempParser;
60 return functionParser;
67 AutoPtr<Document> pDoc = pParser.parseString(functionXML);
68 Element *pRootElem = pDoc->documentElement();
#define UNUSED_ARG(x)
Function arguments are sometimes unused in certain implmentations but are required for documentation ...
ImplicitFunctionParser * createImplicitFunctionParserFromXML(const std::string &functionXML) const
std::shared_ptr< ImplicitFunctionParser > create(const std::string &xmlString) const override
Creates a new instance of the class with the given name.
XML Parser for function types.
virtual void setParameterParser(ImplicitFunctionParameterParser *parser)=0
virtual void setSuccessorParser(ImplicitFunctionParser *parser)=0
virtual ImplicitFunctionParser * createUnwrapped(const std::string &className) const
Creates a new instance of the class with the given name, which is not wrapped in a boost shared_ptr.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...