You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we use const std::string & to process the passing keyexpr after conversion. This forces us to copy the context by creating a std::string. The most efficient way to borrow and read the zenoh keyexpr is
Use z_keyexpr_as_view_string to read the z_view_string_t from a loaned keyexpr.
Pass the zenoh view string by calling std::string_view(z_string_data, z_string_len).
NOTE
We need to mind the lifetime of owned key expr. Ideally, all the rmw_zenoh entities should own the data rather than a reference to somewhere.
The text was updated successfully, but these errors were encountered:
The zenoh key expression is not null-terminated. That's why we need to attain the pointer with its length while printing the string in zenoh-c.
Currently, we use
const std::string &
to process the passing keyexpr after conversion. This forces us to copy the context by creating astd::string
. The most efficient way to borrow and read the zenoh keyexpr isz_keyexpr_as_view_string
to read thez_view_string_t
from a loaned keyexpr.std::string_view(z_string_data, z_string_len)
.NOTE
We need to mind the lifetime of owned key expr. Ideally, all the rmw_zenoh entities should own the data rather than a reference to somewhere.
The text was updated successfully, but these errors were encountered: