Dev Essential
Loading...
Searching...
No Matches
ddl::dd::DDToXMLFactory< DOM_NODE_TYPE > Struct Template Reference

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

#include <xml_ddtoxml_factory.h>

Static Public Member Functions

template<typename T>
static bool setOptionalAttribute (DOM_NODE_TYPE &dom_node, const std::string &attribute_name, const utility::Optional< T > &value)
 Set the Optional Attribute. This will only set the attribute if the value is valid.
 
static bool setOptionalAttribute (DOM_NODE_TYPE &dom_node, const std::string &attribute_name, const std::string &value)
 Set the Optional Attribute. This will only set the attribute if the value is not empty.
 
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.
 
static void createNode (DOM_NODE_TYPE &parent_node, const datamodel::Header &header)
 Create a Node for the header.
 
static void createNode (DOM_NODE_TYPE &parent_node, const datamodel::BaseUnit &base_unit)
 Create a Node for the base_unit.
 
static void createNode (DOM_NODE_TYPE &parent_node, const datamodel::UnitPrefix &unit_prefix)
 Create a Node for the unit_prefix.
 
static void createNode (DOM_NODE_TYPE &parent_node, const datamodel::Unit &unit)
 Create a Node for the unit.
 
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.
 
static void createNode (DOM_NODE_TYPE &parent_node, const datamodel::EnumType &enum_type)
 Create a Node for the enum_type.
 
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.
 
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.
 
static void createNode (DOM_NODE_TYPE &parent_node, const datamodel::StreamMetaType &stream_meta_type)
 Create a Node for the stream_meta_type.
 
static void createNode (DOM_NODE_TYPE &parent_node, const datamodel::Stream &stream)
 Create a Node for the stream.
 
static void createNode (DOM_NODE_TYPE &parent_node, const datamodel::DataDefinition &dd)
 Create a Node for the DD.
 

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);

Member Function Documentation

◆ createNode() [1/11]

template<typename DOM_NODE_TYPE>
static void ddl::dd::DDToXMLFactory< DOM_NODE_TYPE >::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

◆ createNode() [2/11]

template<typename DOM_NODE_TYPE>
static void ddl::dd::DDToXMLFactory< DOM_NODE_TYPE >::createNode ( DOM_NODE_TYPE & parent_node,
const datamodel::DataDefinition & dd )
inlinestatic

Create a Node for the DD.

Parameters
parent_nodethe parent node where to create the node
ddthe datamodel of DD

◆ createNode() [3/11]

template<typename DOM_NODE_TYPE>
static void ddl::dd::DDToXMLFactory< DOM_NODE_TYPE >::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)

◆ createNode() [4/11]

template<typename DOM_NODE_TYPE>
static void ddl::dd::DDToXMLFactory< DOM_NODE_TYPE >::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

◆ createNode() [5/11]

template<typename DOM_NODE_TYPE>
static void ddl::dd::DDToXMLFactory< DOM_NODE_TYPE >::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

◆ createNode() [6/11]

template<typename DOM_NODE_TYPE>
static void ddl::dd::DDToXMLFactory< DOM_NODE_TYPE >::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

◆ createNode() [7/11]

template<typename DOM_NODE_TYPE>
static void ddl::dd::DDToXMLFactory< DOM_NODE_TYPE >::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

◆ createNode() [8/11]

template<typename DOM_NODE_TYPE>
static void ddl::dd::DDToXMLFactory< DOM_NODE_TYPE >::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)

◆ createNode() [9/11]

template<typename DOM_NODE_TYPE>
static void ddl::dd::DDToXMLFactory< DOM_NODE_TYPE >::createNode ( DOM_NODE_TYPE & parent_node,
const datamodel::StructType::Element & element,
const Version & file_ddl_version )
inlinestatic

Create a Node for the struct_type element.

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

◆ createNode() [10/11]

template<typename DOM_NODE_TYPE>
static void ddl::dd::DDToXMLFactory< DOM_NODE_TYPE >::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

◆ createNode() [11/11]

template<typename DOM_NODE_TYPE>
static void ddl::dd::DDToXMLFactory< DOM_NODE_TYPE >::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

◆ setData()

template<typename DOM_NODE_TYPE>
static void ddl::dd::DDToXMLFactory< DOM_NODE_TYPE >::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

◆ setOptionalAttribute() [1/2]

template<typename DOM_NODE_TYPE>
static bool ddl::dd::DDToXMLFactory< DOM_NODE_TYPE >::setOptionalAttribute ( DOM_NODE_TYPE & dom_node,
const std::string & 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

◆ setOptionalAttribute() [2/2]

template<typename DOM_NODE_TYPE>
template<typename T>
static bool ddl::dd::DDToXMLFactory< DOM_NODE_TYPE >::setOptionalAttribute ( DOM_NODE_TYPE & dom_node,
const std::string & 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

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