Dev Essential  1.6.3
Loading...
Searching...
No Matches
ddl::mapping::MappingConfigurationFromXMLFactory< DomNodeType > Struct Template Reference

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. More...

#include <datamodel_xml_configurationfromxml.h>

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.
 
template<typename T>
static utility::Optional< T > getAttribute (const DomNodeType &dom_node, const std::string &attribute_name)
 Get the attribute.
 
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.
 
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.
 
static datamodel::Header createHeader (const DomNodeType &dom_node, const Version &version)
 Create a Header object.
 
template<typename PropertiesType>
static void setDataOrSubNodesAsProperty (const DomNodeType &dom_node, PropertiesType &properties)
 Set the Data Or Sub Nodes As Property.
 
static datamodel::Source createSource (const DomNodeType &dom_node)
 Create a Source object.
 
static datamodel::ParameterValue createParameterValue (const DomNodeType &dom_node)
 Create a ParameterValue object.
 
static datamodel::Assignment createAssignment (const DomNodeType &dom_node)
 Create a Assignment object.
 
static datamodel::Trigger createPeriodTrigger (const DomNodeType &dom_node)
 Create a Trigger object as Trigger(Period)
 
static datamodel::Trigger createDataTrigger (const DomNodeType &dom_node)
 Create a Trigger object as Trigger(Data)
 
static datamodel::Trigger createSourceTrigger (const DomNodeType &dom_node)
 Create a Trigger object as Trigger(Source)
 
static datamodel::Trigger createTrigger (const DomNodeType &dom_node, const Version &version)
 Create a Trigger object.
 
static datamodel::Trigger createTrigger (const DomNodeType &dom_node)
 Create a Trigger object.
 
static datamodel::Target createTarget (const DomNodeType &dom_node, const Version &version)
 Create a Target object.
 
static datamodel::Target createTarget (const DomNodeType &dom_node)
 Create a Target object.
 
static datamodel::Function createFunction (const DomNodeType &dom_node)
 Create a Function.
 
static datamodel::MappingConfiguration createConfiguration (const DomNodeType &dom_node, const Version &mapping_version=Version::getLatestVersion())
 Creates a MappingConfiguration and read all sub node.
 

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;

Member Function Documentation

◆ createAssignment()

template<typename DomNodeType>
static datamodel::Assignment ddl::mapping::MappingConfigurationFromXMLFactory< DomNodeType >::createAssignment ( const DomNodeType & dom_node)
inlinestatic

Create a Assignment object.

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

◆ createConfiguration()

template<typename DomNodeType>
static datamodel::MappingConfiguration ddl::mapping::MappingConfigurationFromXMLFactory< DomNodeType >::createConfiguration ( const DomNodeType & dom_node,
const Version & mapping_version = Version::getLatestVersion() )
inlinestatic

Creates a MappingConfiguration and read all sub node.

Parameters
dom_nodenode to create the MappingConfiguration from.
mapping_versionforced language version if no header-tag or language-version is found within the dom_node
Returns
datamodel::MappingConfiguration

◆ createDataTrigger()

template<typename DomNodeType>
static datamodel::Trigger ddl::mapping::MappingConfigurationFromXMLFactory< DomNodeType >::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

◆ createFunction()

template<typename DomNodeType>
static datamodel::Function ddl::mapping::MappingConfigurationFromXMLFactory< DomNodeType >::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

◆ createHeader()

template<typename DomNodeType>
static datamodel::Header ddl::mapping::MappingConfigurationFromXMLFactory< DomNodeType >::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

◆ createParameterValue()

template<typename DomNodeType>
static datamodel::ParameterValue ddl::mapping::MappingConfigurationFromXMLFactory< DomNodeType >::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

◆ createPeriodTrigger()

template<typename DomNodeType>
static datamodel::Trigger ddl::mapping::MappingConfigurationFromXMLFactory< DomNodeType >::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

◆ createSource()

template<typename DomNodeType>
static datamodel::Source ddl::mapping::MappingConfigurationFromXMLFactory< DomNodeType >::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

◆ createSourceTrigger()

template<typename DomNodeType>
static datamodel::Trigger ddl::mapping::MappingConfigurationFromXMLFactory< DomNodeType >::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

◆ createTarget() [1/2]

template<typename DomNodeType>
static datamodel::Target ddl::mapping::MappingConfigurationFromXMLFactory< DomNodeType >::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

◆ createTarget() [2/2]

template<typename DomNodeType>
static datamodel::Target ddl::mapping::MappingConfigurationFromXMLFactory< DomNodeType >::createTarget ( const DomNodeType & dom_node,
const Version & version )
inlinestatic

Create a Target object.

Parameters
dom_nodethe node to create the Target from (should be "target" tag name).
versionMapping Version of the current parsed xml content
Returns
datamodel::Target

◆ createTrigger() [1/2]

template<typename DomNodeType>
static datamodel::Trigger ddl::mapping::MappingConfigurationFromXMLFactory< DomNodeType >::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

◆ createTrigger() [2/2]

template<typename DomNodeType>
static datamodel::Trigger ddl::mapping::MappingConfigurationFromXMLFactory< DomNodeType >::createTrigger ( const DomNodeType & dom_node,
const Version & version )
inlinestatic

Create a Trigger object.

Parameters
dom_nodethe node to create the Trigger from (should be "trigger" tag name).
versionMapping Version of the current parsed xml content
Returns
datamodel::Trigger

◆ getAttribute()

template<typename DomNodeType>
template<typename T>
static utility::Optional< T > ddl::mapping::MappingConfigurationFromXMLFactory< DomNodeType >::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>

◆ getAttributeMandatory()

template<typename DomNodeType>
template<typename T>
static utility::Optional< T > ddl::mapping::MappingConfigurationFromXMLFactory< DomNodeType >::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

◆ getDataSubNode()

template<typename DomNodeType>
template<typename T>
static utility::Optional< T > ddl::mapping::MappingConfigurationFromXMLFactory< DomNodeType >::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>

◆ getDataSubNodeMandatory()

template<typename DomNodeType>
template<typename T>
static utility::Optional< T > ddl::mapping::MappingConfigurationFromXMLFactory< DomNodeType >::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

◆ setDataOrSubNodesAsProperty()

template<typename DomNodeType>
template<typename PropertiesType>
static void ddl::mapping::MappingConfigurationFromXMLFactory< DomNodeType >::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

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