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

Factory to create a MappingConfiguration out of a XML based description. This factory uses a template type DomNodeType which is designed to follow the a concept class type definition of the a_util::DOMElement. More...

#include <datamodel_xml_configurationfromxml_10.h>

Classes

struct  NeedFunctions
 helper structure to create modules for compatibility reason. More...
 

Public Types

using xml_base_type = MappingConfigurationFromXMLFactoryBase<DomNodeType>
 base factory type for xml reading
 

Static Public Member Functions

template<typename T>
static utility::Optional< T > getAttributeMandatory (const DomNodeType &dom_node, const std::string &attribute_name, const std::string &additional_info={})
 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.
 
static datamodel::Source createSource (const DomNodeType &dom_node)
 Create a Source object.
 
static datamodel::Assignment::SourceValue getAsSourceValue (const std::string &variable)
 Get the given string as source value.
 
static utility::Optional< std::string > parseFunctionParameter (const std::string &function_call)
 Parse function call for parameter values.
 
static std::pair< datamodel::Assignment::FunctionCall, std::vector< datamodel::ParameterValue > > createFunctionCall (const std::string &target_name, const std::string &function_attribute, NeedFunctions &need_functions)
 Create a compatibility module call out of function attribute in 1.0.
 
static datamodel::Assignment createAssignment (const DomNodeType &dom_node, const std::string &target_name, NeedFunctions &need_functions)
 Create a Assignment.
 
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)
 Create a Trigger object.
 
static datamodel::Target createTarget (const DomNodeType &dom_node, NeedFunctions &need_functions)
 Create a Target object.
 
static void setOptionalProperty (const DomNodeType &dom_node, const std::string &property_name, datamodel::Function &module_instance)
 Set the Optional Property into the data model of a module.
 
static void setEnumTableProperty (const DomNodeType &dom_node, datamodel::Function &module_inst)
 Set the Enum Table Property from the 1.0 definitions.
 
static datamodel::Function createFunctionFromTransformation (const DomNodeType &dom_node)
 Create a Module object from a tranformation defintion.
 
static datamodel::MappingConfiguration createConfiguration (const DomNodeType &dom_node, const datamodel::Header &header)
 Creates a MappingConfiguration and read all sub node.
 

Static Public Attributes

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

Detailed Description

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

Factory to create a MappingConfiguration out of a XML based description. This factory uses a template type DomNodeType which is designed 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::MappingConfigurationFromXMLFactory10< DomNodeType >::createAssignment ( const DomNodeType & dom_node,
const std::string & target_name,
NeedFunctions & need_functions )
inlinestatic

Create a Assignment.

Parameters
dom_nodethe node to create the Assignment from (should be "assignment" tag name).
target_namethe target name of where the assignment is within
need_functionsthe return value of needed engine or time module
Returns
datamodel::Assignment

◆ createConfiguration()

template<typename DomNodeType>
static datamodel::MappingConfiguration ddl::mapping::MappingConfigurationFromXMLFactory10< DomNodeType >::createConfiguration ( const DomNodeType & dom_node,
const datamodel::Header & header )
inlinestatic

Creates a MappingConfiguration and read all sub node.

Parameters
dom_nodenode to create the MappingConfiguration from.
headerthe header already parsed in the caller
Returns
datamodel::MappingConfiguration

◆ createDataTrigger()

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

◆ createFunctionCall()

template<typename DomNodeType>
static std::pair< datamodel::Assignment::FunctionCall, std::vector< datamodel::ParameterValue > > ddl::mapping::MappingConfigurationFromXMLFactory10< DomNodeType >::createFunctionCall ( const std::string & target_name,
const std::string & function_attribute,
NeedFunctions & need_functions )
inlinestatic

Create a compatibility module call out of function attribute in 1.0.

Parameters
target_namethe target name the assignment and function call is within
function_attributethe function attribute to parse
need_functionsthe return value of needed function
Returns
std::pair<datamodel::Assignment::ModuleCall, std::vector<datamodel::ParameterValue>>

◆ createFunctionFromTransformation()

template<typename DomNodeType>
static datamodel::Function ddl::mapping::MappingConfigurationFromXMLFactory10< DomNodeType >::createFunctionFromTransformation ( const DomNodeType & dom_node)
inlinestatic

Create a Module object from a tranformation defintion.

Parameters
dom_nodethe node to create the Module from (should be "polynomial" or "enum_table" tag name).
Returns
datamodel::Module

◆ createPeriodTrigger()

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

template<typename DomNodeType>
static datamodel::Target ddl::mapping::MappingConfigurationFromXMLFactory10< DomNodeType >::createTarget ( const DomNodeType & dom_node,
NeedFunctions & need_functions )
inlinestatic

Create a Target object.

Parameters
dom_nodethe node to create the Target from (should be "target" tag name).
need_functionsthe return value of needed engine or time funtions
Returns
datamodel::Target

◆ createTrigger()

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

◆ getAsSourceValue()

template<typename DomNodeType>
static datamodel::Assignment::SourceValue ddl::mapping::MappingConfigurationFromXMLFactory10< DomNodeType >::getAsSourceValue ( const std::string & variable)
inlinestatic

Get the given string as source value.

Parameters
variablethe value to parse
Returns
datamodel::Assignment::SourceValue

◆ getAttribute()

template<typename DomNodeType>
template<typename T>
static utility::Optional< T > ddl::mapping::MappingConfigurationFromXMLFactory10< 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::MappingConfigurationFromXMLFactory10< DomNodeType >::getAttributeMandatory ( const DomNodeType & dom_node,
const std::string & attribute_name,
const std::string & additional_info = {} )
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
additional_infoadditional info if not retrieved within the exception
Returns
utility::Optional<T>
Exceptions
throwsmapping::Error if attribute does not exist

◆ parseFunctionParameter()

template<typename DomNodeType>
static utility::Optional< std::string > ddl::mapping::MappingConfigurationFromXMLFactory10< DomNodeType >::parseFunctionParameter ( const std::string & function_call)
inlinestatic

Parse function call for parameter values.

Parameters
function_callthe function call to parse
Returns
utility::Optional<std::string>

◆ setEnumTableProperty()

template<typename DomNodeType>
static void ddl::mapping::MappingConfigurationFromXMLFactory10< DomNodeType >::setEnumTableProperty ( const DomNodeType & dom_node,
datamodel::Function & module_inst )
inlinestatic

Set the Enum Table Property from the 1.0 definitions.

Parameters
dom_nodeThe node of "enum_table" will be converted to the "ddl_enum_table" module
module_instthe module to set the "table" property to

◆ setOptionalProperty()

template<typename DomNodeType>
static void ddl::mapping::MappingConfigurationFromXMLFactory10< DomNodeType >::setOptionalProperty ( const DomNodeType & dom_node,
const std::string & property_name,
datamodel::Function & module_instance )
inlinestatic

Set the Optional Property into the data model of a module.

Parameters
dom_nodethe dom node to parse
property_namethe optional attribute and property name
module_instancethe module to set the property to

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