| 348 | } |
| 349 | |
| 350 | TypeIdentifier 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 | |
| 371 | AnnotationParameterValue::AnnotationParameterValue(ACE_CDR::Octet kind) |
| 372 | : kind_(kind) |