ADTF
|
Factory to create a DataDefinition out of a XML based description. More...
Static Public Member Functions | |
static bool | isInteger (const std::string &string_to_check) |
Checks if the given string is an integer value. More... | |
static utility::Optional< int > | toType (const std::string &from_string, const utility::Optional< int > &default_value={}) |
specialized conversion to the Optional<int32_t> More... | |
static utility::Optional< size_t > | toType (const std::string &from_string, const utility::Optional< size_t > &default_value={}) |
specialized conversion to the Optional<size_t> More... | |
static utility::Optional< std::string > | toType (const std::string &from_string, const utility::Optional< std::string > &default_value={}) |
specialized function to convert a string to an optional string which is only valid if set. More... | |
template<typename T > | |
static utility::Optional< T > | getAttribute (const DOM_NODE_TYPE &dom_node, const char *attribute_name, const utility::Optional< T > &default_value={}, bool is_mandatory=false, const std::string &parse_error_message={}) |
Get the Attribute from the dom_node . More... | |
template<typename T > | |
static utility::Optional< T > | getData (const DOM_NODE_TYPE &dom_node, const std::string &sub_node_name, const utility::Optional< T > &default_value={}, bool is_mandatory=false, const char *parse_error_message="") |
Get the data content of a subnode of dom_node . More... | |
static datamodel::Header::ExtDeclaration | createHeaderExtDeclaration (const DOM_NODE_TYPE &dom_node) |
Create a Header Ext Declaration object. More... | |
static datamodel::Header | createHeader (const DOM_NODE_TYPE &dom_node) |
Create a Header object. More... | |
static datamodel::BaseUnit | createBaseUnit (const DOM_NODE_TYPE &dom_node) |
Create a Base Unit object. More... | |
static datamodel::UnitPrefix | createUnitPrefix (const DOM_NODE_TYPE &dom_node) |
Create a Unit Prefix object. More... | |
static datamodel::Unit::RefUnit | createRefUnit (const DOM_NODE_TYPE &dom_node) |
Create a Ref Unit object. More... | |
static datamodel::Unit | createUnit (const DOM_NODE_TYPE &dom_node) |
Create a Unit object. More... | |
static datamodel::DataType | createDataType (const DOM_NODE_TYPE &dom_node, const Version &file_ddl_version, bool strict) |
Create a Data Type object. More... | |
static datamodel::EnumType::Element | createEnumTypeElement (const DOM_NODE_TYPE &dom_node) |
Create a Enum Type Element object. More... | |
static datamodel::EnumType | createEnumType (const DOM_NODE_TYPE &dom_node) |
Create a Enum Type object. More... | |
static datamodel::StructType::Element | createStructTypeElement (const DOM_NODE_TYPE &dom_node, const Version &file_ddl_version, bool strict) |
Create a Struct Type Element object. More... | |
static datamodel::StructType | createStructType (const DOM_NODE_TYPE &dom_node, const Version &file_ddl_version, bool strict) |
Create a Struct Type object. More... | |
static datamodel::StreamMetaType::Property | createStreamMetaTypeProperty (const DOM_NODE_TYPE &dom_node) |
Create a Stream Meta Type Property object. More... | |
static datamodel::StreamMetaType | createStreamMetaType (const DOM_NODE_TYPE &dom_node) |
Create a Stream Meta Type object. More... | |
static datamodel::Stream::Struct | createStreamStruct (const DOM_NODE_TYPE &dom_node) |
Create a Stream Struct object. More... | |
static datamodel::Stream | createStream (const DOM_NODE_TYPE &dom_node) |
Create a Stream object. More... | |
static datamodel::DataDefinition | createDD (const DOM_NODE_TYPE &dom_node, const dd::Version &language_version, bool strict) |
Creates a whole DataDefinition and read all sub node. More... | |
Factory to create a DataDefinition out of a XML based description.
This factory uses a template type DOM_NODE_TYPE which is design to follow the a concept class type definition of the a_util::DOMElement.
DOM_NODE_TYPE | a DOMElement class must implement following funtions:
|
Definition at line 45 of file xml_ddfromxml_factory.h.
|
inlinestatic |
Create a Base Unit object.
dom_node | the node to create the BaseUnit from (should be "baseunit" tag name). |
Definition at line 275 of file xml_ddfromxml_factory.h.
Referenced by DDFromXMLFactory< DOM_NODE_TYPE >::createDD().
|
inlinestatic |
Create a Data Type object.
dom_node | the node to create the DataType from (should be "datatype" tag name). |
file_ddl_version | the set filename language verion (from header) |
strict | set to true to load the datamodel exactly like defined (no mixture of DDL tag definitions allowed). |
Definition at line 354 of file xml_ddfromxml_factory.h.
References PredefinedDataTypes::getDefaultAlignment(), PredefinedDataTypes::getInstance(), and ddl::dd::unit.
Referenced by DDFromXMLFactory< DOM_NODE_TYPE >::createDD().
|
inlinestatic |
Creates a whole DataDefinition and read all sub node.
dom_node | node to create the DataDefinition from. |
language_version | forced language version is no header-tag is found within the dom definition |
strict | set to true to load the datamodel exactly like defined (no mixture of DDL tag definitions allowed). |
Definition at line 856 of file xml_ddfromxml_factory.h.
References DDFromXMLFactory< DOM_NODE_TYPE >::createBaseUnit(), DDFromXMLFactory< DOM_NODE_TYPE >::createDataType(), DDFromXMLFactory< DOM_NODE_TYPE >::createHeader(), DDFromXMLFactory< DOM_NODE_TYPE >::createStream(), DDFromXMLFactory< DOM_NODE_TYPE >::createStreamMetaType(), DDFromXMLFactory< DOM_NODE_TYPE >::createStructType(), DDFromXMLFactory< DOM_NODE_TYPE >::createUnitPrefix(), TypeAccessMap< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::emplace(), DataDefinition::getBaseUnits(), DataDefinition::getDataTypes(), DataDefinition::getEnumTypes(), DataDefinition::getStreamMetaTypes(), DataDefinition::getStreams(), DataDefinition::getStructTypes(), DataDefinition::getUnitPrefixes(), DataDefinition::getUnits(), DataDefinition::getVersion(), and DataDefinition::setHeader().
|
inlinestatic |
Create a Enum Type object.
dom_node | the node to create the EnumType from (should be "enum" tag name). |
Definition at line 446 of file xml_ddfromxml_factory.h.
References DDFromXMLFactory< DOM_NODE_TYPE >::createEnumTypeElement().
|
inlinestatic |
Create a Enum Type Element object.
dom_node | the node to create the EnumType::Element from (should be "element" tag name). |
Definition at line 431 of file xml_ddfromxml_factory.h.
Referenced by DDFromXMLFactory< DOM_NODE_TYPE >::createEnumType().
|
inlinestatic |
Create a Header object.
dom_node | the node to create the header from (should be "header" tag name). |
Definition at line 232 of file xml_ddfromxml_factory.h.
References DDFromXMLFactory< DOM_NODE_TYPE >::createHeaderExtDeclaration(), VersionConversion::fromString(), and Header::setAuthor().
Referenced by DDFromXMLFactory< DOM_NODE_TYPE >::createDD().
|
inlinestatic |
Create a Header Ext Declaration object.
dom_node | the node to create the ExDeclaration from (should be "ext_declaration" tag name). |
Definition at line 208 of file xml_ddfromxml_factory.h.
Referenced by DDFromXMLFactory< DOM_NODE_TYPE >::createHeader().
|
inlinestatic |
Create a Ref Unit object.
dom_node | the node to create the RefUnit from (should be "refUnit" tag name). |
Definition at line 307 of file xml_ddfromxml_factory.h.
Referenced by DDFromXMLFactory< DOM_NODE_TYPE >::createUnit().
|
inlinestatic |
Create a Stream object.
dom_node | node to create the Stream from (should be "stream" tag name). |
Definition at line 818 of file xml_ddfromxml_factory.h.
References DDFromXMLFactory< DOM_NODE_TYPE >::createStreamStruct(), TypeAccessList< DDL_TYPE_TO_ACCESS, TYPE_VALIDATOR_CLASS >::emplace(), Stream::getStructs(), and Stream::setDescription().
Referenced by DDFromXMLFactory< DOM_NODE_TYPE >::createDD().
|
inlinestatic |
Create a Stream Meta Type object.
dom_node | node to create the StreamMetaType from (should be "streammetatype" tag name). |
Definition at line 768 of file xml_ddfromxml_factory.h.
References DDFromXMLFactory< DOM_NODE_TYPE >::createStreamMetaTypeProperty(), and StreamMetaType::setParent().
Referenced by DDFromXMLFactory< DOM_NODE_TYPE >::createDD().
|
inlinestatic |
Create a Stream Meta Type Property object.
dom_node | node to create the StreamMetaType::Property from (should be "property" tag name). |
Definition at line 744 of file xml_ddfromxml_factory.h.
Referenced by DDFromXMLFactory< DOM_NODE_TYPE >::createStreamMetaType().
|
inlinestatic |
Create a Stream Struct object.
dom_node | node to create the Stream::Struct from (should be "struct" tag name). |
Definition at line 803 of file xml_ddfromxml_factory.h.
Referenced by DDFromXMLFactory< DOM_NODE_TYPE >::createStream().
|
inlinestatic |
Create a Struct Type object.
dom_node | node to create the StructType from (should be "struct" tag name). |
file_ddl_version | the set filename language verion (from header) |
strict | set to true to load the datamodel exactly like defined (no mixture of DDL tag definitions allowed). |
Definition at line 684 of file xml_ddfromxml_factory.h.
References DDFromXMLFactory< DOM_NODE_TYPE >::createStructTypeElement(), AlignmentConversion::fromString(), VersionConversion::fromString(), and ddl::dd::struct_type.
Referenced by DDFromXMLFactory< DOM_NODE_TYPE >::createDD().
|
inlinestatic |
Create a Struct Type Element object.
dom_node | the node to create the StructType::Element from (should be "element" tag name). |
file_ddl_version | the set filename language verion (from header) |
strict | set to true to load the datamodel exactly like defined (no mixture of DDL tag definitions allowed). |
Definition at line 474 of file xml_ddfromxml_factory.h.
Referenced by DDFromXMLFactory< DOM_NODE_TYPE >::createStructType().
|
inlinestatic |
Create a Unit object.
dom_node | the node to create the Unit from (should be "unit" tag name). |
Definition at line 324 of file xml_ddfromxml_factory.h.
References DDFromXMLFactory< DOM_NODE_TYPE >::createRefUnit().
|
inlinestatic |
Create a Unit Prefix object.
dom_node | the node to create the UnitPrefix from (should be "prefixes" tag name). |
Definition at line 290 of file xml_ddfromxml_factory.h.
Referenced by DDFromXMLFactory< DOM_NODE_TYPE >::createDD().
|
inlinestatic |
Get the Attribute from the dom_node
.
Return a valid Optional<T> if set, otherwise return default_value
or throw.
T | the value type of the returned Optional |
dom_node | the dom node (see also DDFromXMLFactory) |
attribute_name | the attribute name |
default_value | the default value if the attribute was not set. (this will be only used if is_mandatory is false) |
is_mandatory | if set to true this function will throw if the attribute is not set in DOM |
parse_error_message | the message in the thrown exception if is_mandatory was set to true |
dd::Error | The function will throw only if is_mandatory is set to true. |
Definition at line 142 of file xml_ddfromxml_factory.h.
|
inlinestatic |
Get the data content of a subnode of dom_node
.
Return a valid Optional<T> if set, otherwise return default_value
or throw.
T | the value type of the returned Optional |
dom_node | the dom node (see also DDFromXMLFactory) |
sub_node_name | the sub node name |
default_value | the default value if the attribute was not set. (this will be only used if is_mandatory is false) |
is_mandatory | if set to true this function will throw if the data area is not set in sub node |
parse_error_message | the message in the thrown exception if is_mandatory was set to true |
dd::Error | The function will throw only if is_mandatory is set to true. |
Definition at line 178 of file xml_ddfromxml_factory.h.
|
inlinestatic |
Checks if the given string is an integer value.
[in] | string_to_check | the string to check |
Definition at line 51 of file xml_ddfromxml_factory.h.
References ddl::dd::utility::isInteger().
|
inlinestatic |
specialized conversion to the Optional<int32_t>
from_string | string representation of the value |
default_value | the optional value to set if not set in from_string |
Definition at line 63 of file xml_ddfromxml_factory.h.
|
inlinestatic |
specialized conversion to the Optional<size_t>
from_string | string representation of the value |
default_value | the optional value to set if not set in from_string |
Definition at line 85 of file xml_ddfromxml_factory.h.
|
inlinestatic |
specialized function to convert a string to an optional string which is only valid if set.
from_string | the string to convert from |
default_value | the optional value to set if from_string is empty |
Definition at line 114 of file xml_ddfromxml_factory.h.