Public Member Functions | Private Attributes
DataElementFactory< RobonetDataElement > Class Template Reference

The template-specialized version of a class that creates RobonetDataElement 's to be added to a DataWarehouse of type RobonetDataElement. More...

#include <DataElementFactory.h>

List of all members.

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.

Detailed Description

template<>
class DataElementFactory< RobonetDataElement >

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.


Constructor & Destructor Documentation

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.


Member Function Documentation

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.

Parameters:
xmlThe XML string containing the data necessary to create a RobonetDataElement
namePrefixThe fully qualified Robonet node this element belongs to
Returns:
std::pair< std::string, boost::shared_ptr<RobonetDataElement> > The corresponding RobonetDataElement and its name.
Exceptions:
MissingXMLElementExceptionIf the XML string was missing a vital element.
std::runtime_errorIf 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.


Member Data Documentation

std::shared_ptr<SMT::SMTClient> DataElementFactory< RobonetDataElement >::smtclient [private]

SMTClient to use when making elements.

Definition at line 76 of file DataElementFactory.h.


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


robot_instance
Author(s):
autogenerated on Sat Jun 8 2019 20:43:12