ADTF  3.18.2
DDCompare

Utility class to compare data descriptions. More...

Public Types

enum  DescriptionCheckFlags {
  dcf_data_types = 0x01 , dcf_units = 0x02 , dcf_enums = 0x04 , dcf_structs = 0x08 ,
  dcf_streams = 0x10 , dcf_base_units = 0x20 , dcf_prefixes = 0x40 , dcf_stream_meta_types = 0x80 ,
  dcf_all = 0xFF , dcf_subset = 0x0100 , dcf_versions = 0x0200 , dcf_comments = 0x0400 ,
  dcf_descriptions = 0x0800 , dcf_header = 0x1000 , dcf_visualization_attributes , dcf_no_enum_values_check = 0x010000 ,
  dcf_no_recursion , dcf_no_header_dates , dcf_everything = 0xFFFF
}
 Flags for the description based isEqual methods. More...
 
enum  ItemCheckFlags {
  icf_none = 0x00 , icf_memory = 0x01 , icf_serialized = 0x02 , icf_names ,
  icf_versions , icf_units = 0x10 , icf_comments = 0x20 , icf_descriptions = 0x40 ,
  icf_subset = 0x80 , icf_visualizations_attributes , icf_no_enum_values_check = 0x0200 , icf_no_recursion ,
  icf_everything
}
 Flags for the item based isEqual methods. More...
 

Static Public Member Functions

static a_util::result::Result isBinaryEqual (const std::string &type1, const std::string &desc1, const std::string &type2, const std::string &desc2, bool is_subset=true)
 isBinaryEqual checks whether two type descriptions describe the same binary data layout More...
 
static a_util::result::Result isBinaryEqual (const std::string &type1, const dd::DataDefinition &desc1, const std::string &type2, const dd::DataDefinition &desc2, bool is_subset=true)
 isBinaryEqual checks whether two type descriptions describe the same binary data layout More...
 
static a_util::result::Result isEqualPrefix (const std::string &prefix1, const std::string &desc1, const std::string &prefix2, const std::string &desc2, uint32_t flags=icf_none)
 isEqualPrefix checks whether two prefix descriptions are equal. More...
 
static a_util::result::Result isEqual (const dd::UnitPrefix &prefix1, const dd::UnitPrefix &prefix2, uint32_t flags=icf_none)
 isEqual checks whether two prefix descriptions are equal. More...
 
static a_util::result::Result isEqualUnit (const std::string &unit1, const std::string &desc1, const std::string &unit2, const std::string &desc2, uint32_t flags=icf_none)
 isEqualUnit checks whether two unit descriptions are equal. More...
 
static a_util::result::Result isEqual (const dd::Unit &unit1, const dd::DataDefinition &source_dd_of_unit1, const dd::Unit &unit2, const dd::DataDefinition &source_dd_of_unit2, uint32_t flags=icf_none)
 isEqual checks whether two unit descriptions are equal. More...
 
static a_util::result::Result isEqual (const dd::BaseUnit &base_unit1, const dd::BaseUnit &base_unit2, uint32_t flags=icf_none)
 isEqual checks whether two unit descriptions are equal. More...
 
static a_util::result::Result isEqualType (const std::string &type1, const std::string &desc1, const std::string &type2, const std::string &desc2, uint32_t flags=icf_memory)
 isEqual checks whether two type (POD/enum/struct) descriptions are equal. More...
 
static a_util::result::Result isEqual (const dd::DataType &type1, const dd::DataType &type2, uint32_t flags=icf_memory)
 isEqual checks whether two type (POD) descriptions are equal When this is true for a struct then it also implies isBinaryEqual is true More...
 
static a_util::result::Result isEqual (const dd::EnumType &enum1, const dd::DataDefinition &source_dd_of_enum1, const dd::EnumType &enum2, const dd::DataDefinition &source_dd_of_enum2, uint32_t flags=icf_memory)
 isEqual checks whether two type (enum) descriptions are equal When this is true for a struct then it also implies isBinaryEqual is true More...
 
