From 23f42350f766bf55166a5a86744ace7f4ad0c12b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez=20Cordero?= Date: Mon, 9 Dec 2024 11:39:30 +0100 Subject: [PATCH] clean merge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alejandro Hernández Cordero --- rmw_zenoh_cpp/src/detail/rmw_client_data.cpp | 2 -- rmw_zenoh_cpp/src/detail/rmw_publisher_data.hpp | 6 +++--- rmw_zenoh_cpp/src/detail/rmw_service_data.hpp | 2 +- rmw_zenoh_cpp/src/detail/zenoh_utils.cpp | 5 ++++- rmw_zenoh_cpp/src/rmw_zenoh.cpp | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/rmw_zenoh_cpp/src/detail/rmw_client_data.cpp b/rmw_zenoh_cpp/src/detail/rmw_client_data.cpp index 6aced845..4e8dfaae 100644 --- a/rmw_zenoh_cpp/src/detail/rmw_client_data.cpp +++ b/rmw_zenoh_cpp/src/detail/rmw_client_data.cpp @@ -80,8 +80,6 @@ void client_data_handler(z_loaned_reply_t * reply, void * data) std::chrono::nanoseconds::rep received_timestamp = std::chrono::system_clock::now().time_since_epoch().count(); - z_owned_reply_t owned_reply; - z_reply_clone(&owned_reply, reply); client_data->add_new_reply( std::make_unique(reply, received_timestamp)); } diff --git a/rmw_zenoh_cpp/src/detail/rmw_publisher_data.hpp b/rmw_zenoh_cpp/src/detail/rmw_publisher_data.hpp index c666154f..bde0c13b 100644 --- a/rmw_zenoh_cpp/src/detail/rmw_publisher_data.hpp +++ b/rmw_zenoh_cpp/src/detail/rmw_publisher_data.hpp @@ -67,12 +67,12 @@ class PublisherData final // Get a copy of the TopicInfo of this PublisherData. liveliness::TopicInfo topic_info() const; - // Returns true if liveliness token is still valid. - bool liveliness_is_valid() const; - // Copy the GID of this PublisherData into an rmw_gid_t. void copy_gid(uint8_t out_gid[RMW_GID_STORAGE_SIZE]) const; + // Returns true if liveliness token is still valid. + bool liveliness_is_valid() const; + // Get the events manager of this PublisherData. std::shared_ptr events_mgr() const; diff --git a/rmw_zenoh_cpp/src/detail/rmw_service_data.hpp b/rmw_zenoh_cpp/src/detail/rmw_service_data.hpp index 84586193..75467494 100644 --- a/rmw_zenoh_cpp/src/detail/rmw_service_data.hpp +++ b/rmw_zenoh_cpp/src/detail/rmw_service_data.hpp @@ -110,7 +110,7 @@ class ServiceData final const rmw_node_t * rmw_node_; // The Entity generated for the service. std::shared_ptr entity_; - // The keyexpr string. + // An owned keyexpression. z_owned_keyexpr_t keyexpr_; // An owned queryable. z_owned_queryable_t qable_; diff --git a/rmw_zenoh_cpp/src/detail/zenoh_utils.cpp b/rmw_zenoh_cpp/src/detail/zenoh_utils.cpp index 6c9259ae..77bb4dc2 100644 --- a/rmw_zenoh_cpp/src/detail/zenoh_utils.cpp +++ b/rmw_zenoh_cpp/src/detail/zenoh_utils.cpp @@ -52,7 +52,10 @@ std::chrono::nanoseconds::rep ZenohQuery::get_received_timestamp() const } ///============================================================================= -ZenohQuery::~ZenohQuery() {z_drop(z_move(query_));} +ZenohQuery::~ZenohQuery() +{ + z_drop(z_move(query_)); +} ///============================================================================= const z_loaned_query_t * ZenohQuery::get_query() const {return z_loan(query_);} diff --git a/rmw_zenoh_cpp/src/rmw_zenoh.cpp b/rmw_zenoh_cpp/src/rmw_zenoh.cpp index bab759a5..b7784920 100644 --- a/rmw_zenoh_cpp/src/rmw_zenoh.cpp +++ b/rmw_zenoh_cpp/src/rmw_zenoh.cpp @@ -750,7 +750,7 @@ rmw_publisher_assert_liveliness(const rmw_publisher_t * publisher) auto pub_data = node_data->get_pub_data(publisher); RMW_CHECK_ARGUMENT_FOR_NULL(pub_data, RMW_RET_INVALID_ARGUMENT); - if (pub_data->is_shutdown()) { + if (!pub_data->liveliness_is_valid()) { return RMW_RET_ERROR; }