From e4752c25aa1711b2bb503fef6f65ae12269ab05d Mon Sep 17 00:00:00 2001 From: Miguel Company Date: Thu, 12 Mar 2026 09:26:24 +0100 Subject: [PATCH] Refs #23874. Regenerate code with Fast DDS Gen v4.0.6. Signed-off-by: Miguel Company --- .../C++/DDSHelloWorld/src/HelloWorld.hpp | 2 +- .../DDSHelloWorld/src/HelloWorldCdrAux.hpp | 2 +- .../DDSHelloWorld/src/HelloWorldCdrAux.ipp | 2 +- .../src/HelloWorldPubSubTypes.cxx | 70 +++++-------------- .../src/HelloWorldPubSubTypes.hpp | 7 +- .../src/HelloWorldTypeObjectSupport.cxx | 2 +- .../src/HelloWorldTypeObjectSupport.hpp | 2 +- 7 files changed, 24 insertions(+), 63 deletions(-) diff --git a/code/Examples/C++/DDSHelloWorld/src/HelloWorld.hpp b/code/Examples/C++/DDSHelloWorld/src/HelloWorld.hpp index 8b943242e..b80e4e9aa 100644 --- a/code/Examples/C++/DDSHelloWorld/src/HelloWorld.hpp +++ b/code/Examples/C++/DDSHelloWorld/src/HelloWorld.hpp @@ -16,7 +16,7 @@ * @file HelloWorld.hpp * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool fastddsgen (version: 4.0.5). + * This file was generated by the tool fastddsgen (version: 4.0.6). */ #ifndef FAST_DDS_GENERATED__HELLOWORLD_HPP diff --git a/code/Examples/C++/DDSHelloWorld/src/HelloWorldCdrAux.hpp b/code/Examples/C++/DDSHelloWorld/src/HelloWorldCdrAux.hpp index f8ceda861..de6f08c59 100644 --- a/code/Examples/C++/DDSHelloWorld/src/HelloWorldCdrAux.hpp +++ b/code/Examples/C++/DDSHelloWorld/src/HelloWorldCdrAux.hpp @@ -16,7 +16,7 @@ * @file HelloWorldCdrAux.hpp * This source file contains some definitions of CDR related functions. * - * This file was generated by the tool fastddsgen (version: 4.0.5). + * This file was generated by the tool fastddsgen (version: 4.0.6). */ #ifndef FAST_DDS_GENERATED__HELLOWORLDCDRAUX_HPP diff --git a/code/Examples/C++/DDSHelloWorld/src/HelloWorldCdrAux.ipp b/code/Examples/C++/DDSHelloWorld/src/HelloWorldCdrAux.ipp index b5e0d8482..2c11e2562 100644 --- a/code/Examples/C++/DDSHelloWorld/src/HelloWorldCdrAux.ipp +++ b/code/Examples/C++/DDSHelloWorld/src/HelloWorldCdrAux.ipp @@ -16,7 +16,7 @@ * @file HelloWorldCdrAux.ipp * This source file contains some declarations of CDR related functions. * - * This file was generated by the tool fastddsgen (version: 4.0.5). + * This file was generated by the tool fastddsgen (version: 4.0.6). */ #ifndef FAST_DDS_GENERATED__HELLOWORLDCDRAUX_IPP diff --git a/code/Examples/C++/DDSHelloWorld/src/HelloWorldPubSubTypes.cxx b/code/Examples/C++/DDSHelloWorld/src/HelloWorldPubSubTypes.cxx index 682d6be9c..403ea1b41 100644 --- a/code/Examples/C++/DDSHelloWorld/src/HelloWorldPubSubTypes.cxx +++ b/code/Examples/C++/DDSHelloWorld/src/HelloWorldPubSubTypes.cxx @@ -16,11 +16,14 @@ * @file HelloWorldPubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastddsgen (version: 4.0.5). + * This file was generated by the tool fastddsgen (version: 4.0.6). */ #include "HelloWorldPubSubTypes.hpp" +#include +#include + #include #include @@ -38,17 +41,10 @@ HelloWorldPubSubType::HelloWorldPubSubType() type_size += static_cast(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ max_serialized_type_size = type_size + 4; /*encapsulation*/ is_compute_key_provided = false; - uint32_t key_length = HelloWorld_max_key_cdr_typesize > 16 ? HelloWorld_max_key_cdr_typesize : 16; - key_buffer_ = reinterpret_cast(malloc(key_length)); - memset(key_buffer_, 0, key_length); } HelloWorldPubSubType::~HelloWorldPubSubType() { - if (key_buffer_ != nullptr) - { - free(key_buffer_); - } } bool HelloWorldPubSubType::serialize( @@ -56,7 +52,8 @@ bool HelloWorldPubSubType::serialize( SerializedPayload_t& payload, DataRepresentationId_t data_representation) { - const HelloWorld* p_type = static_cast(data); + const HelloWorld* p_type = + static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.max_size); @@ -76,7 +73,7 @@ bool HelloWorldPubSubType::serialize( ser.serialize_encapsulation(); // Serialize the object. ser << *p_type; - ser.set_dds_cdr_options({0,0}); + ser.set_dds_cdr_options({0, 0}); } catch (eprosima::fastcdr::exception::Exception& /*exception*/) { @@ -95,7 +92,8 @@ bool HelloWorldPubSubType::deserialize( try { // Convert DATA to pointer of your type - HelloWorld* p_type = static_cast(data); + HelloWorld* p_type = + static_cast(data); // Object that manages the raw buffer. eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(payload.data), payload.length); @@ -154,16 +152,9 @@ bool HelloWorldPubSubType::compute_key( InstanceHandle_t& handle, bool force_md5) { - if (!is_compute_key_provided) - { - return false; - } - - HelloWorld data; - if (deserialize(payload, static_cast(&data))) - { - return compute_key(static_cast(&data), handle, force_md5); - } + static_cast(payload); + static_cast(handle); + static_cast(force_md5); return false; } @@ -173,39 +164,11 @@ bool HelloWorldPubSubType::compute_key( InstanceHandle_t& handle, bool force_md5) { - if (!is_compute_key_provided) - { - return false; - } + static_cast(data); + static_cast(handle); + static_cast(force_md5); - const HelloWorld* p_type = static_cast(data); - - // Object that manages the raw buffer. - eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast(key_buffer_), - HelloWorld_max_key_cdr_typesize); - - // Object that serializes the data. - eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2); - ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); - eprosima::fastcdr::serialize_key(ser, *p_type); - if (force_md5 || HelloWorld_max_key_cdr_typesize > 16) - { - md5_.init(); - md5_.update(key_buffer_, static_cast(ser.get_serialized_data_length())); - md5_.finalize(); - for (uint8_t i = 0; i < 16; ++i) - { - handle.value[i] = md5_.digest[i]; - } - } - else - { - for (uint8_t i = 0; i < 16; ++i) - { - handle.value[i] = key_buffer_[i]; - } - } - return true; + return false; } void HelloWorldPubSubType::register_type_object_representation() @@ -213,6 +176,5 @@ void HelloWorldPubSubType::register_type_object_representation() register_HelloWorld_type_identifier(type_identifiers_); } - // Include auxiliary functions like for serializing/deserializing. #include "HelloWorldCdrAux.ipp" diff --git a/code/Examples/C++/DDSHelloWorld/src/HelloWorldPubSubTypes.hpp b/code/Examples/C++/DDSHelloWorld/src/HelloWorldPubSubTypes.hpp index d9e1799e5..9b8074457 100644 --- a/code/Examples/C++/DDSHelloWorld/src/HelloWorldPubSubTypes.hpp +++ b/code/Examples/C++/DDSHelloWorld/src/HelloWorldPubSubTypes.hpp @@ -16,13 +16,15 @@ * @file HelloWorldPubSubTypes.hpp * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastddsgen (version: 4.0.5). + * This file was generated by the tool fastddsgen (version: 4.0.6). */ #ifndef FAST_DDS_GENERATED__HELLOWORLD_PUBSUBTYPES_HPP #define FAST_DDS_GENERATED__HELLOWORLD_PUBSUBTYPES_HPP +#include + #include #include #include @@ -114,9 +116,6 @@ class HelloWorldPubSubType : public eprosima::fastdds::dds::TopicDataType private: - eprosima::fastdds::MD5 md5_; - unsigned char* key_buffer_; - }; #endif // FAST_DDS_GENERATED__HELLOWORLD_PUBSUBTYPES_HPP diff --git a/code/Examples/C++/DDSHelloWorld/src/HelloWorldTypeObjectSupport.cxx b/code/Examples/C++/DDSHelloWorld/src/HelloWorldTypeObjectSupport.cxx index 535191b4e..fffd4a870 100644 --- a/code/Examples/C++/DDSHelloWorld/src/HelloWorldTypeObjectSupport.cxx +++ b/code/Examples/C++/DDSHelloWorld/src/HelloWorldTypeObjectSupport.cxx @@ -16,7 +16,7 @@ * @file HelloWorldTypeObjectSupport.cxx * Source file containing the implementation to register the TypeObject representation of the described types in the IDL file * - * This file was generated by the tool fastddsgen (version: 4.0.5). + * This file was generated by the tool fastddsgen (version: 4.0.6). */ #include "HelloWorldTypeObjectSupport.hpp" diff --git a/code/Examples/C++/DDSHelloWorld/src/HelloWorldTypeObjectSupport.hpp b/code/Examples/C++/DDSHelloWorld/src/HelloWorldTypeObjectSupport.hpp index 4e6b30fca..9892c7148 100644 --- a/code/Examples/C++/DDSHelloWorld/src/HelloWorldTypeObjectSupport.hpp +++ b/code/Examples/C++/DDSHelloWorld/src/HelloWorldTypeObjectSupport.hpp @@ -16,7 +16,7 @@ * @file HelloWorldTypeObjectSupport.hpp * Header file containing the API required to register the TypeObject representation of the described types in the IDL file * - * This file was generated by the tool fastddsgen (version: 4.0.5). + * This file was generated by the tool fastddsgen (version: 4.0.6). */ #ifndef FAST_DDS_GENERATED__HELLOWORLD_TYPE_OBJECT_SUPPORT_HPP