ADTF
MappingConfigurationFromXMLFactory< DomNodeType >

Factory to create a MappingConfiguration out of a XML based description. More...

Public Types

using xml_base_type = MappingConfigurationFromXMLFactoryBase< DomNodeType >
 base factory type for xml reading
 
using xml_mapping10_type = MappingConfigurationFromXMLFactory10< DomNodeType >
 mapping10 xml reading factory type for compatibility of mapping 1.0 definition
 

Static Public Member Functions

template<typename T >
static utility::Optional< T > getAttributeMandatory (const DomNodeType &dom_node, const std::string &attribute_name)
 Get the mandatory attribute helper function. More...
 
template<typename T >
static utility::Optional< T > getAttribute (const DomNodeType &dom_node, const std::string &attribute_name)
 Get the attribute. More...
 
template<typename T >
static utility::Optional< T > getDataSubNodeMandatory (const DomNodeType &dom_node, const std::string &tag_name, const std::string &additional_info={})
 Get the mandatory sub node data helper function. More...
 
template<typename T >
static utility::Optional< T > getDataSubNode (const DomNodeType &dom_node, const std::string &tag_name)
 Get the mandatory sub node data helper function. More...
 
static datamodel::Header createHeader (const DomNodeType &dom_node, const Version &version)
 Create a Header object. More...
 
template<typename PropertiesType >
static void setDataOrSubNodesAsProperty (const DomNodeType &dom_node, PropertiesType &properties)
 Set the Data Or Sub Nodes As Property. More...
 
static datamodel::Source createSource (const DomNodeType &dom_node)
 Create a Source object. More...
 
static datamodel::ParameterValue createParameterValue (const DomNodeType &dom_node)
 Create a ParameterValue object. More...
 
static datamodel::Assignment createAssignment (const DomNodeType &dom_node)
 Create a Assignment object. More...
 
static datamodel::Trigger createPeriodTrigger (const DomNodeType &dom_node)
 Create a Trigger object as Trigger(Period) More...
 
static datamodel::Trigger createDataTrigger (const DomNodeType &dom_node)
 Create a Trigger object as Trigger(Data) More...
 
static datamodel::Trigger createSourceTrigger (const DomNodeType &dom_node)
 Create a Trigger object as Trigger(Source) More...
 
static datamodel::Trigger createTrigger (const DomNodeType &dom_node, const Version &version)
 Create a Trigger object. More...
 
static datamodel::Trigger createTrigger (const DomNodeType &dom_node)
 Create a Trigger object. More...
 
static datamodel::Target createTarget (const DomNodeType &dom_node, const Version &version)
 Create a Target object. More...
 
static datamodel::Target createTarget (const DomNodeType &dom_node)
 Create a Target object. More...
 
static datamodel::Function createFunction (const DomNodeType &dom_node)
 Create a Function. More...
 
static datamodel::MappingConfiguration createConfiguration (const DomNodeType &dom_node, const Version &mapping_version=Version::getLatestVersion())
 Creates a MappingConfiguration and read all sub node. More...
 

Static Public Attributes

static constexpr auto mapping_reading_version = "Mapping20::"
 Error message definition string.
 

Detailed Description

template<typename DomNodeType>
struct ddl::mapping::MappingConfigurationFromXMLFactory< DomNodeType >

Factory to create a MappingConfiguration out of a XML based description.

This factory uses a template type DomNodeType which is design to follow the a concept class type definition of the a_util::DOMElement.

Template Parameters
DomNodeTypea DOMElement class must implement following funtions:
  • string getAttribute(const std::string& name) const;
  • string getData() const;
  • bool findNode(const std::string& node_name, DomNodeType& result_node) const;
  • bool findNodes(const std::string& node_names, std::list<DomNodeType>& result_nodes) const;

Definition at line 41 of file datamodel_xml_configurationfromxml.h.

Member Function Documentation

◆ createAssignment()

static datamodel::Assignment createAssignment ( const DomNodeType &  dom_node)
inlinestatic

◆ createConfiguration()

◆ createDataTrigger()

static datamodel::Trigger createDataTrigger ( const DomNodeType &  dom_node)
inlinestatic

Create a Trigger object as Trigger(Data)

Parameters
dom_nodethe node to create the Trigger from (should be "trigger" tag name).
Returns
datamodel::Trigger

Definition at line 288 of file datamodel_xml_configurationfromxml.h.

Referenced by MappingConfigurationFromXMLFactory< DomNodeType >::createTrigger().

◆ createFunction()

static datamodel::Function createFunction ( const DomNodeType &  dom_node)
inlinestatic

Create a Function.

Parameters
dom_nodethe node to create the function from (should be "function" tag name).
Returns
datamodel::Function

Definition at line 415 of file datamodel_xml_configurationfromxml.h.

References Function::getProperties(), and MappingConfigurationFromXMLFactory< DomNodeType >::setDataOrSubNodesAsProperty().

Referenced by MappingConfigurationFromXMLFactory< DomNodeType >::createConfiguration().

◆ createHeader()

static datamodel::Header createHeader ( const DomNodeType &  dom_node,
const Version version 
)
inlinestatic

Create a Header object.

Parameters
dom_nodethe node to create the header from (should be "header" tag name).
versionmapping version to use if no "language_version" attribute is found
Returns
datamodel::Header

Definition at line 133 of file datamodel_xml_configurationfromxml.h.

References VersionConversion::fromString(), Header::setAuthor(), Header::setDateChange(), Header::setDateCreation(), Header::setDescription(), and Header::setMappingVersion().

Referenced by MappingConfigurationFromXMLFactory< DomNodeType >::createConfiguration().

◆ createParameterValue()

static datamodel::ParameterValue createParameterValue ( const DomNodeType &  dom_node)
inlinestatic

