Mantid
Loading...
Searching...
No Matches
ComponentParser.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2011 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
10#include "MantidKernel/System.h"
11#include <Poco/DOM/NamedNodeMap.h>
12#include <Poco/SAX/Attributes.h>
13#include <Poco/SAX/ContentHandler.h>
14
15namespace Mantid {
16namespace Geometry {
17
24class MANTID_GEOMETRY_DLL ComponentParser : public Poco::XML::ContentHandler {
25public:
27 void startElement(const Poco::XML::XMLString &, const Poco::XML::XMLString &localName, const Poco::XML::XMLString &,
28 const Poco::XML::Attributes &attr) override;
30 void endElement(const Poco::XML::XMLString &, const Poco::XML::XMLString &localName,
31 const Poco::XML::XMLString &) override;
32
33 void characters(const Poco::XML::XMLChar[], int, int) override;
34
35 Component *getComponent();
36
37 size_t size() const { return m_current.size(); }
38
39 // These functions must be present as they are abstract in the base class.
40 // They are not used them here.
42 void startDocument() override {}
43 void setDocumentLocator(const Poco::XML::Locator *) override {}
44 void endDocument() override {}
45 void ignorableWhitespace(const Poco::XML::XMLChar[], int, int) override {}
46 void processingInstruction(const Poco::XML::XMLString &, const Poco::XML::XMLString &) override {}
47 void startPrefixMapping(const Poco::XML::XMLString &, const Poco::XML::XMLString &) override {}
48 void endPrefixMapping(const Poco::XML::XMLString &) override {}
49 void skippedEntity(const Poco::XML::XMLString &) override {}
50
51private:
54 std::vector<Component *> m_current;
55
56 std::string m_innerText;
57};
58} // namespace Geometry
59} // namespace Mantid
This class implements the Poco SAX ContentHandler class for reading component XML.
void skippedEntity(const Poco::XML::XMLString &) override
Not used.
void endDocument() override
Not used.
std::vector< Component * > m_current
The components currently being built up.
void startDocument() override
Signals start of XML document.
void setDocumentLocator(const Poco::XML::Locator *) override
Not used.
void startPrefixMapping(const Poco::XML::XMLString &, const Poco::XML::XMLString &) override
Not used.
void ignorableWhitespace(const Poco::XML::XMLChar[], int, int) override
Not used.
void processingInstruction(const Poco::XML::XMLString &, const Poco::XML::XMLString &) override
Not used.
void endPrefixMapping(const Poco::XML::XMLString &) override
Not used.
Component is a wrapper for a Component which can modify some of its parameters, e....
Definition: Component.h:41
Helper class which provides the Collimation Length for SANS instruments.