BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
Public Member Functions
BeeeOn::XmlTypeMappingParserHelper Class Reference

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>

Inheritance diagram for BeeeOn::XmlTypeMappingParserHelper:
BeeeOn::Loggable

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 ()
 

Detailed Description

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.

Constructor & Destructor Documentation

XmlTypeMappingParserHelper::XmlTypeMappingParserHelper ( const std::string &  mappingGroup,
const std::string &  techNode,
Poco::Logger &  logger 
)
Parameters
techNode- name of the technology-specific XML element
logger- logger to log into

Member Function Documentation

pair< AutoPtr< Node >, ModuleType > XmlTypeMappingParserHelper::next ( )
Returns
the next available pair (TECH-SPEC, ModuleType). The TECH-SPEC must be parsed by upper layer.
Exceptions
Poco::SyntaxException

The documentation for this class was generated from the following files: