Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16440] Update types using Fast DDS-Gen v2.3.0 #63

Merged
merged 4 commits into from
Dec 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions idl/README.md
Original file line number Diff line number Diff line change
@@ -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.
17 changes: 7 additions & 10 deletions include/eprosimashapesdemo/shapesdemo/ShapeInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@
#ifndef _SHAPEINFO_H_
#define _SHAPEINFO_H_

#include <fastrtps/rtps/common/Time_t.h>
#include <fastrtps/rtps/common/Guid.h>
#include <fastrtps/rtps/common/InstanceHandle.h>

#include <cstdint>
#include <sstream>
#include <QString>
#include <sstream>

#include <fastrtps/rtps/common/Guid.h>
#include <fastrtps/rtps/common/InstanceHandle.h>
#include <fastrtps/rtps/common/Time_t.h>

#include "eprosimashapesdemo/shapesdemo/ShapeDefinitions.h"
#include "eprosimashapesdemo/shapesdemo/ShapePubSubTypes.h"
#include "types/ShapePubSubTypes.h"

using namespace eprosima::fastrtps;

Expand Down Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions include/eprosimashapesdemo/shapesdemo/ShapeSubscriber.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@

#include <QMutex>

#include "eprosimashapesdemo/shapesdemo/Shape.h"
#include "eprosimashapesdemo/shapesdemo/ShapeHistory.h"
#include "eprosimashapesdemo/shapesdemo/ShapesDemo.h"

#include <fastdds/dds/subscriber/DataReader.hpp>
#include <fastdds/dds/subscriber/DataReaderListener.hpp>
#include <fastdds/dds/subscriber/qos/DataReaderQos.hpp>
#include <fastdds/dds/subscriber/Subscriber.hpp>
#include <fastdds/dds/topic/ContentFilteredTopic.hpp>
#include <fastdds/dds/topic/Topic.hpp>

#include "eprosimashapesdemo/shapesdemo/ShapeHistory.h"
#include "eprosimashapesdemo/shapesdemo/ShapesDemo.h"
#include "types/Shape.h"

using namespace eprosima::fastdds::dds;

class ContentFilterSelector;
Expand Down
6 changes: 3 additions & 3 deletions include/eprosimashapesdemo/shapesdemo/ShapesDemo.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@

#include <QMutex>

#include "eprosimashapesdemo/shapesdemo/ShapePubSubTypes.h"
#include "eprosimashapesdemo/shapesdemo/ShapeDefinitions.h"

#include <fastdds/dds/domain/DomainParticipant.hpp>
#include <fastdds/dds/domain/DomainParticipantFactory.hpp>
#include <fastdds/dds/domain/DomainParticipantListener.hpp>
Expand All @@ -41,6 +38,9 @@
#include <fastdds/rtps/common/Guid.h>
#include <fastdds/rtps/writer/WriterDiscoveryInfo.h>

#include "eprosimashapesdemo/shapesdemo/ShapeDefinitions.h"
#include "types/ShapePubSubTypes.h"

using namespace eprosima::fastdds::dds;

std::string qos_policy_id_to_string(
Expand Down
29 changes: 15 additions & 14 deletions src/shapesdemo/ShapesDemo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://www.gnu.org/licenses/>.

#include <eprosimashapesdemo/shapesdemo/ShapesDemo.h>

#include <ctime>
#include <iostream>
#include <sstream>
#include <ctime>

#include <eprosimashapesdemo/shapesdemo/ShapesDemo.h>
#include <eprosimashapesdemo/shapesdemo/ShapePublisher.h>
#include <eprosimashapesdemo/shapesdemo/ShapeSubscriber.h>
#include <eprosimashapesdemo/shapesdemo/ShapeTypeObject.h>
#include <eprosimashapesdemo/shapesdemo/ShapeInfo.h>
#ifdef ENABLE_ROS_COMPONENTS
#include <eprosimashapesdemo/shapesdemo/KeylessShapeTypeObject.h>
#include <eprosimashapesdemo/shapesdemo/KeylessShapePubSubTypes.h>
#endif // ifdef ENABLE_ROS_COMPONENTS
#include <eprosimashapesdemo/qt/mainwindow.h>

#include <fastdds/dds/domain/qos/DomainParticipantQos.hpp>
#include <fastdds/rtps/transport/shared_mem/SharedMemTransportDescriptor.h>
#include <fastdds/rtps/transport/TCPv4TransportDescriptor.h>
#include <fastdds/rtps/transport/UDPv4TransportDescriptor.h>
#include <fastdds/rtps/transport/shared_mem/SharedMemTransportDescriptor.h>
#include <fastrtps/config.h> // FASTDDS_STATISTICS availability
#include <fastrtps/utils/IPLocator.h>
#include <fastrtps/xmlparser/XMLProfileManager.h>

#include <eprosimashapesdemo/qt/mainwindow.h>
#include <eprosimashapesdemo/shapesdemo/ShapeInfo.h>
#include <eprosimashapesdemo/shapesdemo/ShapePublisher.h>
#include <eprosimashapesdemo/shapesdemo/ShapeSubscriber.h>
#include <types/ShapeTypeObject.h>
#ifdef ENABLE_ROS_COMPONENTS
#include <types/KeylessShapeTypePubSubTypes.h>
#include <types/KeylessShapeTypeTypeObject.h>
#endif // ifdef ENABLE_ROS_COMPONENTS

using namespace eprosima::fastdds::dds;
using namespace eprosima::fastdds::rtps;
using namespace eprosima::fastrtps::rtps;
Expand Down Expand Up @@ -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();
Expand Down
22 changes: 11 additions & 11 deletions src/shapesdemo/KeylessShape.cxx → types/KeylessShapeType.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 <fastcdr/Cdr.h>

#include <fastcdr/exceptions/BadParamException.h>
Expand All @@ -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()
Expand All @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <fastrtps/utils/fixed_size_string.hpp>

#include <stdint.h>
#include <array>
#include <string>
Expand All @@ -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 {
Expand All @@ -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
{
Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -273,4 +275,4 @@ namespace shapes_demo_typesupport {
} // namespace idl
} // namespace shapes_demo_typesupport

#endif // _FAST_DDS_GENERATED_SHAPES_DEMO_TYPESUPPORT_IDL_KEYLESSSHAPE_H_
#endif // _FAST_DDS_GENERATED_SHAPES_DEMO_TYPESUPPORT_IDL_KEYLESSSHAPETYPE_H_
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -23,7 +23,7 @@
#include <fastcdr/FastBuffer.h>
#include <fastcdr/Cdr.h>

#include "eprosimashapesdemo/shapesdemo/KeylessShapePubSubTypes.h"
#include "KeylessShapeTypePubSubTypes.h"

using SerializedPayload_t = eprosima::fastrtps::rtps::SerializedPayload_t;
using InstanceHandle_t = eprosima::fastrtps::rtps::InstanceHandle_t;
Expand All @@ -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<uint32_t>(type_size) + 4; /*encapsulation*/
Expand Down
Loading