ADTF
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ddl::dd Namespace Reference

definition of the dd namespace More...

Namespaces

namespace  datamodel
 definition of the datamodel namespace
 
namespace  utility
 definition of the old compatibility utility namespace
 

Classes

class  AlignmentConversion
 Alignment Conversion utility. More...
 
class  AlignmentValidation
 Alignment ConvValidation utility. More...
 
class  ArraySize
 Sinc DDL 2.0 it is possible to define arraysize with a string that indicates a dynamic array. More...
 
class  ByteOrderConversion
 ByteOrder Conversion utility. More...
 
class  ByteOrderDefault
 Default ByteOrder Discovery utility class. More...
 
class  DataDefinition
 The Data Definiton class uses the validation model to keep a Data Definition datamodel (DataDefinition) valid or inform about inconsitence:
See: More...
 
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  Error
 Exception helper class to collect information while parsing, adding DD Objects or other failed operatons. More...
 
struct  Problem
 Problem to report to find the corresponding item name in a simple way. 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  Version
 DDL Version. More...
 
class  VersionConversion
 Version conversion utility class. More...
 

Typedefs

using Header = datamodel::Header
 Reuse of datamodel header class - Header.
 
using BaseUnit = datamodel::BaseUnit
 Reuse of datamodel base unit class - BaseUnit.
 
using UnitPrefix = datamodel::UnitPrefix
 Reuse of datamodel unit prefix class - UnitPrefix.
 
using Unit = datamodel::Unit
 Reuse of datamodel unit class - Unit.
 
using DataType = datamodel::DataType
 Reuse of datamodel datatype class - DataType.
 
using EnumType = datamodel::EnumType
 Reuse of datamodel enumtype class - EnumType.
 
using StructType = datamodel::StructType
 Reuse of datamodel structtype class - StructType.
 
using StreamMetaType = datamodel::StreamMetaType
 Reuse of datamodel streammetatype class - StreamMetaType.
 
using Stream = datamodel::Stream
 Reuse of datamodel stream class - 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. More...
 
enum  InfoType : uint8_t {
  validation_info , validation_service_info , type_info , element_type_info ,
  named_container_info = element_type_info , last_info , last_info_last_index = 200 , additional_compatible_members = 201
}
 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.
 
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.
 
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.
 
std::vector< std::string > transformValidationProblemList (const std::vector< ddl::dd::Problem > &problems)
 transforms the validation protocol of problems to a simple vrctor of strings.
 
std::vector< std::string > transformProblemList (const std::vector< Problem > &problems)
 transforms the Problem List to a simple vector of strings.
 

Detailed Description

definition of the dd namespace

Typedef Documentation

◆ BaseUnit

Reuse of datamodel base unit class - BaseUnit.

Definition at line 39 of file dd.h.

◆ DataDescription

Alias Name for DataDefinition, formally known as DataDescription.

Definition at line 654 of file dd.h.

◆ DataType

Reuse of datamodel datatype class - DataType.

Definition at line 51 of file dd.h.

◆ EnumType

Reuse of datamodel enumtype class - EnumType.

Definition at line 55 of file dd.h.

◆ Header

Reuse of datamodel header class - Header.

Definition at line 35 of file dd.h.

◆ OptionalSize

Optional Size Type.

Definition at line 38 of file dd_common_types.h.

◆ Stream

Reuse of datamodel stream class - Stream.

Definition at line 67 of file dd.h.

◆ StreamMetaType

Reuse of datamodel streammetatype class - StreamMetaType.

Definition at line 63 of file dd.h.

◆ StructType

Reuse of datamodel structtype class - StructType.

Definition at line 59 of file dd.h.

◆ Unit

Reuse of datamodel unit class - Unit.

Definition at line 47 of file dd.h.

◆ UnitPrefix

Reuse of datamodel unit prefix class - UnitPrefix.

Definition at line 43 of file dd.h.

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.

◆ ByteOrder

enum ByteOrder

Representation of the byteorder enumeration.

Definition at line 152 of file dd_common_types.h.

◆ InfoType

enum InfoType : uint8_t

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

See also
Info, InfoMap
Enumerator
validation_info 

Validation Info.

validation_service_info 

Validation Info Service.

type_info 

Type Info.

element_type_info 

Element Type Info.

named_container_info 

internal type

last_info 

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

last_info_last_index 

last valid customer info (values above are used internally)

additional_compatible_members 

due to binary compatibility the InfoMap is used as pimpl object 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 class ValidationLevel : uint8_t
strong

Validation level.

Enumerator
dont_know 

The validation is not known.

This means it is not calculated yet. Use i.e. 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 66 of file dd_infomodel_type.h.

Function Documentation

◆ addStreamTypeByName()

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.

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 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 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 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 > transformProblemList ( const std::vector< Problem > & problems)

transforms the Problem List to a simple vector of strings.


Simple usage:

//...
using namespace ddl;
//... adding ... loading ... using
std::cout <<
The Data Definiton class uses the validation model to keep a Data Definition datamodel (DataDefinitio...
Definition dd.h:92
std::vector< ddl::dd::Problem > getValidationProtocol() const
Gets a collection of all problems obtained while validating the DataDefinition Objects.
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 > 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;
//... adding ... loading ... using
std::cout <<
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>