From c61755ddbd257a62fd93ecb21252501509da898b Mon Sep 17 00:00:00 2001 From: julianbermudez Date: Thu, 20 Dec 2018 13:35:57 +0100 Subject: [PATCH] Adapted to Fast RTPS 1.7.0 Release. --- include/uxr/agent/participant/Participant.hpp | 3 +-- include/uxr/agent/types/TopicPubSubType.hpp | 12 ++++++------ src/cpp/participant/Participant.cpp | 9 +++++---- src/cpp/types/TopicPubSubType.cpp | 3 ++- thirdparty/fastcdr | 2 +- thirdparty/fastrtps | 2 +- 6 files changed, 16 insertions(+), 15 deletions(-) diff --git a/include/uxr/agent/participant/Participant.hpp b/include/uxr/agent/participant/Participant.hpp index bec2fe3db..db6620739 100644 --- a/include/uxr/agent/participant/Participant.hpp +++ b/include/uxr/agent/participant/Participant.hpp @@ -26,7 +26,6 @@ class Participant; } } -#include #include namespace eprosima { @@ -49,7 +48,7 @@ class Participant : public XRCEObject, public fastrtps::ParticipantListener bool matched(const dds::xrce::ObjectVariant& new_object_rep) const override; private: - void onParticipantDiscovery(fastrtps::Participant* p, fastrtps::ParticipantDiscoveryInfo info) override; + void onParticipantDiscovery(fastrtps::Participant* p, fastrtps::ParticipantDiscoveryInfo&& info) override; fastrtps::Participant* rtps_participant_ = nullptr; std::unordered_map registered_topics_; std::set tied_objects_; diff --git a/include/uxr/agent/types/TopicPubSubType.hpp b/include/uxr/agent/types/TopicPubSubType.hpp index a081ec980..a275edb4f 100644 --- a/include/uxr/agent/types/TopicPubSubType.hpp +++ b/include/uxr/agent/types/TopicPubSubType.hpp @@ -30,12 +30,12 @@ class TopicPubSubType: public TopicDataType explicit TopicPubSubType(bool with_key); virtual ~TopicPubSubType() override = default; - bool serialize(void* data, rtps::SerializedPayload_t* payload); - bool deserialize(rtps::SerializedPayload_t* payload, void* data); - std::function getSerializedSizeProvider(void* data); - bool getKey(void* data, rtps::InstanceHandle_t* ihandle); - void* createData(); - void deleteData(void* data); + bool serialize(void* data, rtps::SerializedPayload_t* payload) override; + bool deserialize(rtps::SerializedPayload_t* payload, void* data) override; + std::function getSerializedSizeProvider(void* data) override; + bool getKey(void* data, rtps::InstanceHandle_t* ihandle, bool force_md5 = false) override; + void* createData() override; + void deleteData(void* data) override; }; } // namespace uxr diff --git a/src/cpp/participant/Participant.cpp b/src/cpp/participant/Participant.cpp index 222b287a2..70052d9fa 100644 --- a/src/cpp/participant/Participant.cpp +++ b/src/cpp/participant/Participant.cpp @@ -100,15 +100,16 @@ void Participant::release(ObjectContainer& root_objects) } } -void Participant::onParticipantDiscovery(eprosima::fastrtps::Participant*, eprosima::fastrtps::ParticipantDiscoveryInfo info) +void Participant::onParticipantDiscovery(eprosima::fastrtps::Participant*, + fastrtps::rtps::ParticipantDiscoveryInfo&& info) { - if(info.rtps.m_status == eprosima::fastrtps::rtps::DISCOVERED_RTPSPARTICIPANT) + if(info.status == eprosima::fastrtps::rtps::ParticipantDiscoveryInfo::DISCOVERED_PARTICIPANT) { - std::cout << "RTPS Participant matched " << info.rtps.m_guid << std::endl; + std::cout << "RTPS Participant matched " << info.info.m_guid << std::endl; } else { - std::cout << "RTPS Participant unmatched " << info.rtps.m_guid << std::endl; + std::cout << "RTPS Participant unmatched " << info.info.m_guid << std::endl; } } diff --git a/src/cpp/types/TopicPubSubType.cpp b/src/cpp/types/TopicPubSubType.cpp index 388970eb0..3d64ef634 100644 --- a/src/cpp/types/TopicPubSubType.cpp +++ b/src/cpp/types/TopicPubSubType.cpp @@ -64,11 +64,12 @@ void TopicPubSubType::deleteData(void* data) { delete((std::vector*)data); } -bool TopicPubSubType::getKey(void *data, rtps::InstanceHandle_t* handle) +bool TopicPubSubType::getKey(void *data, rtps::InstanceHandle_t* handle, bool force_md5) { // TODO. (void) data; (void) handle; + (void) force_md5; return m_isGetKeyDefined; } diff --git a/thirdparty/fastcdr b/thirdparty/fastcdr index 1d3c47497..b395f44e8 160000 --- a/thirdparty/fastcdr +++ b/thirdparty/fastcdr @@ -1 +1 @@ -Subproject commit 1d3c47497f8dfc48802143824b342549990cf7fa +Subproject commit b395f44e896c8621ec754d91bcb9c561de41d9d6 diff --git a/thirdparty/fastrtps b/thirdparty/fastrtps index d52a4a94e..b48ce9d2f 160000 --- a/thirdparty/fastrtps +++ b/thirdparty/fastrtps @@ -1 +1 @@ -Subproject commit d52a4a94e29cf50033bb74ae9d49cb4d1a98acee +Subproject commit b48ce9d2fba6fc94e756da01c58b72f2ad848238