static a_util::result::Result isEqual (const dd::StructType &type1, const dd::DataDefinition &source_dd_of_type1, const dd::StructType &type2, const dd::DataDefinition &source_dd_of_type2, uint32_t flags=icf_memory)
 isEqual checks whether two type (POD/enum/struct) descriptions are equal When this is true for a struct then it also implies isBinaryEqual is true More...
 
static a_util::result::Result isEqualStream (const std::string &stream1, const std::string &desc1, const std::string &stream2, const std::string &desc2, uint32_t flags=icf_memory)
 isEqual checks whether two stream descriptions are equal. More...
 
static a_util::result::Result isEqual (const dd::Stream &stream1, const dd::DataDefinition &source_dd_of_stream1, const dd::Stream &stream2, const dd::DataDefinition &source_dd_of_stream2, uint32_t flags=icf_memory)
 isEqual checks whether two stream descriptions are equal. More...
 
static a_util::result::Result isEqual (const dd::StreamMetaType &stream_meta_type1, const dd::DataDefinition &source_dd_of_stream_meta_type1, const dd::StreamMetaType &stream_meta_type2, const dd::DataDefinition &source_dd_of_stream_meta_type2, uint32_t flags=icf_memory)
 isEqual checks whether two stream meta types descriptions are equal. More...
 
static a_util::result::Result isEqual (const dd::datamodel::KeyValuePair &key_value_pair1, const dd::datamodel::KeyValuePair &key_value_pair2, uint32_t flags=icf_none)
 isEqual checks whether two external declarations of header/elements of enum/properties of streammetatype properties are equal. More...
 
static a_util::result::Result isEqual (const dd::Unit::RefUnit &ref_unit1, const dd::DataDefinition &source_dd_of_ref_unit1, const dd::Unit::RefUnit &ref_unit2, const dd::DataDefinition &source_dd_of_ref_unit2, uint32_t flags=icf_none)
 isEqual checks whether two reference units are equal. More...
 
static a_util::result::Result isEqual (const dd::StructType::Element &elem1, const dd::DataDefinition &source_dd_of_elem1, const dd::StructType::Element &elem2, const dd::DataDefinition &source_dd_of_elem2, uint32_t flags=icf_none)
 isEqual checks whether two struct elements are equal. More...
 
static a_util::result::Result isEqual (const dd::Stream::Struct &stream_struct1, const dd::DataDefinition &source_dd_of_stream_struct1, const dd::Stream::Struct &stream_struct2, const dd::DataDefinition &source_dd_of_stream_struct2, uint32_t flags=icf_none)
 isEqual checks whether two stream structs equal. More...
 
static a_util::result::Result isEqual (const std::string &desc1, const std::string &desc2, uint32_t flags=dcf_all|dcf_subset)
 isEqual checks whether two descriptions are equal. More...
 
static a_util::result::Result isEqual (const dd::DataDefinition &desc1, const dd::DataDefinition &desc2, uint32_t flags=dcf_all|dcf_subset)
 isEqual checks whether two descriptions are equal. More...
 

Detailed Description

Utility class to compare data descriptions.

Definition at line 24 of file ddcompare.h.

Member Enumeration Documentation

◆ DescriptionCheckFlags

Flags for the description based isEqual methods.

Enumerator
dcf_data_types 

Compare datatypes.

dcf_units 

Compare units.

dcf_enums 

Compare enums.

dcf_structs 

Compare structs.

dcf_streams 

Compare streams.

dcf_base_units 

Compare baseunits.

dcf_prefixes 

Compare prefixes.

dcf_stream_meta_types 

Compare stream_meta_types.

dcf_all 

Compare all elements (see above)

dcf_subset 

Checks whether the first description is a subset of the second.

dcf_versions 

Compares the version attributes as well.

dcf_comments 

Compares the comment attributes as well.

dcf_descriptions 

Compares the description attributes as well.

dcf_header 

Compare the header as well.

dcf_visualization_attributes 

Check attributes relevant for visualization (min/max/default/scale/offset)

dcf_no_enum_values_check 

Do not compare enum values.

dcf_no_recursion 

Do not compare sub-entities (elements, ref units, stream structs, ...)

dcf_no_header_dates 

Do not compare header dates (date_creation, date_change)

dcf_everything 

Check everything (all flags except the "No" variants)

Definition at line 29 of file ddcompare.h.

