The template-specialized version of a class that creates RobonetDataElement 's to be added to a DataWarehouse of type RobonetDataElement. More...
#include <DataElementFactory.h>
Public Member Functions | |
| DataElementFactory (std::shared_ptr< SMT::SMTClient > client=nullptr) | |
| std::pair< std::string, RobonetDataElementPtr > | fromXml (const std::string &elementName, const std::string &robonetNode, const std::string &xml) |
| This method parses an XML string then creates and returns the corresponding RobonetDataElement and its name. | |
| virtual | ~DataElementFactory () |
Private Attributes | |
| std::shared_ptr< SMT::SMTClient > | smtclient |
| SMTClient to use when making elements. | |
The template-specialized version of a class that creates RobonetDataElement 's to be added to a DataWarehouse of type RobonetDataElement.
Definition at line 71 of file DataElementFactory.h.
| DataElementFactory< RobonetDataElement >::DataElementFactory | ( | std::shared_ptr< SMT::SMTClient > | client = nullptr | ) | [inline] |
Definition at line 78 of file DataElementFactory.h.
| virtual DataElementFactory< RobonetDataElement >::~DataElementFactory | ( | ) | [inline, virtual] |
Definition at line 80 of file DataElementFactory.h.
| std::pair< std::string, RobonetDataElementPtr > DataElementFactory< RobonetDataElement >::fromXml | ( | const std::string & | elementName, |
| const std::string & | robonetNode, | ||
| const std::string & | xml | ||
| ) | [inline] |
This method parses an XML string then creates and returns the corresponding RobonetDataElement and its name.
| xml | The XML string containing the data necessary to create a RobonetDataElement |
| namePrefix | The fully qualified Robonet node this element belongs to |
| MissingXMLElementException | If the XML string was missing a vital element. |
| std::runtime_error | If robonetNode is empty or malformed. |
The XML string needs to be newline-terminated. The offset2 element is not necessary if the type is 16-bits wide. Here are a couple of examples of acceptable XML strings:
<Element id="Torq" type="float" offset1="TorqL" offset2="TorqH" direction="Write" group="Command" style="Normal"/> <Element id="StatReg1" type="uint16_t" offset1="StatReg1" direction="Read" group="Monitor" style="Normal" />
Definition at line 94 of file DataElementFactory.h.
std::shared_ptr<SMT::SMTClient> DataElementFactory< RobonetDataElement >::smtclient [private] |
SMTClient to use when making elements.
Definition at line 76 of file DataElementFactory.h.