BeeeOn Gateway
v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
|
Helper defining method for parsing an input stream as an XML input. The purpose is to extract information about type mapping. The class is stateful and represents a single loop over the parsed XML document. More...
#include <XmlTypeMappingParserHelper.h>
Public Member Functions | |
XmlTypeMappingParserHelper (const std::string &mappingGroup, const std::string &techNode, Poco::Logger &logger) | |
void | parseDOM (std::istream &in) |
Parse the given input stream and create its DOM representation internally. | |
std::pair< Poco::AutoPtr < Poco::XML::Node > , ModuleType > | next () |
Helper defining method for parsing an input stream as an XML input. The purpose is to extract information about type mapping. The class is stateful and represents a single loop over the parsed XML document.
The helper expects the following XML structure:
<some-root> ... <some-mapping-group> <map comment="Type xxx"> <TECH-SPEC TECH-ATTR="xxx" /> <beeeon type="temperature,outer"> <map> <map comment="Type yyy"> <TECH-SPEC TECH-ATTR="yyy" /> <beeeon type="humidity"> </map> ... </some-mapping-group> ... </some-root>
The parser does not care about the depth of element <map>
. The <TECH-SPEC />
element is unknown to the helper but it MUST be the previous sibling of the <beeeon>
element. TECH-ATTR
is technology-specific attribute that the parser does not take care of either. The element <beeeon>
specifies the BeeeOn type to map to.
XmlTypeMappingParserHelper::XmlTypeMappingParserHelper | ( | const std::string & | mappingGroup, |
const std::string & | techNode, | ||
Poco::Logger & | logger | ||
) |
techNode | - name of the technology-specific XML element |
logger | - logger to log into |
pair< AutoPtr< Node >, ModuleType > XmlTypeMappingParserHelper::next | ( | ) |
(TECH-SPEC, ModuleType)
. The TECH-SPEC
must be parsed by upper layer. Poco::SyntaxException |