◆ ItemCheckFlags

Flags for the item based isEqual methods.

Enumerator
icf_memory 

Compare the in-memory representation.

icf_serialized 

Compare the serialized representation.

icf_names 

Compare the names of structs and their elements and stream meta types parent.

icf_versions 

Compare the versions of all elements and structs and stream meta types.

icf_units 

Compare the units as well.

icf_comments 

Compare the comments as well.

icf_descriptions 

Compare the comments as well.

icf_subset 

Check if the first item is a subset of the second.

icf_visualizations_attributes 

Check attributes relevant for visualization (min/max/default/scale/offset)

icf_no_enum_values_check 

Do not compare enum values.

icf_no_recursion 

Do not compare sub-entities (elements, ref units, stream structs, ...)

icf_everything 

Check everything (mind no_recursion and no_enum is not changed here)

Definition at line 58 of file ddcompare.h.

Member Function Documentation

◆ isBinaryEqual() [1/2]

static a_util::result::Result isBinaryEqual ( const std::string &  type1,
const dd::DataDefinition desc1,
const std::string &  type2,
const dd::DataDefinition desc2,
bool  is_subset = true 
)
static

isBinaryEqual checks whether two type descriptions describe the same binary data layout

Parameters
[in]type1The name of the first type.
[in]desc1The description that has type1.
[in]type2The name of the second type.
[in]desc2The description that has type2.
[in]is_subsetIf true then the method checks if the first type is a subset of the second. A subset is defined as follows:
  • starting at offset 0 each leaf element of the type type1 must have an equal leaf element in type2 in ddl::codec::ElementType and byte position
  • the corresponding byte position for the leaf element within type type1 is filled with padding byte in type2
  • padding elements in type1 are not checked
  • the byte size of type1 is allowed to be lower than the byte size of type2
Return values
a_util::result::SUCCESSThe description describe the same layout
ERR_FAILEDThe description do NOT describe the same layout
Standardresult (other DataDefinition parsing errors etc.)

◆ isBinaryEqual() [2/2]

static a_util::result::Result isBinaryEqual ( const std::string &  type1,
const std::string &  desc1,
const std::string &  type2,
const std::string &  desc2,
bool  is_subset = true 
)
static

isBinaryEqual checks whether two type descriptions describe the same binary data layout

Parameters
[in]type1The name of the first type.
[in]desc1The description that has type1.
[in]type2The name of the second type.
[in]desc2The description that has type2.
[in]is_subsetIf true then the method checks if the first type is a subset of the second. A subset is defined as follows:
  • starting at offset 0 each leaf element of the type type1 must have an equal leaf element in type2 in ddl::codec::ElementType and byte position
  • the corresponding byte position for the leaf element within type type1 is filled with padding byte in type2
  • padding elements in type1 are not checked
  • the byte size of type1 is allowed to be lower than the byte size of type2
Return values
a_util::result::SUCCESSThe description describe the same layout
ERR_FAILEDThe description do NOT describe the same layout
Standardresult (other DataDefinition parsing errors etc.)

◆ isEqual() [1/14]

static a_util::result::Result isEqual ( const dd::BaseUnit base_unit1,
const dd::BaseUnit base_unit2,
uint32_t  flags = icf_none 
)
static

isEqual checks whether two unit descriptions are equal.

Parameters
[in]base_unit1The first unit.
[in]base_unit2The second unit.
[in]flagsFlags that specifiy what should be checked, see ItemCheckFlags.
Return values
a_util::result::SUCCESSThe descriptions are equal.
ERR_FAILEDThe description are not equal.
Standardresult (other DataDefinition parsing errors etc.)

◆ isEqual() [2/14]

static a_util::result::Result isEqual ( const dd::DataDefinition desc1,
const dd::DataDefinition desc2,
uint32_t  flags = dcf_all|dcf_subset 
)
static

isEqual checks whether two descriptions are equal.

Parameters
[in]desc1The first description.
[in]desc2The second description.
[in]flagsFlags that specifiy what should be checked, see DescriptionCheckFlags.
Return values
a_util::result::SUCCESSThe descriptions are equal.
ERR_FAILEDThe description are not equal.
Standardresult (other DataDefinition parsing errors etc.)

