ADTF  3.18.2
ddl::dd Namespace Reference

definition of the dd namespace More...

Namespaces

 datamodel
 definition of the datamodel namespace
 
 utility
 definition of the utility namespace
 

Classes

struct  DDFromXMLFactory
 Factory to create a DataDefinition out of a XML based description. More...
 
struct  DDToXMLFactory
 Template class to create DD DOM nodes with the help of the type DOM_NODE_TYPE. More...
 
class  DataDefinition
 The Data Definiton class uses the validation model to keep a Data Definition datamodel (ddl::dd::datamodel::DataDefinition) valid or inform about inconsitence:
See: More...
 
class  AlignmentConversion
 Alignment Conversion utility. More...
 
class  AlignmentValidation
 Alignment ConvValidation utility. More...
 
class  ByteOrderConversion
 ByteOrder Conversion utility. More...
 
class  ByteOrderDefault
 Default ByteOrder Discovery utility class. More...
 
class  Version
 DDL Version. More...
 
class  VersionConversion
 Version conversion utility class. More...
 
class  ArraySize
 Sinc DDL 2.0 it is possible to define arraysize with a string that indicates a dynamic array. More...
 
struct  Problem
 Problem to report to find the corresponding item name in a simple way. More...
 
class  Error
 Exception helper class to collect information while parsing, adding DD Objects or other failed operatons. More...
 
class  StructElementAccess
 Class to access and obtain the byte position and other information of a instance of this element within a struct (see StructTypeAccess). More...
 
class  StructElementAccessIterator
 Iterator to iterate thru the StructTypeAccess. More...
 
class  StructTypeAccess
 Accessing class for a instance of a struct. More...
 
class  TypeInfo
 TypeInfo model will check for type. More...
 
class  ElementTypeInfo
 Element Size Info is important to get the calculate the TypeInfo for StructType. More...
 
class  ValidationServiceInfo
 Validation Service Info used only as one global instance at the dd::DataDefinition. More...
 
class  ValidationInfo
 Validation Info model will check for validation. More...
 

Typedefs

using Header = datamodel::Header
 Reuse of datamodel header class - ddl::dd::datamodel::Header.
 
using BaseUnit = datamodel::BaseUnit
 Reuse of datamodel base unit class - ddl::dd::datamodel::BaseUnit.
 
using UnitPrefix = datamodel::UnitPrefix
 Reuse of datamodel unit prefix class - ddl::dd::datamodel::UnitPrefix.
 
using Unit = datamodel::Unit
 Reuse of datamodel unit class - ddl::dd::datamodel::Unit.
 
using DataType = datamodel::DataType
 Reuse of datamodel datatype class - ddl::dd::datamodel::DataType.
 
using EnumType = datamodel::EnumType
 Reuse of datamodel enumtype class - ddl::dd::datamodel::EnumType.
 
using StructType = datamodel::StructType
 Reuse of datamodel structtype class - ddl::dd::datamodel::StructType.
 
using StreamMetaType = datamodel::StreamMetaType
 Reuse of datamodel streammetatype class - ddl::dd::datamodel::StreamMetaType.
 
using Stream = datamodel::Stream
 Reuse of datamodel stream class - ddl::dd::datamodel::Stream.
 
using DataDescription = dd::DataDefinition
 Alias Name for DataDefinition, formally known as DataDescription.
 
using OptionalSize = utility::Optional< size_t >
 Optional Size Type.
 

Enumerations

enum  TypeOfType : uint8_t {
  invalid_type , data_type , enum_type , struct_type ,
  stream_meta_type
}
 Classification of a Type. More...
 
enum  TypeOfUnit : uint8_t { invalid_unit , unit , base_unit }
 Classification of unit. More...
 
enum  Alignment : size_t {
  e0 = 1 , e1 = 1 , e2 = 2 , e4 = 4 ,
  e8 = 8 , e16 = 16 , e32 = 32 , e64 = 64 ,
  e_invalid = 255
}
 Alignment defintion. More...
 
