From 1f243aebbaf59be9caf05e02e0d4c1b3cd23fb20 Mon Sep 17 00:00:00 2001 From: elianalf <62831776+elianalf@users.noreply.github.com> Date: Mon, 22 Jul 2024 11:48:00 +0200 Subject: [PATCH 1/5] Compile examples Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com> --- .github/workflows/config/build.meta | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/config/build.meta b/.github/workflows/config/build.meta index 69d791e..a7f99d9 100644 --- a/.github/workflows/config/build.meta +++ b/.github/workflows/config/build.meta @@ -3,3 +3,6 @@ names: cmake-args: - "-DNO_TLS=ON" - "-DSECURITY=OFF" + discovery-server: + cmake-args: + - "-DCOMPILE_EXAMPLES=ON" \ No newline at end of file From dfaf9ee21c914db8937c11c7ef1a9083f9a95216 Mon Sep 17 00:00:00 2001 From: elianalf <62831776+elianalf@users.noreply.github.com> Date: Mon, 22 Jul 2024 12:09:31 +0200 Subject: [PATCH 2/5] Remove discovery-server.xsd Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com> --- .github/workflows/config/build.meta | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/config/build.meta b/.github/workflows/config/build.meta index a7f99d9..5415344 100644 --- a/.github/workflows/config/build.meta +++ b/.github/workflows/config/build.meta @@ -5,4 +5,4 @@ names: - "-DSECURITY=OFF" discovery-server: cmake-args: - - "-DCOMPILE_EXAMPLES=ON" \ No newline at end of file + - "-DCOMPILE_EXAMPLES=ON" From 97316e1692d40abce8d411051de4216beb13dc11 Mon Sep 17 00:00:00 2001 From: elianalf <62831776+elianalf@users.noreply.github.com> Date: Mon, 22 Jul 2024 15:04:21 +0200 Subject: [PATCH 3/5] remove discovery server example Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com> --- .github/workflows/config/build.meta | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/config/build.meta b/.github/workflows/config/build.meta index 5415344..69d791e 100644 --- a/.github/workflows/config/build.meta +++ b/.github/workflows/config/build.meta @@ -3,6 +3,3 @@ names: cmake-args: - "-DNO_TLS=ON" - "-DSECURITY=OFF" - discovery-server: - cmake-args: - - "-DCOMPILE_EXAMPLES=ON" From 33c0417022abafd1ade414d315182dbd2a0c3307 Mon Sep 17 00:00:00 2001 From: elianalf <62831776+elianalf@users.noreply.github.com> Date: Mon, 22 Jul 2024 15:35:15 +0200 Subject: [PATCH 4/5] Apply suggestions Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com> From 9439c8cc6e9d17e17055f57f3cd7d27c80d44cf2 Mon Sep 17 00:00:00 2001 From: elianalf <62831776+elianalf@users.noreply.github.com> Date: Tue, 16 Jul 2024 16:15:49 +0200 Subject: [PATCH 5/5] Refs #21295: Substitute ParticipantDiscoveryInfo with ParticipantBuiltinTopicData Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com> --- include/DiscoveryServerManager.h | 5 +++-- src/DiscoveryServerManager.cpp | 29 ++++++++++++++--------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/include/DiscoveryServerManager.h b/include/DiscoveryServerManager.h index b979830..6069ae2 100644 --- a/include/DiscoveryServerManager.h +++ b/include/DiscoveryServerManager.h @@ -279,7 +279,8 @@ class DiscoveryServerManager // callback discovery functions void on_participant_discovery( DomainParticipant* participant, - ParticipantDiscoveryInfo&& info, + ParticipantDiscoveryStatus status, + const ParticipantBuiltinTopicData& info, bool& should_be_ignored) override; void on_data_reader_discovery( @@ -339,7 +340,7 @@ class DiscoveryServerManager std::ostream& operator <<( std::ostream&, - ParticipantDiscoveryInfo::DISCOVERY_STATUS); + ParticipantDiscoveryStatus); std::ostream& operator <<( std::ostream&, ReaderDiscoveryStatus); diff --git a/src/DiscoveryServerManager.cpp b/src/DiscoveryServerManager.cpp index 9bab4be..7e0168b 100644 --- a/src/DiscoveryServerManager.cpp +++ b/src/DiscoveryServerManager.cpp @@ -1584,11 +1584,12 @@ void DiscoveryServerManager::MapServerInfo( void DiscoveryServerManager::on_participant_discovery( DomainParticipant* participant, - ParticipantDiscoveryInfo&& info, + ParticipantDiscoveryStatus status, + const ParticipantBuiltinTopicData& info, bool& should_be_ignored) { bool server = false; - const GUID_t& partid = info.info.m_guid; + const GUID_t& partid = info.guid; static_cast(should_be_ignored); // if the callback origin was removed ignore @@ -1601,7 +1602,7 @@ void DiscoveryServerManager::on_participant_discovery( } LOG_INFO("Participant " << participant->get_qos().name().to_string() << " reports a participant " - << info.info.m_participantName << " is " << info.status << ". Prefix " << partid); + << info.participant_name << " is " << status << ". Prefix " << partid); std::chrono::steady_clock::time_point callback_time = std::chrono::steady_clock::now(); { @@ -1620,16 +1621,16 @@ void DiscoveryServerManager::on_participant_discovery( // add to database, it has its own mtx // note that when a participant is destroyed he will wait for all his callbacks to return // state will be alive during all callbacks - switch (info.status) + switch (status) { - case ParticipantDiscoveryInfo::DISCOVERED_PARTICIPANT: + case ParticipantDiscoveryStatus::DISCOVERED_PARTICIPANT: { - state.AddParticipant(srcGuid, srcName, partid, info.info.m_participantName.to_string(), callback_time, + state.AddParticipant(srcGuid, srcName, partid, info.participant_name.to_string(), callback_time, server); break; } - case ParticipantDiscoveryInfo::REMOVED_PARTICIPANT: - case ParticipantDiscoveryInfo::DROPPED_PARTICIPANT: + case ParticipantDiscoveryStatus::REMOVED_PARTICIPANT: + case ParticipantDiscoveryStatus::DROPPED_PARTICIPANT: { state.RemoveParticipant(srcGuid, partid); break; @@ -1819,19 +1820,17 @@ void DiscoveryServerManager::on_liveliness_changed( std::ostream& eprosima::discovery_server::operator <<( std::ostream& o, - ParticipantDiscoveryInfo::DISCOVERY_STATUS s) + ParticipantDiscoveryStatus s) { - typedef ParticipantDiscoveryInfo::DISCOVERY_STATUS DS; - switch (s) { - case DS::DISCOVERED_PARTICIPANT: + case ParticipantDiscoveryStatus::DISCOVERED_PARTICIPANT: return o << "DISCOVERED_PARTICIPANT"; - case DS::CHANGED_QOS_PARTICIPANT: + case ParticipantDiscoveryStatus::CHANGED_QOS_PARTICIPANT: return o << "CHANGED_QOS_PARTICIPANT"; - case DS::REMOVED_PARTICIPANT: + case ParticipantDiscoveryStatus::REMOVED_PARTICIPANT: return o << "REMOVED_PARTICIPANT"; - case DS::DROPPED_PARTICIPANT: + case ParticipantDiscoveryStatus::DROPPED_PARTICIPANT: return o << "DROPPED_PARTICIPANT"; default: // unknown value, error o.setstate(std::ios::failbit);