ADTF
MappingConfigurationToXMLFactory10< DomNodeType >

Template class to create MappingConfiguration DOM nodes with the help of the type DomNodeType. More...

Public Types

using xml_base_type = MappingConfigurationToXMLFactoryBase< DomNodeType >
 base factory helper type for xml writing
 

Static Public Member Functions

static void createNode (DomNodeType &parent_node, const datamodel::Source &source)
 Create a Node for a source. More...
 
static void resolveFunctionCall (DomNodeType &assignment_node, const datamodel::Assignment &assignment, const std::string &current_target_name, const datamodel::MappingConfiguration::Functions &functions)
 resolve a function call to a version 1.0 valid assignment More...
 
static void createNode (DomNodeType &parent_node, const datamodel::Assignment &assignment, const std::string &current_target_name, const datamodel::MappingConfiguration::Functions &functions)
 Create a Node for an Assignment. More...
 
static void createNode (DomNodeType &parent_node, const datamodel::Trigger &trigger)
 Create a Node for a Trigger. More...
 
static void createNode (DomNodeType &parent_node, const datamodel::Target &target, const datamodel::MappingConfiguration::Functions &functions)
 Create a Node for a Target. More...
 
template<typename PropertiesType >
static void setPropertyAsAttribute (DomNodeType &parent_node, const std::string &name, const PropertiesType &properties, bool is_mandatory)
 Set a Property as attribute if property exists. More...
 
static void setEnumTableNodes (DomNodeType &dom_node, const std::shared_ptr< const datamodel::Property > &prop)
 Set the Enum Table conversion Nodes of mpping 1.0 from the given property. More...
 
static void createNode (DomNodeType &parent_node, const datamodel::Function &function_inst)
 Create a Node for a Module. More...
 
static void createNode (DomNodeType &parent_node, const datamodel::MappingConfiguration &config)
 Create a Node for the config. More...
 

Detailed Description

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

Template class to create MappingConfiguration DOM nodes with the help of the type DomNodeType.

Template Parameters
DomNodeTypeThe type for the DOM Node which must follow the concept of implementing functions:
  • setAttribute(const std::string& name, const std::string& value);
  • DomNodeType& createChild(const std::string& name);
  • setData(const std::string& name, const std::string& data);

Definition at line 158 of file datamodel_xml_configurationtoxml_10.h.

Member Function Documentation

◆ createNode() [1/6]

static void createNode ( DomNodeType &  parent_node,
const datamodel::Assignment assignment,
const std::string &  current_target_name,
const datamodel::MappingConfiguration::Functions functions 
)
inlinestatic

Create a Node for an Assignment.

Parameters
parent_nodethe parent node where to create the node
assignmentthe datamodel of the assignment
current_target_namethe target name the assignment belongs to
functionsthe functions of the configuration

Definition at line 229 of file datamodel_xml_configurationtoxml_10.h.

References Assignment::const_value, Assignment::function_call, Assignment::getConstValue(), Assignment::getName(), Assignment::getSourceValue(), Assignment::getTo(), Assignment::getType(), MappingConfigurationToXMLFactory10< DomNodeType >::resolveFunctionCall(), Assignment::source_value, and ParameterValue::ConstValue::value.

◆ createNode() [2/6]

static void createNode ( DomNodeType &  parent_node,
const datamodel::Function function_inst 
)
inlinestatic

Create a Node for a Module.

Parameters
parent_nodethe parent node where to create the node
function_instthe datamodel of the function

Definition at line 387 of file datamodel_xml_configurationtoxml_10.h.

References Function::getName(), Function::getProperties(), Function::getType(), MappingConfigurationToXMLFactory10< DomNodeType >::setEnumTableNodes(), and MappingConfigurationToXMLFactory10< DomNodeType >::setPropertyAsAttribute().

◆ createNode() [3/6]

static void createNode ( DomNodeType &  parent_node,
const datamodel::MappingConfiguration config 
)
inlinestatic