Create a ParameterValue object.

Parameters
dom_nodethe node to create the ParameterValue from (should be "parameter_value" tag name).
Returns
datamodel::ParameterValue

Definition at line 202 of file datamodel_xml_configurationfromxml.h.

Referenced by MappingConfigurationFromXMLFactory< DomNodeType >::createAssignment().

◆ createPeriodTrigger()

static datamodel::Trigger createPeriodTrigger ( const DomNodeType &  dom_node)
inlinestatic

Create a Trigger object as Trigger(Period)

Parameters
dom_nodethe node to create the Trigger from (should be "trigger" tag name).
Returns
datamodel::Trigger

Definition at line 274 of file datamodel_xml_configurationfromxml.h.

Referenced by MappingConfigurationFromXMLFactory< DomNodeType >::createTrigger().

◆ createSource()

static datamodel::Source createSource ( const DomNodeType &  dom_node)
inlinestatic

Create a Source object.

Parameters
dom_nodethe node to create the Source from (should be "source" tag name).
Returns
datamodel::Source

Definition at line 180 of file datamodel_xml_configurationfromxml.h.

References Source::getProperties(), and MappingConfigurationFromXMLFactory< DomNodeType >::setDataOrSubNodesAsProperty().

Referenced by MappingConfigurationFromXMLFactory< DomNodeType >::createConfiguration().

◆ createSourceTrigger()

static datamodel::Trigger createSourceTrigger ( const DomNodeType &  dom_node)
inlinestatic

Create a Trigger object as Trigger(Source)

Parameters
dom_nodethe node to create the Trigger from (should be "trigger" tag name).
Returns
datamodel::Trigger

Definition at line 307 of file datamodel_xml_configurationfromxml.h.

Referenced by MappingConfigurationFromXMLFactory< DomNodeType >::createTrigger().

◆ createTarget() [1/2]

static datamodel::Target createTarget ( const DomNodeType &  dom_node)
inlinestatic

Create a Target object.

Parameters
dom_nodethe node to create the Target from (should be "target" tag name).
Returns
datamodel::Target
Remarks
this function stays there for binary compatibility

Definition at line 405 of file datamodel_xml_configurationfromxml.h.

References MappingConfigurationFromXMLFactory< DomNodeType >::createTarget().

◆ createTarget() [2/2]

◆ createTrigger() [1/2]

static datamodel::Trigger createTrigger ( const DomNodeType &  dom_node)
inlinestatic

Create a Trigger object.

Parameters
dom_nodethe node to create the Trigger from (should be "trigger" tag name).
Returns
datamodel::Trigger
Remarks
this function stays there for binary compatibility

Definition at line 355 of file datamodel_xml_configurationfromxml.h.

References MappingConfigurationFromXMLFactory< DomNodeType >::createTrigger().

◆ createTrigger() [2/2]

static datamodel::Trigger createTrigger ( const DomNodeType &  dom_node,
const Version version 
)
inlinestatic

◆ getAttribute()

static utility::Optional<T> getAttribute ( const DomNodeType &  dom_node,
const std::string &  attribute_name 
)
inlinestatic

Get the attribute.

Template Parameters
Tthe type to retrieve
Parameters
dom_nodethe node where the attribute may be retrieved fron
attribute_namethe attribute name
Returns
utility::Optional<T>

Definition at line 84 of file datamodel_xml_configurationfromxml.h.

◆ getAttributeMandatory()

static utility::Optional<T> getAttributeMandatory ( const DomNodeType &  dom_node,
const std::string &  attribute_name 
)
inlinestatic

Get the mandatory attribute helper function.

Template Parameters
Tthe type to retrieve
Parameters
dom_nodethe node where the attribute may be retrieved fron
attribute_namethe attribute name
Returns
utility::Optional<T>
Exceptions
throwsmapping::Error if attribute does not exist

Definition at line 64 of file datamodel_xml_configurationfromxml.h.

References MappingConfigurationFromXMLFactory< DomNodeType >::mapping_reading_version.

◆ getDataSubNode()

static utility::Optional<T> getDataSubNode ( const DomNodeType &  dom_node,
const std::string &  tag_name 
)
inlinestatic

Get the mandatory sub node data helper function.

Template Parameters
Tthe type to retrieve
Parameters
dom_nodethe node where the attribute may be retrieved fron
tag_namethe tag name
Returns
utility::Optional<T>

Definition at line 121 of file datamodel_xml_configurationfromxml.h.

◆ getDataSubNodeMandatory()

static utility::Optional<T> getDataSubNodeMandatory ( const DomNodeType &  dom_node,
const std::string &  tag_name,
const std::string &  additional_info = {} 
)
inlinestatic

Get the mandatory sub node data helper function.

Template Parameters
Tthe type to retrieve
Parameters
dom_nodethe node where the attribute may be retrieved fron
tag_namethe tag name
additional_infoadditional info if not retrieved within the exception
Returns
utility::Optional<T>
Exceptions
throwsmapping::Error if attribute does not exist

Definition at line 100 of file datamodel_xml_configurationfromxml.h.

◆ setDataOrSubNodesAsProperty()

static void setDataOrSubNodesAsProperty ( const DomNodeType &  dom_node,
PropertiesType &  properties 
)
inlinestatic

Set the Data Or Sub Nodes As Property.

Template Parameters
PropertiesTypethe type for properties to set the properties to
Parameters
dom_nodethe "properties" node to read the values from
propertiesthe properties collection to set the found properties to

Definition at line 168 of file datamodel_xml_configurationfromxml.h.

Referenced by MappingConfigurationFromXMLFactory< DomNodeType >::createFunction(), MappingConfigurationFromXMLFactory< DomNodeType >::createSource(), and MappingConfigurationFromXMLFactory< DomNodeType >::createTarget().