ADTF
DDToXMLFactory< DOM_NODE_TYPE >

Template class to create DD DOM nodes with the help of the type DOM_NODE_TYPE. More...

Static Public Member Functions

template<typename T >
static bool setOptionalAttribute (DOM_NODE_TYPE &dom_node, const char *attribute_name, const utility::Optional< T > &value)
 Set the Optional Attribute. More...
 
static bool setOptionalAttribute (DOM_NODE_TYPE &dom_node, const char *attribute_name, const std::string &value)
 Set the Optional Attribute. More...
 
static void setData (DOM_NODE_TYPE &dom_node, const std::string &sub_node_name, const std::string &value)
 Set the data of the new created tag with the name sub_node_name. More...
 
static void createNode (DOM_NODE_TYPE &parent_node, const datamodel::Header &header)
 Create a Node for the header. More...
 
static void createNode (DOM_NODE_TYPE &parent_node, const datamodel::BaseUnit &base_unit)
 Create a Node for the base_unit. More...
 
static void createNode (DOM_NODE_TYPE &parent_node, const datamodel::UnitPrefix &unit_prefix)
 Create a Node for the unit_prefix. More...
 
static void createNode (DOM_NODE_TYPE &parent_node, const datamodel::Unit &unit)
 Create a Node for the unit. More...
 
static void createNode (DOM_NODE_TYPE &parent_node, const datamodel::DataType &data_type, const Version &file_ddl_version)
 Create a Node for the data_type. More...
 
static void createNode (DOM_NODE_TYPE &parent_node, const datamodel::EnumType &enum_type)
 Create a Node for the enum_type. More...
 
static void createNode (DOM_NODE_TYPE &parent_node, const datamodel::StructType::Element &element, const Version &file_ddl_version)
 Create a Node for the struct_type element. More...
 
static void createNode (DOM_NODE_TYPE &parent_node, const datamodel::StructType &struct_type, const Version &file_ddl_version)
 Create a Node for the struct_type. More...
 
static void createNode (DOM_NODE_TYPE &parent_node, const datamodel::StreamMetaType &stream_meta_type)
 Create a Node for the stream_meta_type. More...
 
static void createNode (DOM_NODE_TYPE &parent_node, const datamodel::Stream &stream)
 Create a Node for the stream. More...
 
static void createNode (DOM_NODE_TYPE &parent_node, const datamodel::DataDefinition &dd)
 Create a Node for the DD. More...
 

Detailed Description

template<typename DOM_NODE_TYPE>
struct ddl::dd::DDToXMLFactory< DOM_NODE_TYPE >

Template class to create DD DOM nodes with the help of the type DOM_NODE_TYPE.

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

Definition at line 38 of file xml_ddtoxml_factory.h.

Member Function Documentation

◆ createNode() [1/11]

static void createNode ( DOM_NODE_TYPE &  parent_node,
const datamodel::BaseUnit base_unit 
)
inlinestatic

Create a Node for the base_unit.

Parameters
parent_nodethe parent node where to create the node
base_unitthe datamodel of the base_unit

Definition at line 126 of file xml_ddtoxml_factory.h.

References ddl::dd::base_unit.

◆ createNode() [2/11]

◆ createNode() [3/11]

static void createNode ( DOM_NODE_TYPE &  parent_node,
const datamodel::DataType data_type,
const Version file_ddl_version 
)
inlinestatic

Create a Node for the data_type.

Parameters
parent_nodethe parent node where to create the node
data_typethe datamodel of the unit
file_ddl_versionthe file version (this influence some attribute names and content)

Definition at line 178 of file xml_ddtoxml_factory.h.

References ddl::dd::data_type, DDToXMLFactory< DOM_NODE_TYPE >::setOptionalAttribute(), and A_UTILS_NS::to_string().

◆ createNode() [4/11]

static void createNode ( DOM_NODE_TYPE &  parent_node,
const datamodel::EnumType enum_type 
)
inlinestatic

Create a Node for the enum_type.

Parameters
parent_nodethe parent node where to create the node
enum_typethe datamodel of enum_type

Definition at line 210 of file xml_ddtoxml_factory.h.

References ddl::dd::enum_type.

◆ createNode() [5/11]

static void createNode ( DOM_NODE_TYPE &  parent_node,
const datamodel::Header header 
)
inlinestatic

Create a Node for the header.

Parameters
parent_nodethe parent node where to create the node
headerthe datamodel of the header

Definition at line 103 of file xml_ddtoxml_factory.h.

References Header::getAuthor(), Header::getDateChange(), Header::getDateCreation(), Header::getDescription(), Header::getExtDeclarations(), Header::getLanguageVersion(), DDToXMLFactory< DOM_NODE_TYPE >::setData(), and VersionConversion::toString().

