diff --git a/examples/cpp/request_reply/ClientApp.cpp b/examples/cpp/request_reply/ClientApp.cpp index aa17ec00021..28c5e798706 100644 --- a/examples/cpp/request_reply/ClientApp.cpp +++ b/examples/cpp/request_reply/ClientApp.cpp @@ -143,17 +143,18 @@ void ClientApp::stop() void ClientApp::on_participant_discovery( DomainParticipant* /* participant */, - rtps::ParticipantDiscoveryInfo&& info, + rtps::ParticipantDiscoveryStatus status, + const ParticipantBuiltinTopicData& info, bool& should_be_ignored) { std::lock_guard lock(mtx_); should_be_ignored = false; - rtps::GuidPrefix_t remote_participant_guid_prefix = info.info.m_guid.guidPrefix; - std::string status_str = TypeConverter::to_string(info.status); + rtps::GuidPrefix_t remote_participant_guid_prefix = info.guid.guidPrefix; + std::string status_str = TypeConverter::to_string(status); - if (info.info.m_userData.data_vec().size() != 1) + if (info.user_data.data_vec().size() != 1) { should_be_ignored = true; request_reply_debug("ClientApp", "Ignoring participant with invalid user data: " @@ -162,7 +163,7 @@ void ClientApp::on_participant_discovery( if (!should_be_ignored) { - CLIParser::EntityKind entity_kind = static_cast(info.info.m_userData.data_vec()[0]); + CLIParser::EntityKind entity_kind = static_cast(info.user_data.data_vec()[0]); if (CLIParser::EntityKind::SERVER != entity_kind) { should_be_ignored = true; @@ -176,12 +177,12 @@ void ClientApp::on_participant_discovery( { std::string server_str = CLIParser::parse_entity_kind(CLIParser::EntityKind::SERVER); - if (info.status == rtps::ParticipantDiscoveryInfo::DISCOVERY_STATUS::DISCOVERED_PARTICIPANT) + if (status == rtps::ParticipantDiscoveryStatus::DISCOVERED_PARTICIPANT) { request_reply_debug("ClientApp", server_str << " " << status_str << ": " << remote_participant_guid_prefix); } - else if (info.status == rtps::ParticipantDiscoveryInfo::DISCOVERY_STATUS::REMOVED_PARTICIPANT || - info.status == rtps::ParticipantDiscoveryInfo::DISCOVERY_STATUS::DROPPED_PARTICIPANT) + else if (status == rtps::ParticipantDiscoveryStatus::REMOVED_PARTICIPANT || + status == rtps::ParticipantDiscoveryStatus::DROPPED_PARTICIPANT) { request_reply_debug("ClientApp", server_str << " " << status_str << ": " << remote_participant_guid_prefix); } diff --git a/examples/cpp/request_reply/ClientApp.hpp b/examples/cpp/request_reply/ClientApp.hpp index 84624520800..3a6fb0fa56c 100644 --- a/examples/cpp/request_reply/ClientApp.hpp +++ b/examples/cpp/request_reply/ClientApp.hpp @@ -71,7 +71,8 @@ class ClientApp : public Application, public DomainParticipantListener //! Participant discovery method void on_participant_discovery( DomainParticipant* participant, - rtps::ParticipantDiscoveryInfo&& info, + rtps::ParticipantDiscoveryStatus status, + const ParticipantBuiltinTopicData& info, bool& should_be_ignored) override; //! Publication matched method diff --git a/examples/cpp/request_reply/ServerApp.cpp b/examples/cpp/request_reply/ServerApp.cpp index b3ee98b9f08..fe85a7c7555 100644 --- a/examples/cpp/request_reply/ServerApp.cpp +++ b/examples/cpp/request_reply/ServerApp.cpp @@ -130,17 +130,18 @@ void ServerApp::stop() void ServerApp::on_participant_discovery( DomainParticipant* /* participant */, - rtps::ParticipantDiscoveryInfo&& info, + rtps::ParticipantDiscoveryStatus status, + const ParticipantBuiltinTopicData& info, bool& should_be_ignored) { std::lock_guard lock(mtx_); should_be_ignored = false; - rtps::GuidPrefix_t remote_participant_guid_prefix = info.info.m_guid.guidPrefix; - std::string status_str = TypeConverter::to_string(info.status); + rtps::GuidPrefix_t remote_participant_guid_prefix = info.guid.guidPrefix; + std::string status_str = TypeConverter::to_string(status); - if (info.info.m_userData.data_vec().size() != 1) + if (info.user_data.data_vec().size() != 1) { should_be_ignored = true; request_reply_debug("ServerApp", "Ignoring participant with invalid user data: " @@ -149,7 +150,7 @@ void ServerApp::on_participant_discovery( if (!should_be_ignored) { - CLIParser::EntityKind entity_kind = static_cast(info.info.m_userData.data_vec()[0]); + CLIParser::EntityKind entity_kind = static_cast(info.user_data.data_vec()[0]); if (CLIParser::EntityKind::CLIENT != entity_kind) { should_be_ignored = true; @@ -163,12 +164,12 @@ void ServerApp::on_participant_discovery( { std::string client_str = CLIParser::parse_entity_kind(CLIParser::EntityKind::CLIENT); - if (info.status == rtps::ParticipantDiscoveryInfo::DISCOVERY_STATUS::DISCOVERED_PARTICIPANT) + if (status == rtps::ParticipantDiscoveryStatus::DISCOVERED_PARTICIPANT) { request_reply_debug("ServerApp", client_str << " " << status_str << ": " << remote_participant_guid_prefix); } - else if (info.status == rtps::ParticipantDiscoveryInfo::DISCOVERY_STATUS::REMOVED_PARTICIPANT || - info.status == rtps::ParticipantDiscoveryInfo::DISCOVERY_STATUS::DROPPED_PARTICIPANT) + else if (status == rtps::ParticipantDiscoveryStatus::REMOVED_PARTICIPANT || + status == rtps::ParticipantDiscoveryStatus::DROPPED_PARTICIPANT) { client_matched_status_.match_reply_reader(remote_participant_guid_prefix, false); client_matched_status_.match_request_writer(remote_participant_guid_prefix, false); diff --git a/examples/cpp/request_reply/ServerApp.hpp b/examples/cpp/request_reply/ServerApp.hpp index a195b8164ff..3c09d62ad13 100644 --- a/examples/cpp/request_reply/ServerApp.hpp +++ b/examples/cpp/request_reply/ServerApp.hpp @@ -68,7 +68,8 @@ class ServerApp : public Application, public DomainParticipantListener //! Participant discovery method void on_participant_discovery( DomainParticipant* participant, - rtps::ParticipantDiscoveryInfo&& info, + rtps::ParticipantDiscoveryStatus status, + const ParticipantBuiltinTopicData& info, bool& should_be_ignored) override; //! Publication matched method diff --git a/examples/cpp/request_reply/app_utils.hpp b/examples/cpp/request_reply/app_utils.hpp index 65633406cbb..61dc73abceb 100644 --- a/examples/cpp/request_reply/app_utils.hpp +++ b/examples/cpp/request_reply/app_utils.hpp @@ -225,25 +225,25 @@ struct TypeConverter } static std::string to_string( - const rtps::ParticipantDiscoveryInfo::DISCOVERY_STATUS& info) + const rtps::ParticipantDiscoveryStatus& info) { std::string info_str = "Unknown"; switch (info) { - case rtps::ParticipantDiscoveryInfo::DISCOVERY_STATUS::DISCOVERED_PARTICIPANT: + case rtps::ParticipantDiscoveryStatus::DISCOVERED_PARTICIPANT: info_str = "discovered"; break; - case rtps::ParticipantDiscoveryInfo::DISCOVERY_STATUS::CHANGED_QOS_PARTICIPANT: + case rtps::ParticipantDiscoveryStatus::CHANGED_QOS_PARTICIPANT: info_str = "changed QoS"; break; - case rtps::ParticipantDiscoveryInfo::DISCOVERY_STATUS::REMOVED_PARTICIPANT: + case rtps::ParticipantDiscoveryStatus::REMOVED_PARTICIPANT: info_str = "removed"; break; - case rtps::ParticipantDiscoveryInfo::DISCOVERY_STATUS::DROPPED_PARTICIPANT: + case rtps::ParticipantDiscoveryStatus::DROPPED_PARTICIPANT: info_str = "dropped"; break; - case rtps::ParticipantDiscoveryInfo::DISCOVERY_STATUS::IGNORED_PARTICIPANT: + case rtps::ParticipantDiscoveryStatus::IGNORED_PARTICIPANT: info_str = "ignored"; break; default: diff --git a/include/fastdds/rtps/participant/ParticipantDiscoveryInfo.hpp b/include/fastdds/rtps/participant/ParticipantDiscoveryInfo.hpp index be5acee5524..6ee4eaa48bc 100644 --- a/include/fastdds/rtps/participant/ParticipantDiscoveryInfo.hpp +++ b/include/fastdds/rtps/participant/ParticipantDiscoveryInfo.hpp @@ -21,7 +21,7 @@ #define FASTDDS_RTPS_PARTICIPANT__PARTICIPANTDISCOVERYINFO_HPP #include - +#include namespace eprosima { namespace fastdds { namespace rtps {