From 4a76617dd891428f0511c8c6c9c1e4157088f7bf Mon Sep 17 00:00:00 2001 From: Miguel Company Date: Fri, 30 May 2025 11:06:20 +0200 Subject: [PATCH 1/2] Refs #22188. Regenerate Shape with Fast DDS Gen v2.5.3 Signed-off-by: Miguel Company --- types/Shape.cxx | 3 ++- types/Shape.h | 19 ++++++++++--------- types/ShapePubSubTypes.cxx | 12 ++++++------ types/ShapePubSubTypes.h | 10 +++++++--- types/ShapeTypeObject.cxx | 17 +++++++++++------ types/ShapeTypeObject.h | 2 +- 6 files changed, 37 insertions(+), 26 deletions(-) diff --git a/types/Shape.cxx b/types/Shape.cxx index b782a01..18dcfda 100644 --- a/types/Shape.cxx +++ b/types/Shape.cxx @@ -16,7 +16,7 @@ * @file Shape.cpp * This source file contains the definition of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 2.5.3). */ #ifdef _WIN32 @@ -312,3 +312,4 @@ void ShapeType::serializeKey( } + diff --git a/types/Shape.h b/types/Shape.h index 3733e64..fb09a77 100644 --- a/types/Shape.h +++ b/types/Shape.h @@ -16,7 +16,7 @@ * @file Shape.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 2.5.3). */ #ifndef _FAST_DDS_GENERATED_SHAPE_H_ @@ -44,16 +44,16 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(Shape_SOURCE) -#define Shape_DllAPI __declspec( dllexport ) +#if defined(SHAPE_SOURCE) +#define SHAPE_DllAPI __declspec( dllexport ) #else -#define Shape_DllAPI __declspec( dllimport ) -#endif // Shape_SOURCE +#define SHAPE_DllAPI __declspec( dllimport ) +#endif // SHAPE_SOURCE #else -#define Shape_DllAPI +#define SHAPE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define Shape_DllAPI +#define SHAPE_DllAPI #endif // _WIN32 namespace eprosima { @@ -65,7 +65,7 @@ class Cdr; /*! * @brief This class represents the structure ShapeType defined by the user in the IDL file. - * @ingroup SHAPE + * @ingroup Shape */ class ShapeType { @@ -272,4 +272,5 @@ class ShapeType }; -#endif // _FAST_DDS_GENERATED_SHAPE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_SHAPE_H_ + diff --git a/types/ShapePubSubTypes.cxx b/types/ShapePubSubTypes.cxx index e5a743a..d83962c 100644 --- a/types/ShapePubSubTypes.cxx +++ b/types/ShapePubSubTypes.cxx @@ -16,7 +16,7 @@ * @file ShapePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 2.5.3). */ @@ -60,15 +60,15 @@ bool ShapeTypePubSubType::serialize( // Object that serializes the data. eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); try { + // Serialize encapsulation + ser.serialize_encapsulation(); // Serialize the object. p_type->serialize(ser); } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + catch (eprosima::fastcdr::exception::Exception& /*exception*/) { return false; } @@ -84,7 +84,7 @@ bool ShapeTypePubSubType::deserialize( { try { - //Convert DATA to pointer of your type + // Convert DATA to pointer of your type ShapeType* p_type = static_cast(data); // Object that manages the raw buffer. @@ -100,7 +100,7 @@ bool ShapeTypePubSubType::deserialize( // Deserialize the object. p_type->deserialize(deser); } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + catch (eprosima::fastcdr::exception::Exception& /*exception*/) { return false; } diff --git a/types/ShapePubSubTypes.h b/types/ShapePubSubTypes.h index 77c1fda..2d5e586 100644 --- a/types/ShapePubSubTypes.h +++ b/types/ShapePubSubTypes.h @@ -16,7 +16,7 @@ * @file ShapePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 2.5.3). */ @@ -28,14 +28,16 @@ #include "Shape.h" + #if !defined(GEN_API_VER) || (GEN_API_VER != 1) #error \ Generated Shape is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER + /*! * @brief This class represents the TopicDataType of the type ShapeType defined by the user in the IDL file. - * @ingroup SHAPE + * @ingroup Shape */ class ShapeTypePubSubType : public eprosima::fastdds::dds::TopicDataType { @@ -96,6 +98,8 @@ class ShapeTypePubSubType : public eprosima::fastdds::dds::TopicDataType MD5 m_md5; unsigned char* m_keyBuffer; + }; -#endif // _FAST_DDS_GENERATED_SHAPE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_SHAPE_PUBSUBTYPES_H_ + diff --git a/types/ShapeTypeObject.cxx b/types/ShapeTypeObject.cxx index d4dd8ae..aa466ba 100644 --- a/types/ShapeTypeObject.cxx +++ b/types/ShapeTypeObject.cxx @@ -16,7 +16,7 @@ * @file ShapeTypeObject.cpp * This source file contains the definition of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 2.5.3). */ #ifdef _WIN32 @@ -26,6 +26,7 @@ namespace { char dummy; } #include "Shape.h" #include "ShapeTypeObject.h" +#include #include #include #include @@ -40,12 +41,16 @@ using namespace eprosima::fastrtps::rtps; void registerShapeTypes() { - TypeObjectFactory *factory = TypeObjectFactory::get_instance(); - factory->add_type_object("ShapeType", GetShapeTypeIdentifier(true), - GetShapeTypeObject(true)); - factory->add_type_object("ShapeType", GetShapeTypeIdentifier(false), - GetShapeTypeObject(false)); + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + TypeObjectFactory *factory = TypeObjectFactory::get_instance(); + factory->add_type_object("ShapeType", GetShapeTypeIdentifier(true), + GetShapeTypeObject(true)); + factory->add_type_object("ShapeType", GetShapeTypeIdentifier(false), + GetShapeTypeObject(false)); + }); } const TypeIdentifier* GetShapeTypeIdentifier(bool complete) diff --git a/types/ShapeTypeObject.h b/types/ShapeTypeObject.h index f689fb2..0c3d34d 100644 --- a/types/ShapeTypeObject.h +++ b/types/ShapeTypeObject.h @@ -16,7 +16,7 @@ * @file ShapeTypeObject.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 2.5.3). */ #ifndef _FAST_DDS_GENERATED_SHAPE_TYPE_OBJECT_H_ From f7b3b2842bbbf7152b25124a358d989ea35637ae Mon Sep 17 00:00:00 2001 From: Miguel Company Date: Fri, 30 May 2025 11:07:52 +0200 Subject: [PATCH 2/2] Refs #22188. Regenerate KeylessShape with Fast DDS Gen v2.5.3 Signed-off-by: Miguel Company --- types/KeylessShapeType.cxx | 3 ++- types/KeylessShapeType.h | 19 ++++++++++--------- types/KeylessShapeTypePubSubTypes.cxx | 14 ++++++++------ types/KeylessShapeTypePubSubTypes.h | 10 +++++++--- types/KeylessShapeTypeTypeObject.cxx | 17 +++++++++++------ types/KeylessShapeTypeTypeObject.h | 2 +- 6 files changed, 39 insertions(+), 26 deletions(-) diff --git a/types/KeylessShapeType.cxx b/types/KeylessShapeType.cxx index d392df0..6b86ee6 100644 --- a/types/KeylessShapeType.cxx +++ b/types/KeylessShapeType.cxx @@ -16,7 +16,7 @@ * @file KeylessShapeType.cpp * This source file contains the definition of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 2.5.3). */ #ifdef _WIN32 @@ -309,3 +309,4 @@ void shapes_demo_typesupport::idl::KeylessShapeType::serializeKey( } + diff --git a/types/KeylessShapeType.h b/types/KeylessShapeType.h index 127ce9c..a0450a7 100644 --- a/types/KeylessShapeType.h +++ b/types/KeylessShapeType.h @@ -16,7 +16,7 @@ * @file KeylessShapeType.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 2.5.3). */ #ifndef _FAST_DDS_GENERATED_SHAPES_DEMO_TYPESUPPORT_IDL_KEYLESSSHAPETYPE_H_ @@ -44,16 +44,16 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(KeylessShapeType_SOURCE) -#define KeylessShapeType_DllAPI __declspec( dllexport ) +#if defined(KEYLESSSHAPETYPE_SOURCE) +#define KEYLESSSHAPETYPE_DllAPI __declspec( dllexport ) #else -#define KeylessShapeType_DllAPI __declspec( dllimport ) -#endif // KeylessShapeType_SOURCE +#define KEYLESSSHAPETYPE_DllAPI __declspec( dllimport ) +#endif // KEYLESSSHAPETYPE_SOURCE #else -#define KeylessShapeType_DllAPI +#define KEYLESSSHAPETYPE_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define KeylessShapeType_DllAPI +#define KEYLESSSHAPETYPE_DllAPI #endif // _WIN32 namespace eprosima { @@ -67,7 +67,7 @@ namespace shapes_demo_typesupport { namespace idl { /*! * @brief This class represents the structure KeylessShapeType defined by the user in the IDL file. - * @ingroup KEYLESSSHAPETYPE + * @ingroup KeylessShapeType */ class KeylessShapeType { @@ -276,4 +276,5 @@ namespace shapes_demo_typesupport { } // namespace idl } // namespace shapes_demo_typesupport -#endif // _FAST_DDS_GENERATED_SHAPES_DEMO_TYPESUPPORT_IDL_KEYLESSSHAPETYPE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_SHAPES_DEMO_TYPESUPPORT_IDL_KEYLESSSHAPETYPE_H_ + diff --git a/types/KeylessShapeTypePubSubTypes.cxx b/types/KeylessShapeTypePubSubTypes.cxx index 1ac1c75..a0b9b95 100644 --- a/types/KeylessShapeTypePubSubTypes.cxx +++ b/types/KeylessShapeTypePubSubTypes.cxx @@ -16,7 +16,7 @@ * @file KeylessShapeTypePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 2.5.3). */ @@ -62,15 +62,15 @@ namespace shapes_demo_typesupport { // Object that serializes the data. eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); payload->encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE; - // Serialize encapsulation - ser.serialize_encapsulation(); try { + // Serialize encapsulation + ser.serialize_encapsulation(); // Serialize the object. p_type->serialize(ser); } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + catch (eprosima::fastcdr::exception::Exception& /*exception*/) { return false; } @@ -86,7 +86,7 @@ namespace shapes_demo_typesupport { { try { - //Convert DATA to pointer of your type + // Convert DATA to pointer of your type KeylessShapeType* p_type = static_cast(data); // Object that manages the raw buffer. @@ -102,7 +102,7 @@ namespace shapes_demo_typesupport { // Deserialize the object. p_type->deserialize(deser); } - catch (eprosima::fastcdr::exception::NotEnoughMemoryException& /*exception*/) + catch (eprosima::fastcdr::exception::Exception& /*exception*/) { return false; } @@ -173,4 +173,6 @@ namespace shapes_demo_typesupport { } //End of namespace idl + } //End of namespace shapes_demo_typesupport + diff --git a/types/KeylessShapeTypePubSubTypes.h b/types/KeylessShapeTypePubSubTypes.h index 892983b..8431cfc 100644 --- a/types/KeylessShapeTypePubSubTypes.h +++ b/types/KeylessShapeTypePubSubTypes.h @@ -16,7 +16,7 @@ * @file KeylessShapeTypePubSubTypes.h * This header file contains the declaration of the serialization functions. * - * This file was generated by the tool fastcdrgen. + * This file was generated by the tool fastddsgen (version: 2.5.3). */ @@ -28,6 +28,7 @@ #include "KeylessShapeType.h" + #if !defined(GEN_API_VER) || (GEN_API_VER != 1) #error \ Generated KeylessShapeType is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. @@ -37,9 +38,10 @@ namespace shapes_demo_typesupport { namespace idl { + /*! * @brief This class represents the TopicDataType of the type KeylessShapeType defined by the user in the IDL file. - * @ingroup KEYLESSSHAPETYPE + * @ingroup KeylessShapeType */ class KeylessShapeTypePubSubType : public eprosima::fastdds::dds::TopicDataType { @@ -100,8 +102,10 @@ namespace shapes_demo_typesupport MD5 m_md5; unsigned char* m_keyBuffer; + }; } } -#endif // _FAST_DDS_GENERATED_SHAPES_DEMO_TYPESUPPORT_IDL_KEYLESSSHAPETYPE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_SHAPES_DEMO_TYPESUPPORT_IDL_KEYLESSSHAPETYPE_PUBSUBTYPES_H_ + diff --git a/types/KeylessShapeTypeTypeObject.cxx b/types/KeylessShapeTypeTypeObject.cxx index 0d7ce25..a62af19 100644 --- a/types/KeylessShapeTypeTypeObject.cxx +++ b/types/KeylessShapeTypeTypeObject.cxx @@ -16,7 +16,7 @@ * @file KeylessShapeTypeTypeObject.cpp * This source file contains the definition of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 2.5.3). */ #ifdef _WIN32 @@ -26,6 +26,7 @@ namespace { char dummy; } #include "KeylessShapeType.h" #include "KeylessShapeTypeTypeObject.h" +#include #include #include #include @@ -40,14 +41,18 @@ using namespace eprosima::fastrtps::rtps; void registerKeylessShapeTypeTypes() { - TypeObjectFactory *factory = TypeObjectFactory::get_instance(); - factory->add_type_object("shapes_demo_typesupport::idl::dds_::KeylessShapeType_", shapes_demo_typesupport::idl::GetKeylessShapeTypeIdentifier(true), - shapes_demo_typesupport::idl::GetKeylessShapeTypeObject(true)); - factory->add_type_object("shapes_demo_typesupport::idl::dds_::KeylessShapeType_", shapes_demo_typesupport::idl::GetKeylessShapeTypeIdentifier(false), - shapes_demo_typesupport::idl::GetKeylessShapeTypeObject(false)); + static std::once_flag once_flag; + std::call_once(once_flag, []() + { + TypeObjectFactory *factory = TypeObjectFactory::get_instance(); + factory->add_type_object("shapes_demo_typesupport::idl::dds_::KeylessShapeType_", shapes_demo_typesupport::idl::GetKeylessShapeTypeIdentifier(true), + shapes_demo_typesupport::idl::GetKeylessShapeTypeObject(true)); + factory->add_type_object("shapes_demo_typesupport::idl::dds_::KeylessShapeType_", shapes_demo_typesupport::idl::GetKeylessShapeTypeIdentifier(false), + shapes_demo_typesupport::idl::GetKeylessShapeTypeObject(false)); + }); } namespace shapes_demo_typesupport { diff --git a/types/KeylessShapeTypeTypeObject.h b/types/KeylessShapeTypeTypeObject.h index 9481873..7dc38f3 100644 --- a/types/KeylessShapeTypeTypeObject.h +++ b/types/KeylessShapeTypeTypeObject.h @@ -16,7 +16,7 @@ * @file KeylessShapeTypeTypeObject.h * This header file contains the declaration of the described types in the IDL file. * - * This file was generated by the tool gen. + * This file was generated by the tool fastddsgen (version: 2.5.3). */ #ifndef _FAST_DDS_GENERATED_SHAPES_DEMO_TYPESUPPORT_IDL_KEYLESSSHAPETYPE_TYPE_OBJECT_H_