◆ isEqual() [3/14]

static a_util::result::Result isEqual ( const dd::datamodel::KeyValuePair key_value_pair1,
const dd::datamodel::KeyValuePair key_value_pair2,
uint32_t  flags = icf_none 
)
static

isEqual checks whether two external declarations of header/elements of enum/properties of streammetatype properties are equal.

Parameters
[in]key_value_pair1The first key value pair.
[in]key_value_pair2The second key value pair.
[in]flagsFlags that specifiy what should be checked, see ItemCheckFlags.
Return values
a_util::result::SUCCESSThe descriptions are equal.
ERR_FAILEDThe description are not equal.
Standardresult (other DataDefinition parsing errors etc.)

◆ isEqual() [4/14]

static a_util::result::Result isEqual ( const dd::DataType type1,
const dd::DataType type2,
uint32_t  flags = icf_memory 
)
static

isEqual checks whether two type (POD) descriptions are equal When this is true for a struct then it also implies isBinaryEqual is true

Parameters
[in]type1The first type.
[in]type2The second type.
[in]flagsFlags that specifiy what should be checked, see ItemCheckFlags.
Return values
a_util::result::SUCCESSThe descriptions are equal.
ERR_FAILEDThe description are not equal.
Standardresult (other DataDefinition parsing errors etc.)

◆ isEqual() [5/14]

static a_util::result::Result isEqual ( const dd::EnumType enum1,
const dd::DataDefinition source_dd_of_enum1,
const dd::EnumType enum2,
const dd::DataDefinition source_dd_of_enum2,
uint32_t  flags = icf_memory 
)
static

isEqual checks whether two type (enum) descriptions are equal When this is true for a struct then it also implies isBinaryEqual is true

Parameters
[in]enum1The first type.
[in]source_dd_of_enum1The DataDefinition where all references of type1 are defined
[in]enum2The second type.
[in]source_dd_of_enum2The DataDefinition where all references of type2 are defined
[in]flagsFlags that specifiy what should be checked, see ItemCheckFlags.
Return values
a_util::result::SUCCESSThe descriptions are equal.
ERR_FAILEDThe description are not equal.
Standardresult (other DataDefinition parsing errors etc.)

◆ isEqual() [6/14]

static a_util::result::Result isEqual ( const dd::Stream stream1,
const dd::DataDefinition source_dd_of_stream1,
const dd::Stream stream2,
const dd::DataDefinition source_dd_of_stream2,
uint32_t  flags = icf_memory 
)
static

isEqual checks whether two stream descriptions are equal.

Parameters
[in]stream1The first stream.
[in]source_dd_of_stream1The DataDefinition where all references of stream1 are defined
[in]stream2The second stream.
[in]source_dd_of_stream2The DataDefinition where all references of stream2 are defined
[in]flagsFlags that specifiy what should be checked, see ItemCheckFlags.
Return values
a_util::result::SUCCESSThe descriptions are equal.
ERR_FAILEDThe description are not equal.
Standardresult (other DataDefinition parsing errors etc.)

◆ isEqual() [7/14]

static a_util::result::Result isEqual ( const dd::Stream::Struct stream_struct1,
const dd::DataDefinition source_dd_of_stream_struct1,
const dd::Stream::Struct stream_struct2,
const dd::DataDefinition source_dd_of_stream_struct2,
uint32_t  flags = icf_none 
)
static

isEqual checks whether two stream structs equal.

Parameters
[in]stream_struct1The first struct.
[in]source_dd_of_stream_struct1The corresponding DataDefinition for the first struct.
[in]stream_struct2The second struct.
[in]source_dd_of_stream_struct2The corresponding DataDefinition for the second struct.
[in]flagsFlags that specifiy what should be checked, see ItemCheckFlags.
Return values
a_util::result::SUCCESSThe descriptions are equal.
ERR_FAILEDThe description are not equal.
Standardresult (other DataDefinition parsing errors etc.)

◆ isEqual() [8/14]

static a_util::result::Result isEqual ( const dd::StreamMetaType stream_meta_type1,
const dd::DataDefinition source_dd_of_stream_meta_type1,
const dd::StreamMetaType stream_meta_type2,
const dd::DataDefinition source_dd_of_stream_meta_type2,
uint32_t  flags = icf_memory 
)
static

isEqual checks whether two stream meta types descriptions are equal.

Parameters
[in]stream_meta_type1The first stream meta type.
[in]source_dd_of_stream_meta_type1The DataDefinition where all references of stream_meta_type1 are defined
[in]stream_meta_type2The second stream meta type.
[in]source_dd_of_stream_meta_type2The DataDefinition where all references of stream_meta_type2 are defined
[in]flagsFlags that specifiy what should be checked, see ItemCheckFlags.
Return values
a_util::result::SUCCESSThe descriptions are equal.
ERR_FAILEDThe description are not equal.
Standardresult (other DataDefinition parsing errors etc.)

◆ isEqual() [9/14]

static a_util::result::Result isEqual ( const dd::StructType type1,
const dd::DataDefinition source_dd_of_type1,
const dd::StructType type2,
const dd::DataDefinition source_dd_of_type2,
uint32_t  flags = icf_memory 
)
static

isEqual checks whether two type (POD/enum/struct) descriptions are equal When this is true for a struct then it also implies isBinaryEqual is true

Parameters
[in]type1The first type.
[in]source_dd_of_type1The DataDefinition where all references of type1 are defined
[in]type2The second type.
[in]source_dd_of_type2The DataDefinition where all references of type2 are defined
[in]flagsFlags that specifiy what should be checked, see ItemCheckFlags.
Return values
a_util::result::SUCCESSThe descriptions are equal.
ERR_FAILEDThe description are not equal.
Standardresult (other DataDefinition parsing errors etc.)

◆ isEqual() [10/14]

static a_util::result::Result isEqual ( const dd::StructType::Element elem1,
const dd::DataDefinition source_dd_of_elem1,
const dd::StructType::Element elem2,
const dd::DataDefinition source_dd_of_elem2,
uint32_t  flags = icf_none 
)
static

isEqual checks whether two struct elements are equal.

Note that in case of dynamic elements only the name of the array size specifier can be checked. Compare the whole struct if you need a more tourough comparison.

Parameters
[in]elem1The first element.
[in]source_dd_of_elem1The DataDefinition where all references of elem1 are defined
[in]elem2The second element.
[in]source_dd_of_elem2The DataDefinition where all references of elem2 are defined
[in]flagsFlags that specifiy what should be checked, see ItemCheckFlags.
Return values
a_util::result::SUCCESSThe descriptions are equal.
ERR_FAILEDThe description are not equal.
Standardresult (other DataDefinition parsing errors etc.)

◆ isEqual() [11/14]

static a_util::result::Result isEqual ( const dd::Unit unit1,
const dd::DataDefinition source_dd_of_unit1,
const dd::Unit unit2,
const dd::DataDefinition source_dd_of_unit2,
uint32_t  flags = icf_none 
)
static

isEqual checks whether two unit descriptions are equal.

Parameters
[in]unit1The first unit.
[in]source_dd_of_unit1The DataDefinition unit1 belongs to.
[in]unit2The second unit.
[in]source_dd_of_unit2The DataDefinition unit2 belongs to.
[in]flagsFlags that specifiy what should be checked, see ItemCheckFlags.
Return values
a_util::result::SUCCESSThe descriptions are equal.
ERR_FAILEDThe description are not equal.
Standardresult (other DataDefinition parsing errors etc.)

◆ isEqual() [12/14]

static a_util::result::Result isEqual ( const dd::Unit::RefUnit ref_unit1,
const dd::DataDefinition source_dd_of_ref_unit1,
const dd::Unit::RefUnit ref_unit2,
const dd::DataDefinition source_dd_of_ref_unit2,
uint32_t  flags = icf_none 
)
static

isEqual checks whether two reference units are equal.

Parameters
[in]ref_unit1The first unit.
[in]source_dd_of_ref_unit1The DataDefinition where all references of ref_unit1 are defined
[in]ref_unit2The second unit.
[in]source_dd_of_ref_unit2The DataDefinition where all references of ref_unit2 are defined
[in]flagsFlags that specifiy what should be checked, see ItemCheckFlags.
Return values
a_util::result::SUCCESSThe descriptions are equal.
ERR_FAILEDThe description are not equal.
Standardresult (other DataDefinition parsing errors etc.)

