From fa0d1750f61718fe716bb1498f95e318ebd140ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez=20Cordero?= Date: Fri, 22 Nov 2024 16:03:20 +0100 Subject: [PATCH 1/4] Add clone method to Reply MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alejandro Hernández Cordero --- include/zenoh/api/reply.hxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/zenoh/api/reply.hxx b/include/zenoh/api/reply.hxx index 1f12dad..e578c6e 100644 --- a/include/zenoh/api/reply.hxx +++ b/include/zenoh/api/reply.hxx @@ -84,6 +84,16 @@ class Reply : public Owned<::z_owned_reply_t> { return {}; } #endif + + /// @brief Construct a a shallow copy of this Reply. + /// This can be used, to send reply replies outside of ``Queryable`` callback. + /// + /// The reply will be sent only when the last clone is destroyed. + Reply clone() const { + Reply q(zenoh::detail::null_object); + ::z_reply_clone(&q._0, interop::as_loaned_c_ptr(*this)); + return q; + }; }; } // namespace zenoh From eb83bdae55972bea29d406fc7941d44ba97be0ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez=20Cordero?= Date: Mon, 25 Nov 2024 15:20:19 +0100 Subject: [PATCH 2/4] Fixed docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alejandro Hernández Cordero --- include/zenoh/api/reply.hxx | 1 - 1 file changed, 1 deletion(-) diff --git a/include/zenoh/api/reply.hxx b/include/zenoh/api/reply.hxx index e578c6e..b784268 100644 --- a/include/zenoh/api/reply.hxx +++ b/include/zenoh/api/reply.hxx @@ -86,7 +86,6 @@ class Reply : public Owned<::z_owned_reply_t> { #endif /// @brief Construct a a shallow copy of this Reply. - /// This can be used, to send reply replies outside of ``Queryable`` callback. /// /// The reply will be sent only when the last clone is destroyed. Reply clone() const { From 004d88bd300c6f24cd3af62c315ef5331533f6e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez=20Cordero?= Date: Mon, 25 Nov 2024 16:18:35 +0100 Subject: [PATCH 3/4] fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alejandro Hernández Cordero --- include/zenoh/api/reply.hxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/zenoh/api/reply.hxx b/include/zenoh/api/reply.hxx index b784268..4786389 100644 --- a/include/zenoh/api/reply.hxx +++ b/include/zenoh/api/reply.hxx @@ -85,7 +85,7 @@ class Reply : public Owned<::z_owned_reply_t> { } #endif - /// @brief Construct a a shallow copy of this Reply. + /// @brief Construct a shallow copy of this Reply. /// /// The reply will be sent only when the last clone is destroyed. Reply clone() const { @@ -96,4 +96,4 @@ class Reply : public Owned<::z_owned_reply_t> { }; } // namespace zenoh -#endif \ No newline at end of file +#endif From 4a97b3b6279d6f359376e11de7194a89aac42860 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez=20Cordero?= Date: Mon, 25 Nov 2024 18:33:24 +0100 Subject: [PATCH 4/4] feedback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alejandro Hernández Cordero --- include/zenoh/api/reply.hxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/zenoh/api/reply.hxx b/include/zenoh/api/reply.hxx index 4786389..6f00a74 100644 --- a/include/zenoh/api/reply.hxx +++ b/include/zenoh/api/reply.hxx @@ -89,9 +89,9 @@ class Reply : public Owned<::z_owned_reply_t> { /// /// The reply will be sent only when the last clone is destroyed. Reply clone() const { - Reply q(zenoh::detail::null_object); - ::z_reply_clone(&q._0, interop::as_loaned_c_ptr(*this)); - return q; + Reply reply(zenoh::detail::null_object); + ::z_reply_clone(&reply._0, interop::as_loaned_c_ptr(*this)); + return reply; }; };