diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a4d172..dcab3df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -194,30 +194,30 @@ set(CMAKE_AUTOUIC_SEARCH_PATHS forms) message(STATUS "Configuring ShapesDemo...") set( SHAPESDEMO_SOURCES + images/eprosima_icon.rc + src/main.cpp + src/qt/ContentFilterSelector.cpp src/qt/DrawArea.cpp src/qt/mainwindow.cpp + src/qt/optionsdialog.cpp + src/qt/participantdialog.cpp src/qt/publishdialog.cpp src/qt/subscribedialog.cpp - src/shapesdemo/Shape.cxx - src/shapesdemo/ShapesDemo.cpp - src/shapesdemo/ShapePubSubTypes.cxx - src/shapesdemo/ShapeTypeObject.cxx - src/main.cpp - src/shapesdemo/ShapePublisher.cpp src/qt/UpdateThread.cpp - src/shapesdemo/ShapeSubscriber.cpp - src/qt/optionsdialog.cpp - src/qt/participantdialog.cpp - src/qt/ContentFilterSelector.cpp src/shapesdemo/ShapeHistory.cpp - images/eprosima_icon.rc + src/shapesdemo/ShapePublisher.cpp + src/shapesdemo/ShapesDemo.cpp + src/shapesdemo/ShapeSubscriber.cpp + types/Shape.cxx + types/ShapePubSubTypes.cxx + types/ShapeTypeObject.cxx ) if(BUILD_ROS_COMPONENTS) list( APPEND SHAPESDEMO_SOURCES - src/shapesdemo/KeylessShape.cxx - src/shapesdemo/KeylessShapePubSubTypes.cxx - src/shapesdemo/KeylessShapeTypeObject.cxx + types/KeylessShapeType.cxx + types/KeylessShapeTypePubSubTypes.cxx + types/KeylessShapeTypeTypeObject.cxx ) endif() @@ -233,7 +233,7 @@ else() endif() target_compile_definitions(${PROJECT_NAME} PRIVATE -D${SHAPESVERSION}) -target_include_directories(${PROJECT_NAME} PRIVATE include ${IU_HEADERS}) +target_include_directories(${PROJECT_NAME} PRIVATE include types ${IU_HEADERS}) if(BUILD_ROS_COMPONENTS) target_compile_definitions(${PROJECT_NAME} PRIVATE -DENABLE_ROS_COMPONENTS) diff --git a/idl/README.md b/idl/README.md new file mode 100644 index 0000000..14e7e46 --- /dev/null +++ b/idl/README.md @@ -0,0 +1,5 @@ +*eProsima Shapes Demo* supports two different TypeSupports: + +* Shape.idl which can be found in this folder +* KeylessShapeType.idl specifically included for ROS 2 purposes (current ROS 2 Humble does not support Topic instances). + This IDL can be found in [ShapesDemo-TypeSupport](https://github.com/eProsima/ShapesDemo-TypeSupport) repository. diff --git a/include/eprosimashapesdemo/shapesdemo/ShapeInfo.h b/include/eprosimashapesdemo/shapesdemo/ShapeInfo.h index 4d7438d..687b3b3 100644 --- a/include/eprosimashapesdemo/shapesdemo/ShapeInfo.h +++ b/include/eprosimashapesdemo/shapesdemo/ShapeInfo.h @@ -25,16 +25,16 @@ #ifndef _SHAPEINFO_H_ #define _SHAPEINFO_H_ -#include -#include -#include - #include -#include #include +#include + +#include +#include +#include #include "eprosimashapesdemo/shapesdemo/ShapeDefinitions.h" -#include "eprosimashapesdemo/shapesdemo/ShapePubSubTypes.h" +#include "types/ShapePubSubTypes.h" using namespace eprosima::fastrtps; @@ -129,13 +129,10 @@ class ColorInstanceHandle }; - -const ColorInstanceHandle c_ShapesHandles; - - inline SD_COLOR getColorFromInstanceHandle( rtps::InstanceHandle_t& iHandle) { + static const ColorInstanceHandle c_ShapesHandles; if (iHandle == c_ShapesHandles.BlueIH.second) { return SD_BLUE; diff --git a/include/eprosimashapesdemo/shapesdemo/ShapeSubscriber.h b/include/eprosimashapesdemo/shapesdemo/ShapeSubscriber.h index 513b9ff..86b93c2 100644 --- a/include/eprosimashapesdemo/shapesdemo/ShapeSubscriber.h +++ b/include/eprosimashapesdemo/shapesdemo/ShapeSubscriber.h @@ -25,10 +25,6 @@ #include -#include "eprosimashapesdemo/shapesdemo/Shape.h" -#include "eprosimashapesdemo/shapesdemo/ShapeHistory.h" -#include "eprosimashapesdemo/shapesdemo/ShapesDemo.h" - #include #include #include @@ -36,6 +32,10 @@ #include #include +#include "eprosimashapesdemo/shapesdemo/ShapeHistory.h" +#include "eprosimashapesdemo/shapesdemo/ShapesDemo.h" +#include "types/Shape.h" + using namespace eprosima::fastdds::dds; class ContentFilterSelector; diff --git a/include/eprosimashapesdemo/shapesdemo/ShapesDemo.h b/include/eprosimashapesdemo/shapesdemo/ShapesDemo.h index 1fd7ab4..0162ea0 100644 --- a/include/eprosimashapesdemo/shapesdemo/ShapesDemo.h +++ b/include/eprosimashapesdemo/shapesdemo/ShapesDemo.h @@ -28,9 +28,6 @@ #include -#include "eprosimashapesdemo/shapesdemo/ShapePubSubTypes.h" -#include "eprosimashapesdemo/shapesdemo/ShapeDefinitions.h" - #include #include #include @@ -41,6 +38,9 @@ #include #include +#include "eprosimashapesdemo/shapesdemo/ShapeDefinitions.h" +#include "types/ShapePubSubTypes.h" + using namespace eprosima::fastdds::dds; std::string qos_policy_id_to_string( diff --git a/src/shapesdemo/ShapesDemo.cpp b/src/shapesdemo/ShapesDemo.cpp index 2f67f59..3448df7 100644 --- a/src/shapesdemo/ShapesDemo.cpp +++ b/src/shapesdemo/ShapesDemo.cpp @@ -15,29 +15,30 @@ // You should have received a copy of the GNU General Public License // along with eProsima Fast DDS Shapes Demo. If not, see . +#include + +#include #include #include -#include - -#include -#include -#include -#include -#include -#ifdef ENABLE_ROS_COMPONENTS -#include -#include -#endif // ifdef ENABLE_ROS_COMPONENTS -#include #include +#include #include #include -#include #include // FASTDDS_STATISTICS availability #include #include +#include +#include +#include +#include +#include +#ifdef ENABLE_ROS_COMPONENTS +#include +#include +#endif // ifdef ENABLE_ROS_COMPONENTS + using namespace eprosima::fastdds::dds; using namespace eprosima::fastdds::rtps; using namespace eprosima::fastrtps::rtps; @@ -71,7 +72,7 @@ ShapesDemo::ShapesDemo( m_ros_type->auto_fill_type_object(false); m_ros_type->auto_fill_type_information(true); - registerKeylessShapeTypes(); + registerKeylessShapeTypeTypes(); #endif // ifdef ENABLE_ROS_COMPONENTS registerShapeTypes(); diff --git a/src/shapesdemo/KeylessShape.cxx b/types/KeylessShapeType.cxx similarity index 93% rename from src/shapesdemo/KeylessShape.cxx rename to types/KeylessShapeType.cxx index 6e8c9c5..e0e051a 100644 --- a/src/shapesdemo/KeylessShape.cxx +++ b/types/KeylessShapeType.cxx @@ -13,7 +13,7 @@ // limitations under the License. /*! - * @file KeylessShape.cpp + * @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. @@ -26,8 +26,8 @@ char dummy; } // namespace #endif // _WIN32 -#include "eprosimashapesdemo/shapesdemo/KeylessShape.h" -#include "eprosimashapesdemo/shapesdemo/KeylessShapeTypeObject.h" +#include "KeylessShapeType.h" +#include "KeylessShapeTypeTypeObject.h" #include #include @@ -37,17 +37,17 @@ using namespace eprosima::fastcdr::exception; shapes_demo_typesupport::idl::KeylessShapeType::KeylessShapeType() { - // m_color com.eprosima.idl.parser.typecode.StringTypeCode@3a883ce7 + // m_color com.eprosima.idl.parser.typecode.StringTypeCode@17d0685f m_color =""; - // m_x com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4973813a + // m_x com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3891771e m_x = 0; - // m_y com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6321e813 + // m_y com.eprosima.idl.parser.typecode.PrimitiveTypeCode@78ac1102 m_y = 0; - // m_shapesize com.eprosima.idl.parser.typecode.PrimitiveTypeCode@79be0360 + // m_shapesize com.eprosima.idl.parser.typecode.PrimitiveTypeCode@2de8284b m_shapesize = 0; // Just to register all known types - registerKeylessShapeTypes(); + registerKeylessShapeTypeTypes(); } shapes_demo_typesupport::idl::KeylessShapeType::~KeylessShapeType() @@ -68,7 +68,7 @@ shapes_demo_typesupport::idl::KeylessShapeType::KeylessShapeType( } shapes_demo_typesupport::idl::KeylessShapeType::KeylessShapeType( - KeylessShapeType&& x) + KeylessShapeType&& x) noexcept { m_color = std::move(x.m_color); m_x = x.m_x; @@ -89,7 +89,7 @@ shapes_demo_typesupport::idl::KeylessShapeType& shapes_demo_typesupport::idl::Ke } shapes_demo_typesupport::idl::KeylessShapeType& shapes_demo_typesupport::idl::KeylessShapeType::operator =( - KeylessShapeType&& x) + KeylessShapeType&& x) noexcept { m_color = std::move(x.m_color); @@ -161,7 +161,7 @@ void shapes_demo_typesupport::idl::KeylessShapeType::serialize( eprosima::fastcdr::Cdr& scdr) const { - scdr << m_color; + scdr << m_color.c_str(); scdr << m_x; scdr << m_y; scdr << m_shapesize; diff --git a/include/eprosimashapesdemo/shapesdemo/KeylessShape.h b/types/KeylessShapeType.h similarity index 94% rename from include/eprosimashapesdemo/shapesdemo/KeylessShape.h rename to types/KeylessShapeType.h index b989e39..8c8d6dd 100644 --- a/include/eprosimashapesdemo/shapesdemo/KeylessShape.h +++ b/types/KeylessShapeType.h @@ -13,16 +13,18 @@ // limitations under the License. /*! - * @file KeylessShape.h + * @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. */ -#ifndef _FAST_DDS_GENERATED_SHAPES_DEMO_TYPESUPPORT_IDL_KEYLESSSHAPE_H_ -#define _FAST_DDS_GENERATED_SHAPES_DEMO_TYPESUPPORT_IDL_KEYLESSSHAPE_H_ +#ifndef _FAST_DDS_GENERATED_SHAPES_DEMO_TYPESUPPORT_IDL_KEYLESSSHAPETYPE_H_ +#define _FAST_DDS_GENERATED_SHAPES_DEMO_TYPESUPPORT_IDL_KEYLESSSHAPETYPE_H_ +#include + #include #include #include @@ -42,16 +44,16 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(KeylessShape_SOURCE) -#define KeylessShape_DllAPI __declspec( dllexport ) +#if defined(KeylessShapeType_SOURCE) +#define KeylessShapeType_DllAPI __declspec( dllexport ) #else -#define KeylessShape_DllAPI __declspec( dllimport ) -#endif // KeylessShape_SOURCE +#define KeylessShapeType_DllAPI __declspec( dllimport ) +#endif // KeylessShapeType_SOURCE #else -#define KeylessShape_DllAPI +#define KeylessShapeType_DllAPI #endif // EPROSIMA_USER_DLL_EXPORT #else -#define KeylessShape_DllAPI +#define KeylessShapeType_DllAPI #endif // _WIN32 namespace eprosima { @@ -65,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 KEYLESSSHAPE + * @ingroup KEYLESSSHAPETYPE */ class KeylessShapeType { @@ -93,7 +95,7 @@ namespace shapes_demo_typesupport { * @param x Reference to the object shapes_demo_typesupport::idl::KeylessShapeType that will be copied. */ eProsima_user_DllExport KeylessShapeType( - KeylessShapeType&& x); + KeylessShapeType&& x) noexcept; /*! * @brief Copy assignment. @@ -107,7 +109,7 @@ namespace shapes_demo_typesupport { * @param x Reference to the object shapes_demo_typesupport::idl::KeylessShapeType that will be copied. */ eProsima_user_DllExport KeylessShapeType& operator =( - KeylessShapeType&& x); + KeylessShapeType&& x) noexcept; /*! * @brief Comparison operator. @@ -273,4 +275,4 @@ namespace shapes_demo_typesupport { } // namespace idl } // namespace shapes_demo_typesupport -#endif // _FAST_DDS_GENERATED_SHAPES_DEMO_TYPESUPPORT_IDL_KEYLESSSHAPE_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_SHAPES_DEMO_TYPESUPPORT_IDL_KEYLESSSHAPETYPE_H_ \ No newline at end of file diff --git a/src/shapesdemo/KeylessShapePubSubTypes.cxx b/types/KeylessShapeTypePubSubTypes.cxx similarity index 97% rename from src/shapesdemo/KeylessShapePubSubTypes.cxx rename to types/KeylessShapeTypePubSubTypes.cxx index 5b49df4..b8d7061 100644 --- a/src/shapesdemo/KeylessShapePubSubTypes.cxx +++ b/types/KeylessShapeTypePubSubTypes.cxx @@ -13,7 +13,7 @@ // limitations under the License. /*! - * @file KeylessShapePubSubTypes.cpp + * @file KeylessShapeTypePubSubTypes.cpp * This header file contains the implementation of the serialization functions. * * This file was generated by the tool fastcdrgen. @@ -23,7 +23,7 @@ #include #include -#include "eprosimashapesdemo/shapesdemo/KeylessShapePubSubTypes.h" +#include "KeylessShapeTypePubSubTypes.h" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; @@ -32,7 +32,7 @@ namespace shapes_demo_typesupport { namespace idl { KeylessShapeTypePubSubType::KeylessShapeTypePubSubType() { - setName("shapes_demo_typesupport::idl::dds_::KeylessShapeType_"); + setName("shapes_demo_typesupport::idl::KeylessShapeType"); auto type_size = KeylessShapeType::getMaxCdrSerializedSize(); type_size += eprosima::fastcdr::Cdr::alignment(type_size, 4); /* possible submessage alignment */ m_typeSize = static_cast(type_size) + 4; /*encapsulation*/ diff --git a/include/eprosimashapesdemo/shapesdemo/KeylessShapePubSubTypes.h b/types/KeylessShapeTypePubSubTypes.h similarity index 91% rename from include/eprosimashapesdemo/shapesdemo/KeylessShapePubSubTypes.h rename to types/KeylessShapeTypePubSubTypes.h index 85693cc..892983b 100644 --- a/include/eprosimashapesdemo/shapesdemo/KeylessShapePubSubTypes.h +++ b/types/KeylessShapeTypePubSubTypes.h @@ -13,24 +13,24 @@ // limitations under the License. /*! - * @file KeylessShapePubSubTypes.h + * @file KeylessShapeTypePubSubTypes.h * This header file contains the declaration of the serialization functions. * * This file was generated by the tool fastcdrgen. */ -#ifndef _FAST_DDS_GENERATED_SHAPES_DEMO_TYPESUPPORT_IDL_KEYLESSSHAPE_PUBSUBTYPES_H_ -#define _FAST_DDS_GENERATED_SHAPES_DEMO_TYPESUPPORT_IDL_KEYLESSSHAPE_PUBSUBTYPES_H_ +#ifndef _FAST_DDS_GENERATED_SHAPES_DEMO_TYPESUPPORT_IDL_KEYLESSSHAPETYPE_PUBSUBTYPES_H_ +#define _FAST_DDS_GENERATED_SHAPES_DEMO_TYPESUPPORT_IDL_KEYLESSSHAPETYPE_PUBSUBTYPES_H_ #include #include -#include "eprosimashapesdemo/shapesdemo/KeylessShape.h" +#include "KeylessShapeType.h" #if !defined(GEN_API_VER) || (GEN_API_VER != 1) #error \ - Generated KeylessShape is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. + Generated KeylessShapeType is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen. #endif // GEN_API_VER namespace shapes_demo_typesupport @@ -39,7 +39,7 @@ namespace shapes_demo_typesupport { /*! * @brief This class represents the TopicDataType of the type KeylessShapeType defined by the user in the IDL file. - * @ingroup KEYLESSSHAPE + * @ingroup KEYLESSSHAPETYPE */ class KeylessShapeTypePubSubType : public eprosima::fastdds::dds::TopicDataType { @@ -49,7 +49,7 @@ namespace shapes_demo_typesupport eProsima_user_DllExport KeylessShapeTypePubSubType(); - eProsima_user_DllExport virtual ~KeylessShapeTypePubSubType(); + eProsima_user_DllExport virtual ~KeylessShapeTypePubSubType() override; eProsima_user_DllExport virtual bool serialize( void* data, @@ -104,4 +104,4 @@ namespace shapes_demo_typesupport } } -#endif // _FAST_DDS_GENERATED_SHAPES_DEMO_TYPESUPPORT_IDL_KEYLESSSHAPE_PUBSUBTYPES_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_SHAPES_DEMO_TYPESUPPORT_IDL_KEYLESSSHAPETYPE_PUBSUBTYPES_H_ \ No newline at end of file diff --git a/src/shapesdemo/KeylessShapeTypeObject.cxx b/types/KeylessShapeTypeTypeObject.cxx similarity index 96% rename from src/shapesdemo/KeylessShapeTypeObject.cxx rename to types/KeylessShapeTypeTypeObject.cxx index 90ab0b6..f18419b 100644 --- a/src/shapesdemo/KeylessShapeTypeObject.cxx +++ b/types/KeylessShapeTypeTypeObject.cxx @@ -13,7 +13,7 @@ // limitations under the License. /*! - * @file KeylessShapeTypeObject.cpp + * @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. @@ -24,8 +24,8 @@ namespace { char dummy; } #endif -#include "eprosimashapesdemo/shapesdemo/KeylessShape.h" -#include "eprosimashapesdemo/shapesdemo/KeylessShapeTypeObject.h" +#include "KeylessShapeType.h" +#include "KeylessShapeTypeTypeObject.h" #include #include #include @@ -38,12 +38,12 @@ namespace { char dummy; } using namespace eprosima::fastrtps::rtps; -void registerKeylessShapeTypes() +void registerKeylessShapeTypeTypes() { TypeObjectFactory *factory = TypeObjectFactory::get_instance(); - factory->add_type_object("shapes_demo_typesupport::idl::dds_::KeylessShapeType_", shapes_demo_typesupport::idl::GetKeylessShapeTypeIdentifier(true), + factory->add_type_object("shapes_demo_typesupport::idl::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), + factory->add_type_object("shapes_demo_typesupport::idl::KeylessShapeType", shapes_demo_typesupport::idl::GetKeylessShapeTypeIdentifier(false), shapes_demo_typesupport::idl::GetKeylessShapeTypeObject(false)); diff --git a/include/eprosimashapesdemo/shapesdemo/KeylessShapeTypeObject.h b/types/KeylessShapeTypeTypeObject.h similarity index 81% rename from include/eprosimashapesdemo/shapesdemo/KeylessShapeTypeObject.h rename to types/KeylessShapeTypeTypeObject.h index 28a67f9..9481873 100644 --- a/include/eprosimashapesdemo/shapesdemo/KeylessShapeTypeObject.h +++ b/types/KeylessShapeTypeTypeObject.h @@ -13,14 +13,14 @@ // limitations under the License. /*! - * @file KeylessShapeTypeObject.h + * @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. */ -#ifndef _FAST_DDS_GENERATED_SHAPES_DEMO_TYPESUPPORT_IDL_KEYLESSSHAPE_TYPE_OBJECT_H_ -#define _FAST_DDS_GENERATED_SHAPES_DEMO_TYPESUPPORT_IDL_KEYLESSSHAPE_TYPE_OBJECT_H_ +#ifndef _FAST_DDS_GENERATED_SHAPES_DEMO_TYPESUPPORT_IDL_KEYLESSSHAPETYPE_TYPE_OBJECT_H_ +#define _FAST_DDS_GENERATED_SHAPES_DEMO_TYPESUPPORT_IDL_KEYLESSSHAPETYPE_TYPE_OBJECT_H_ #include @@ -38,21 +38,21 @@ #if defined(_WIN32) #if defined(EPROSIMA_USER_DLL_EXPORT) -#if defined(KeylessShape_SOURCE) -#define KeylessShape_DllAPI __declspec( dllexport ) +#if defined(KeylessShapeType_SOURCE) +#define KeylessShapeType_DllAPI __declspec( dllexport ) #else -#define KeylessShape_DllAPI __declspec( dllimport ) -#endif // KeylessShape_SOURCE +#define KeylessShapeType_DllAPI __declspec( dllimport ) +#endif // KeylessShapeType_SOURCE #else -#define KeylessShape_DllAPI +#define KeylessShapeType_DllAPI #endif #else -#define KeylessShape_DllAPI +#define KeylessShapeType_DllAPI #endif // _WIN32 using namespace eprosima::fastrtps::types; -eProsima_user_DllExport void registerKeylessShapeTypes(); +eProsima_user_DllExport void registerKeylessShapeTypeTypes(); namespace shapes_demo_typesupport { namespace idl { @@ -64,4 +64,4 @@ namespace shapes_demo_typesupport { } // namespace idl } // namespace shapes_demo_typesupport -#endif // _FAST_DDS_GENERATED_SHAPES_DEMO_TYPESUPPORT_IDL_KEYLESSSHAPE_TYPE_OBJECT_H_ \ No newline at end of file +#endif // _FAST_DDS_GENERATED_SHAPES_DEMO_TYPESUPPORT_IDL_KEYLESSSHAPETYPE_TYPE_OBJECT_H_ \ No newline at end of file diff --git a/src/shapesdemo/Shape.cxx b/types/Shape.cxx similarity index 93% rename from src/shapesdemo/Shape.cxx rename to types/Shape.cxx index d3dfd35..32ace0b 100644 --- a/src/shapesdemo/Shape.cxx +++ b/types/Shape.cxx @@ -26,8 +26,8 @@ char dummy; } // namespace #endif // _WIN32 -#include "eprosimashapesdemo/shapesdemo/Shape.h" -#include "eprosimashapesdemo/shapesdemo/ShapeTypeObject.h" +#include "Shape.h" +#include "ShapeTypeObject.h" #include #include @@ -37,17 +37,17 @@ using namespace eprosima::fastcdr::exception; ShapeType::ShapeType() { - // m_color com.eprosima.idl.parser.typecode.StringTypeCode@5bfbf16f + // m_color com.eprosima.idl.parser.typecode.StringTypeCode@33b37288 m_color =""; - // m_x com.eprosima.idl.parser.typecode.PrimitiveTypeCode@25af5db5 + // m_x com.eprosima.idl.parser.typecode.PrimitiveTypeCode@77a57272 m_x = 0; - // m_y com.eprosima.idl.parser.typecode.PrimitiveTypeCode@12cdcf4 + // m_y com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7181ae3f m_y = 0; - // m_shapesize com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5bcea91b + // m_shapesize com.eprosima.idl.parser.typecode.PrimitiveTypeCode@46238e3f m_shapesize = 0; // Just to register all known types - // registerShapeTypes(); + registerShapeTypes(); } ShapeType::~ShapeType() @@ -68,7 +68,7 @@ ShapeType::ShapeType( } ShapeType::ShapeType( - ShapeType&& x) + ShapeType&& x) noexcept { m_color = std::move(x.m_color); m_x = x.m_x; @@ -89,7 +89,7 @@ ShapeType& ShapeType::operator =( } ShapeType& ShapeType::operator =( - ShapeType&& x) + ShapeType&& x) noexcept { m_color = std::move(x.m_color); @@ -161,7 +161,7 @@ void ShapeType::serialize( eprosima::fastcdr::Cdr& scdr) const { - scdr << m_color; + scdr << m_color.c_str(); scdr << m_x; scdr << m_y; scdr << m_shapesize; @@ -324,6 +324,6 @@ void ShapeType::serializeKey( eprosima::fastcdr::Cdr& scdr) const { (void) scdr; - scdr << m_color; + scdr << m_color.c_str(); } diff --git a/include/eprosimashapesdemo/shapesdemo/Shape.h b/types/Shape.h similarity index 98% rename from include/eprosimashapesdemo/shapesdemo/Shape.h rename to types/Shape.h index 8147e58..cc3eb77 100644 --- a/include/eprosimashapesdemo/shapesdemo/Shape.h +++ b/types/Shape.h @@ -23,6 +23,8 @@ #define _FAST_DDS_GENERATED_SHAPE_H_ +#include + #include #include #include @@ -91,7 +93,7 @@ class ShapeType * @param x Reference to the object ShapeType that will be copied. */ eProsima_user_DllExport ShapeType( - ShapeType&& x); + ShapeType&& x) noexcept; /*! * @brief Copy assignment. @@ -105,7 +107,7 @@ class ShapeType * @param x Reference to the object ShapeType that will be copied. */ eProsima_user_DllExport ShapeType& operator =( - ShapeType&& x); + ShapeType&& x) noexcept; /*! * @brief Comparison operator. diff --git a/src/shapesdemo/ShapePubSubTypes.cxx b/types/ShapePubSubTypes.cxx similarity index 98% rename from src/shapesdemo/ShapePubSubTypes.cxx rename to types/ShapePubSubTypes.cxx index fe05e4c..e5a743a 100644 --- a/src/shapesdemo/ShapePubSubTypes.cxx +++ b/types/ShapePubSubTypes.cxx @@ -23,7 +23,7 @@ #include #include -#include "eprosimashapesdemo/shapesdemo/ShapePubSubTypes.h" +#include "ShapePubSubTypes.h" using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t; using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t; diff --git a/include/eprosimashapesdemo/shapesdemo/ShapePubSubTypes.h b/types/ShapePubSubTypes.h similarity index 96% rename from include/eprosimashapesdemo/shapesdemo/ShapePubSubTypes.h rename to types/ShapePubSubTypes.h index 3854f6a..77c1fda 100644 --- a/include/eprosimashapesdemo/shapesdemo/ShapePubSubTypes.h +++ b/types/ShapePubSubTypes.h @@ -26,7 +26,7 @@ #include #include -#include "eprosimashapesdemo/shapesdemo/Shape.h" +#include "Shape.h" #if !defined(GEN_API_VER) || (GEN_API_VER != 1) #error \ @@ -45,7 +45,7 @@ class ShapeTypePubSubType : public eprosima::fastdds::dds::TopicDataType eProsima_user_DllExport ShapeTypePubSubType(); - eProsima_user_DllExport virtual ~ShapeTypePubSubType(); + eProsima_user_DllExport virtual ~ShapeTypePubSubType() override; eProsima_user_DllExport virtual bool serialize( void* data, diff --git a/src/shapesdemo/ShapeTypeObject.cxx b/types/ShapeTypeObject.cxx similarity index 98% rename from src/shapesdemo/ShapeTypeObject.cxx rename to types/ShapeTypeObject.cxx index f581856..d4dd8ae 100644 --- a/src/shapesdemo/ShapeTypeObject.cxx +++ b/types/ShapeTypeObject.cxx @@ -24,8 +24,8 @@ namespace { char dummy; } #endif -#include "eprosimashapesdemo/shapesdemo/Shape.h" -#include "eprosimashapesdemo/shapesdemo/ShapeTypeObject.h" +#include "Shape.h" +#include "ShapeTypeObject.h" #include #include #include @@ -41,8 +41,11 @@ 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)); + 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/include/eprosimashapesdemo/shapesdemo/ShapeTypeObject.h b/types/ShapeTypeObject.h similarity index 100% rename from include/eprosimashapesdemo/shapesdemo/ShapeTypeObject.h rename to types/ShapeTypeObject.h