◆ isEqual() [13/14]

static a_util::result::Result isEqual ( const dd::UnitPrefix prefix1,
const dd::UnitPrefix prefix2,
uint32_t  flags = icf_none 
)
static

isEqual checks whether two prefix descriptions are equal.

Parameters
[in]prefix1The first prefix.
[in]prefix2The second prefix.
[in]flagsFlags that specifiy what should be checked, see ItemCheckFlags.
Return values
a_util::result::SUCCESSThe descriptions are equal.
ERR_FAILEDThe description are not equal.
Standardresult (other DataDefinition parsing errors etc.)

◆ isEqual() [14/14]

static a_util::result::Result isEqual ( const std::string &  desc1,
const std::string &  desc2,
uint32_t  flags = dcf_all|dcf_subset 
)
static

isEqual checks whether two descriptions are equal.

Parameters
[in]desc1The first description.
[in]desc2The second description.
[in]flagsFlags that specifiy what should be checked, see DescriptionCheckFlags.
Return values
a_util::result::SUCCESSThe descriptions are equal.
ERR_FAILEDThe description are not equal.
Standardresult (other DataDefinition parsing errors etc.)

◆ isEqualPrefix()

static a_util::result::Result isEqualPrefix ( const std::string &  prefix1,
const std::string &  desc1,
const std::string &  prefix2,
const std::string &  desc2,
uint32_t  flags = icf_none 
)
static

isEqualPrefix checks whether two prefix descriptions are equal.

Parameters
[in]prefix1The name of the first prefix.
[in]desc1The description that has prefix1.
[in]prefix2The name of the second prefix.
[in]desc2The description that has prefix2.
[in]flagsFlags that specifiy what should be checked, see ItemCheckFlags.
Return values
a_util::result::SUCCESSThe descriptions are equal.
ERR_FAILEDThe description are not equal.
Standardresult (other DataDefinition parsing errors etc.)

◆ isEqualStream()

static a_util::result::Result isEqualStream ( const std::string &  stream1,
const std::string &  desc1,
const std::string &  stream2,
const std::string &  desc2,
uint32_t  flags = icf_memory 
)
static

isEqual checks whether two stream descriptions are equal.

Parameters
[in]stream1The name of the first stream.
[in]desc1The description that has stream1.
[in]stream2The name of the second stream.
[in]desc2The description that has stream2.
[in]flagsFlags that specifiy what should be checked, see ItemCheckFlags.
Return values
a_util::result::SUCCESSThe descriptions are equal.
ERR_FAILEDThe description are not equal.
Standardresult (other DataDefinition parsing errors etc.)

◆ isEqualType()

static a_util::result::Result isEqualType ( const std::string &  type1,
const std::string &  desc1,
const std::string &  type2,
const std::string &  desc2,
uint32_t  flags = icf_memory 
)
static

isEqual checks whether two type (POD/enum/struct) descriptions are equal.

When this is true for a struct then it also implies isBinaryEqual is true

Parameters
[in]type1The name of the first type.
[in]desc1The description that has type1.
[in]type2The name of the second type.
[in]desc2The description that has type2.
[in]flagsFlags that specifiy what should be checked, see ItemCheckFlags.
Return values
a_util::result::SUCCESSThe descriptions are equal.
ERR_FAILEDThe description are not equal.
Standardresult (other DataDefinition parsing errors etc.)

◆ isEqualUnit()

static a_util::result::Result isEqualUnit ( const std::string &  unit1,
const std::string &  desc1,
const std::string &  unit2,
const std::string &  desc2,
uint32_t  flags = icf_none 
)
static

isEqualUnit checks whether two unit descriptions are equal.

Parameters
[in]unit1The name of the first type.
[in]desc1The description that has unit1.
[in]unit2The name of the second type.
[in]desc2The description that has unit2.
[in]flagsFlags that specifiy what should be checked, see ItemCheckFlags.
Return values
a_util::result::SUCCESSThe descriptions are equal.
ERR_FAILEDThe description are not equal.
Standardresult (other DataDefinition parsing errors etc.)