enum  ByteOrder {
  platform_not_supported = 0x00 , plattform_little_endian_8 = 0x01 , platform_big_endian_8 = 0x02 , e_noe = platform_not_supported ,
  e_le = plattform_little_endian_8 , e_be = platform_big_endian_8
}
 Representation of the byteorder enumeration.
 
enum  InfoType : uint8_t {
  validation_info , validation_service_info , type_info , element_type_info ,
  named_container_info = element_type_info , last_info
}
 The Info model type defines the kind of infomodel and interface. More...
 
enum class  ValidationLevel : uint8_t { dont_know , invalid , good_enough , valid }
 Validation level. More...
 

Functions

bool addTypeByName (const std::string &type_name, const DataDefinition &source_dd, DataDefinition &destination_dd)
 Helper function which merges or adds the type with the name of type_name. More...
 
bool addStreamTypeByName (const std::string &stream_type_name, const DataDefinition &source_dd, DataDefinition &destination_dd)
 Merges or add the streamtype with the name of stream_type_name. More...
 
bool addUnitByName (const std::string &unit_name, const DataDefinition &source_dd, DataDefinition &destination_dd)
 Merges or add the unit with the name of unit_name. More...
 
std::vector< std::string > transformValidationProblemList (const std::vector< ddl::dd::Problem > &problems)
 transforms the validation protocol of problems to a simple vrctor of strings. More...
 
std::vector< std::string > transformProblemList (const std::vector< Problem > &problems)
 transforms the Problem List to a simple vector of strings. More...
 

Detailed Description

definition of the dd namespace

Enumeration Type Documentation

◆ Alignment

enum Alignment : size_t

Alignment defintion.

Enumerator
e0 

for backward compatibility

e1 

Default alignment.

Definition at line 98 of file dd_common_types.h.

◆ InfoType

enum InfoType : uint8_t

The Info model type defines the kind of infomodel and interface.

See also
datamodel::Info, datamodel::InfoMap
Enumerator
validation_info 

Validation Info.

See also
ValidationInfo
validation_service_info 

Validation Info Service.

See also
ValidationServiceInfo
type_info 

Type Info.

See also
TypeInfo
element_type_info 

Element Type Info.

See also
ElementTypeInfo
named_container_info 

internal type

last_info 

for customer info (use a offset to implement own infos if necessary)

Definition at line 28 of file dd_infomodel_type.h.

◆ TypeOfType

enum TypeOfType : uint8_t

Classification of a Type.

Enumerator
invalid_type 

the type is unknown

data_type 

the type is a data type (DataType)

enum_type 

the type is a enum type (EnumType)

struct_type 

the type is a struct type (StructType)

stream_meta_type 

the type is an stream meta type (StreamMetaType)

Definition at line 44 of file dd_common_types.h.

◆ TypeOfUnit

enum TypeOfUnit : uint8_t

Classification of unit.

Enumerator
invalid_unit 

the type of the unit is unknown

unit 

the unit is a unit (Unit)

base_unit 

the unit is a base unit (BaseUnit)

Definition at line 76 of file dd_common_types.h.

◆ ValidationLevel

enum ValidationLevel : uint8_t
strong

Validation level.

Enumerator
dont_know 

The validation is not known.

This means it is not calculated yet. Use i.e. ddl::dd::DataDefinition::validate

invalid 

the validation level is invalid, dependencies can not be obtained or the dependency "to" is invalid (struct to struct i.e.).

good_enough 

Structs and elements can be "good_enough" for the TypeInfo.

This means the Coder and Decoder can calculate the sizes and the all access Functions can obtain values. Usually this should be the valid state. The problem is, that there are DataDefinition out there (in the users world) using i.e. units, but does not define the unit within that DD. At this point we do not want to break that code! So good enough means: Not well defined in some cases, but good enough for calculate byte positions and TypeInfo.