Create a Node for the config.

Parameters
parent_nodethe parent node where to create the node
configthe datamodel of MappingConfiguration

Definition at line 424 of file datamodel_xml_configurationtoxml_10.h.

References MappingConfigurationToXMLFactory10< DomNodeType >::createNode(), MappingConfiguration::getFunctions(), MappingConfiguration::getSources(), and MappingConfiguration::getTargets().

◆ createNode() [4/6]

static void createNode ( DomNodeType &  parent_node,
const datamodel::Source source 
)
inlinestatic

Create a Node for a source.

Parameters
parent_nodethe parent node where to create the node
sourcethe datamodel of the source

Definition at line 169 of file datamodel_xml_configurationtoxml_10.h.

References Source::getName(), Source::getProperties(), and Source::getType().

Referenced by MappingConfigurationToXMLFactory< DomNodeType >::createNode(), and MappingConfigurationToXMLFactory10< DomNodeType >::createNode().

◆ createNode() [5/6]

static void createNode ( DomNodeType &  parent_node,
const datamodel::Target target,
const datamodel::MappingConfiguration::Functions functions 
)
inlinestatic

Create a Node for a Target.

Parameters
parent_nodethe parent node where to create the node
targetthe datamodel of the target
functionsthe functions of the configuration

Definition at line 295 of file datamodel_xml_configurationtoxml_10.h.

References MappingConfigurationToXMLFactory10< DomNodeType >::createNode(), Target::getAssignments(), Target::getName(), Target::getProperties(), Target::getTriggers(), and Target::getType().

◆ createNode() [6/6]

static void createNode ( DomNodeType &  parent_node,
const datamodel::Trigger trigger 
)
inlinestatic

Create a Node for a Trigger.

Parameters
parent_nodethe parent node where to create the node
triggerthe datamodel of the Trigger

Definition at line 264 of file datamodel_xml_configurationtoxml_10.h.

References Trigger::data, Trigger::period, Trigger::source, and adtf::streaming::ant::trigger().

◆ resolveFunctionCall()

static void resolveFunctionCall ( DomNodeType &  assignment_node,
const datamodel::Assignment assignment,
const std::string &  current_target_name,
const datamodel::MappingConfiguration::Functions functions 
)
inlinestatic

resolve a function call to a version 1.0 valid assignment

Parameters
assignment_nodethe assignment node
assignmentthe assignment
current_target_namethe current target the assignment belongs to
functionsthe functions in config

Definition at line 199 of file datamodel_xml_configurationtoxml_10.h.

References Assignment::getFunctionCall(), ddl::mapping::getMapping10FunctionCallAttributes(), and Assignment::getName().

Referenced by MappingConfigurationToXMLFactory10< DomNodeType >::createNode().

◆ setEnumTableNodes()

static void setEnumTableNodes ( DomNodeType &  dom_node,
const std::shared_ptr< const datamodel::Property > &  prop 
)
inlinestatic

Set the Enum Table conversion Nodes of mpping 1.0 from the given property.

Parameters
dom_nodethe node to set the conversion nodes to
propthe property to convert

Definition at line 363 of file datamodel_xml_configurationtoxml_10.h.

Referenced by MappingConfigurationToXMLFactory10< DomNodeType >::createNode().

◆ setPropertyAsAttribute()

static void setPropertyAsAttribute ( DomNodeType &  parent_node,
const std::string &  name,
const PropertiesType &  properties,
bool  is_mandatory 
)
inlinestatic

Set a Property as attribute if property exists.

Template Parameters
PropertiesType
Parameters
parent_nodethe node to set the attribute to
namethe name of the property and attribute
propertiesthe properties to retrieve the property from
is_mandatoryindicates if the property must exists or not
Exceptions
mapping::Errorif is_mandatory is set and the property was not found

Definition at line 340 of file datamodel_xml_configurationtoxml_10.h.

Referenced by MappingConfigurationToXMLFactory10< DomNodeType >::createNode().