Referenced by DDToXMLFactory< DOM_NODE_TYPE >::createNode().

◆ createNode() [6/11]

static void createNode ( DOM_NODE_TYPE &  parent_node,
const datamodel::Stream stream 
)
inlinestatic

Create a Node for the stream.

Parameters
parent_nodethe parent node where to create the node
streamthe datamodel of stream

Definition at line 346 of file xml_ddtoxml_factory.h.

References Stream::getDescription(), Stream::getName(), Stream::getStreamTypeName(), Stream::getStructs(), DDToXMLFactory< DOM_NODE_TYPE >::setOptionalAttribute(), and A_UTILS_NS::to_string().

◆ createNode() [7/11]

static void createNode ( DOM_NODE_TYPE &  parent_node,
const datamodel::StreamMetaType stream_meta_type 
)
inlinestatic

Create a Node for the stream_meta_type.

Parameters
parent_nodethe parent node where to create the node
stream_meta_typethe datamodel of stream_meta_type

Definition at line 324 of file xml_ddtoxml_factory.h.

References DDToXMLFactory< DOM_NODE_TYPE >::setOptionalAttribute(), and ddl::dd::stream_meta_type.

◆ createNode() [8/11]

static void createNode ( DOM_NODE_TYPE &  parent_node,
const datamodel::StructType struct_type,
const Version file_ddl_version 
)
inlinestatic

Create a Node for the struct_type.

Parameters
parent_nodethe parent node where to create the node
struct_typethe datamodel of struct_type
file_ddl_versionthe file version (this influence some attribute names and content)

Definition at line 298 of file xml_ddtoxml_factory.h.

References DDToXMLFactory< DOM_NODE_TYPE >::createNode(), DDToXMLFactory< DOM_NODE_TYPE >::setOptionalAttribute(), ddl::dd::struct_type, and VersionConversion::toString().

◆ createNode() [9/11]

◆ createNode() [10/11]

static void createNode ( DOM_NODE_TYPE &  parent_node,
const datamodel::Unit unit 
)
inlinestatic

Create a Node for the unit.

Parameters
parent_nodethe parent node where to create the node
unitthe datamodel of the unit

Definition at line 155 of file xml_ddtoxml_factory.h.

References DDToXMLFactory< DOM_NODE_TYPE >::setData(), A_UTILS_NS::to_string(), and ddl::dd::unit.

◆ createNode() [11/11]

static void createNode ( DOM_NODE_TYPE &  parent_node,
const datamodel::UnitPrefix unit_prefix 
)
inlinestatic

Create a Node for the unit_prefix.

Parameters
parent_nodethe parent node where to create the node
unit_prefixthe datamodel of the unit_prefix

Definition at line 140 of file xml_ddtoxml_factory.h.

References UnitPrefix::getName(), UnitPrefix::getPower(), UnitPrefix::getSymbol(), and A_UTILS_NS::to_string().

◆ setData()

static void setData ( DOM_NODE_TYPE &  dom_node,
const std::string &  sub_node_name,
const std::string &  value 
)
inlinestatic

Set the data of the new created tag with the name sub_node_name.

Parameters
dom_nodethe dom node where to set the attribute
sub_node_namethe subnode tag name
valuethe data content

Definition at line 89 of file xml_ddtoxml_factory.h.

Referenced by DDToXMLFactory< DOM_NODE_TYPE >::createNode().

◆ setOptionalAttribute() [1/2]

static bool setOptionalAttribute ( DOM_NODE_TYPE &  dom_node,
const char *  attribute_name,
const std::string &  value 
)
inlinestatic

Set the Optional Attribute.

This will only set the attribute if the value is not empty.

Parameters
dom_nodethe dom node where to set the attribute
attribute_namethe attribute name
valuethe value of the attribute
Returns
true the value was set
false the value was not set

Definition at line 71 of file xml_ddtoxml_factory.h.

◆ setOptionalAttribute() [2/2]

static bool setOptionalAttribute ( DOM_NODE_TYPE &  dom_node,
const char *  attribute_name,
const utility::Optional< T > &  value 
)
inlinestatic

Set the Optional Attribute.

This will only set the attribute if the value is valid.

Template Parameters
TThe value_type of the optional
Parameters
dom_nodethe dom node where to set the attribute
attribute_namethe attribute name
valuethe value of the attribute
Returns
true the value was set
false the value was not set

Definition at line 50 of file xml_ddtoxml_factory.h.

References A_UTILS_NS::to_string().

Referenced by DDToXMLFactory< DOM_NODE_TYPE >::createNode().