Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add clone method to Reply #290

Merged
merged 4 commits into from
Nov 26, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions include/zenoh/api/reply.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the documentation is wrong, since it is describes the behavior of Query clone.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you help me with right documentation here ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think just /// @brief Construct a a shallow copy of this Reply. should be good enough.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, could you also remove an extra a before shallow_copy ?

///
/// The reply will be sent only when the last clone is destroyed.
Reply clone() const {
Reply q(zenoh::detail::null_object);
milyin marked this conversation as resolved.
Show resolved Hide resolved
::z_reply_clone(&q._0, interop::as_loaned_c_ptr(*this));
return q;
};
};

} // namespace zenoh
Expand Down
Loading