Only structs, enums and datatypes may have a validationlevel of "good_enough" if there are any other DD Objects used in a DataDefinition and they are "invalid", the DD will also set to "invalid"!

valid 

every thing is well defined.

Definition at line 62 of file dd_infomodel_type.h.

Function Documentation

◆ addStreamTypeByName()

bool ddl::dd::addStreamTypeByName ( const std::string &  stream_type_name,
const DataDefinition source_dd,
DataDefinition destination_dd 
)

Merges or add the streamtype with the name of stream_type_name.

If there are dependencies, they will be retrieved from source_dd.
following types are considered:

  • StructType
  • StreamMetaType
Remarks
This functionality was designed to support adding types that are part of the streams (Stream).
Parameters
stream_type_namethe typename of the type to add.
source_dddependencies will be obtained from this DataDefinition reference (streammetatype, structtype, etc.)
destination_ddwhere to add or merge
Exceptions
ddl::dd::Errorthrows if the type already exists and is not equal to the given one. Will also check dependencies.
Return values
truea type was found and added
falsea type was NOT found and so NOT added

◆ addTypeByName()

bool ddl::dd::addTypeByName ( const std::string &  type_name,
const DataDefinition source_dd,
DataDefinition destination_dd 
)

Helper function which merges or adds the type with the name of type_name.

If there are dependencies, they will be retrieved from source_dd.
following types are considered:

Remarks
This functionality was designed to support adding types that are part of the elements within a StructType.
Parameters
type_namethe typename of the type to add.
source_dddependencies will be obtained from this DataDefinition reference (other streammetatype)
destination_ddwhere to add or merge
Exceptions
ddl::dd::Errorthrows if the type already exists and is not equal to the given one. Will also check dependencies.
Return values
truea type was found and added
falsea type was NOT found and so NOT added

◆ addUnitByName()

bool ddl::dd::addUnitByName ( const std::string &  unit_name,
const DataDefinition source_dd,
DataDefinition destination_dd 
)

Merges or add the unit with the name of unit_name.

If there are dependencies, they will be retrieved from source_dd.
following types are considered:

Parameters
unit_namethe unitname of the unit to add.
source_dddependencies will be obtained from this DataDefinition reference (baseunit, unitprefix)
destination_ddwhere to add or merge
Exceptions
ddl::dd::Errorthrows if the unit already exists and is not equal to the given one. Will also check dependencies.
Return values
truea unit was found and added
falsea unit was NOT found and so NOT added

◆ transformProblemList()

std::vector<std::string> ddl::dd::transformProblemList ( const std::vector< Problem > &  problems)

transforms the Problem List to a simple vector of strings.


Simple usage:

//...
using namespace ddl;
dd::DataDefinition my_dd;
//... adding ... loading ... using
std::cout <<
a_util::strings::join(dd::transformProblemList(my_dd.getValidationProtocol()),"\n");
std::string join(const std::vector< std::string > &strings, const std::string &delimiter)
Joins all strings from the vector into one string, separated by the specified delimiter string.
std::vector< std::string > transformProblemList(const std::vector< Problem > &problems)
transforms the Problem List to a simple vector of strings.
Parameters
problemsthe problems to tranform.
Returns
std::vector<std::string>

◆ transformValidationProblemList()

std::vector<std::string> ddl::dd::transformValidationProblemList ( const std::vector< ddl::dd::Problem > &  problems)

transforms the validation protocol of problems to a simple vrctor of strings.


Simple usage:

//...
using namespace ddl;
dd::DataDefinition my_dd;
//... adding ... loading ... using
std::cout <<
a_util::strings::join(dd::transformValidationProblemList(my_dd.getValidationProtocol()),"\n");
std::vector< std::string > transformValidationProblemList(const std::vector< ddl::dd::Problem > &problems)
transforms the validation protocol of problems to a simple vrctor of strings.
Parameters
problemsthe problems to tranform.
Returns
std::vector<std::string>