MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / makeTypeIdentifier

Function makeTypeIdentifier

dds/DCPS/XTypes/TypeObject.cpp:350–369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

348}
349
350TypeIdentifier makeTypeIdentifier(const TypeObject& type_object, const DCPS::Encoding* encoding_option)
351{
352 OPENDDS_ASSERT(type_object.kind == EK_MINIMAL || type_object.kind == EK_COMPLETE);
353
354 const Encoding& encoding = encoding_option ? *encoding_option : get_typeobject_encoding();
355 size_t size = serialized_size(encoding, type_object);
356 ACE_Message_Block buff(size);
357 DCPS::Serializer ser(&buff, encoding);
358 ser << type_object;
359
360 unsigned char result[16];
361 DCPS::MD5Hash(result, buff.rd_ptr(), buff.length());
362
363 // First 14 bytes of MD5 of the serialized TypeObject using XCDR
364 // version 2 with Little Endian encoding
365 TypeIdentifier ti(type_object.kind);
366 std::memcpy(ti.equivalence_hash(), result, sizeof(EquivalenceHash));
367
368 return ti;
369}
370
371AnnotationParameterValue::AnnotationParameterValue(ACE_CDR::Octet kind)
372 : kind_(kind)

Callers 8

update_mapsMethod · 0.85
to_type_info_iMethod · 0.85
add_typesMethod · 0.85
replace_objectMethod · 0.85
remove_enumeratorsFunction · 0.85
TESTFunction · 0.85
verify_union_discFunction · 0.85
verify_long10seqFunction · 0.85

Calls 3

MD5HashFunction · 0.85
serialized_sizeFunction · 0.70
lengthMethod · 0.45

Tested by 2

verify_union_discFunction · 0.68
verify_long10seqFunction · 0.68