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

Rename the API to match the latest zenoh-c #46

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions rmw_zenoh_cpp/src/detail/rmw_client_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ bool ClientData::init(const z_loaned_session_t * session)
[this]() {
z_drop(z_move(this->token_));
});
if (zc_liveliness_declare_token(
if (z_liveliness_declare_token(
session,
&this->token_,
z_loan(liveliness_ke),
Expand Down Expand Up @@ -518,7 +518,7 @@ void ClientData::_shutdown()
}

// Unregister this node from the ROS graph.
zc_liveliness_undeclare_token(z_move(token_));
z_liveliness_undeclare_token(z_move(token_));

z_drop(z_move(keyexpr_));

Expand Down
2 changes: 1 addition & 1 deletion rmw_zenoh_cpp/src/detail/rmw_client_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class ClientData final : public std::enable_shared_from_this<ClientData>
// An owned keyexpression.
z_owned_keyexpr_t keyexpr_;
// Liveliness token for the service.
zc_owned_liveliness_token_t token_;
z_owned_liveliness_token_t token_;
// Type support fields.
const void * request_type_support_impl_;
const void * response_type_support_impl_;
Expand Down
10 changes: 5 additions & 5 deletions rmw_zenoh_cpp/src/detail/rmw_context_impl_s.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class rmw_context_impl_s::Data final

// Query router/liveliness participants to get graph information before the session was started.
// We create a blocking channel that is unbounded, ie. `bound` = 0, to receive
// replies for the zc_liveliness_get() call. This is necessary as if the `bound`
// replies for the z_liveliness_get() call. This is necessary as if the `bound`
// is too low, the channel may starve the zenoh executor of its threads which
// would lead to deadlocks when trying to receive replies and block the
// execution here.
Expand All @@ -143,7 +143,7 @@ class rmw_context_impl_s::Data final

z_view_keyexpr_t keyexpr;
z_view_keyexpr_from_str(&keyexpr, liveliness_str.c_str());
zc_liveliness_get(
z_liveliness_get(
z_loan(session_), z_loan(keyexpr),
z_move(closure), NULL);
z_owned_reply_t reply;
Expand Down Expand Up @@ -196,8 +196,8 @@ class rmw_context_impl_s::Data final

// Setup the liveliness subscriber to receives updates from the ROS graph
// and update the graph cache.
zc_liveliness_subscriber_options_t sub_options;
zc_liveliness_subscriber_options_default(&sub_options);
z_liveliness_subscriber_options_t sub_options;
z_liveliness_subscriber_options_default(&sub_options);
z_owned_closure_sample_t callback;
z_closure(&callback, graph_sub_data_handler, nullptr, this);
z_view_keyexpr_t liveliness_ke;
Expand All @@ -206,7 +206,7 @@ class rmw_context_impl_s::Data final
[this]() {
z_undeclare_subscriber(z_move(this->graph_subscriber_));
});
if (zc_liveliness_declare_subscriber(
if (z_liveliness_declare_subscriber(
z_loan(session_),
&graph_subscriber_, z_loan(liveliness_ke),
z_move(callback), &sub_options) != Z_OK)
Expand Down
8 changes: 4 additions & 4 deletions rmw_zenoh_cpp/src/detail/rmw_node_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ std::shared_ptr<NodeData> NodeData::make(
std::string liveliness_keyexpr = entity->liveliness_keyexpr();
z_view_keyexpr_t liveliness_ke;
z_view_keyexpr_from_str(&liveliness_ke, liveliness_keyexpr.c_str());
zc_owned_liveliness_token_t token;
z_owned_liveliness_token_t token;
auto free_token = rcpputils::make_scope_exit(
[&token]() {
z_drop(z_move(token));
});
if (zc_liveliness_declare_token(session, &token, z_loan(liveliness_ke), NULL) != Z_OK) {
if (z_liveliness_declare_token(session, &token, z_loan(liveliness_ke), NULL) != Z_OK) {
RMW_ZENOH_LOG_ERROR_NAMED(
"rmw_zenoh_cpp",
"Unable to create liveliness token for the node.");
Expand All @@ -87,7 +87,7 @@ NodeData::NodeData(
const rmw_node_t * const node,
std::size_t id,
std::shared_ptr<liveliness::Entity> entity,
zc_owned_liveliness_token_t token)
z_owned_liveliness_token_t token)
: node_(node),
id_(std::move(id)),
entity_(std::move(entity)),
Expand Down Expand Up @@ -402,7 +402,7 @@ rmw_ret_t NodeData::shutdown()
}

// Unregister this node from the ROS graph.
zc_liveliness_undeclare_token(z_move(token_));
z_liveliness_undeclare_token(z_move(token_));

is_shutdown_ = true;
return ret;
Expand Down
4 changes: 2 additions & 2 deletions rmw_zenoh_cpp/src/detail/rmw_node_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class NodeData final
const rmw_node_t * const node,
std::size_t id,
std::shared_ptr<liveliness::Entity> entity,
zc_owned_liveliness_token_t token);
z_owned_liveliness_token_t token);
// Internal mutex.
mutable std::recursive_mutex mutex_;
// The rmw_node_t associated with this NodeData.
Expand All @@ -139,7 +139,7 @@ class NodeData final
// The Entity generated for the node.
std::shared_ptr<liveliness::Entity> entity_;
// Liveliness token for the node.
zc_owned_liveliness_token_t token_;
z_owned_liveliness_token_t token_;
// Shutdown flag.
bool is_shutdown_;
// Map of publishers.
Expand Down
8 changes: 4 additions & 4 deletions rmw_zenoh_cpp/src/detail/rmw_publisher_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,12 @@ std::shared_ptr<PublisherData> PublisherData::make(
std::string liveliness_keyexpr = entity->liveliness_keyexpr();
z_view_keyexpr_t liveliness_ke;
z_view_keyexpr_from_str(&liveliness_ke, liveliness_keyexpr.c_str());
zc_owned_liveliness_token_t token;
z_owned_liveliness_token_t token;
auto free_token = rcpputils::make_scope_exit(
[&token]() {
z_drop(z_move(token));
});
if (zc_liveliness_declare_token(
if (z_liveliness_declare_token(
session, &token, z_loan(liveliness_ke),
NULL) != Z_OK)
{
Expand Down Expand Up @@ -208,7 +208,7 @@ PublisherData::PublisherData(
std::shared_ptr<liveliness::Entity> entity,
z_owned_publisher_t pub,
std::optional<ze_owned_publication_cache_t> pub_cache,
zc_owned_liveliness_token_t token,
z_owned_liveliness_token_t token,
const void * type_support_impl,
std::unique_ptr<MessageTypeSupport> type_support)
: rmw_node_(rmw_node),
Expand Down Expand Up @@ -431,7 +431,7 @@ rmw_ret_t PublisherData::shutdown()
}

// Unregister this publisher from the ROS graph.
zc_liveliness_undeclare_token(z_move(token_));
z_liveliness_undeclare_token(z_move(token_));
if (pub_cache_.has_value()) {
z_drop(z_move(pub_cache_.value()));
}
Expand Down
4 changes: 2 additions & 2 deletions rmw_zenoh_cpp/src/detail/rmw_publisher_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class PublisherData final
std::shared_ptr<liveliness::Entity> entity,
z_owned_publisher_t pub,
std::optional<ze_owned_publication_cache_t> pub_cache,
zc_owned_liveliness_token_t token,
z_owned_liveliness_token_t token,
const void * type_support_impl,
std::unique_ptr<MessageTypeSupport> type_support);

Expand All @@ -104,7 +104,7 @@ class PublisherData final
// Optional publication cache when durability is transient_local.
std::optional<ze_owned_publication_cache_t> pub_cache_;
// Liveliness token for the publisher.
zc_owned_liveliness_token_t token_;
z_owned_liveliness_token_t token_;
// Type support fields
const void * type_support_impl_;
std::unique_ptr<MessageTypeSupport> type_support_;
Expand Down
4 changes: 2 additions & 2 deletions rmw_zenoh_cpp/src/detail/rmw_service_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ std::shared_ptr<ServiceData> ServiceData::make(
z_drop(z_move(service_data->token_));
}
});
if (zc_liveliness_declare_token(
if (z_liveliness_declare_token(
session, &service_data->token_, z_loan(liveliness_ke),
NULL) != Z_OK)
{
Expand Down Expand Up @@ -495,7 +495,7 @@ rmw_ret_t ServiceData::shutdown()
}

// Unregister this node from the ROS graph.
zc_liveliness_undeclare_token(z_move(token_));
z_liveliness_undeclare_token(z_move(token_));
z_undeclare_queryable(z_move(qable_));

is_shutdown_ = true;
Expand Down
2 changes: 1 addition & 1 deletion rmw_zenoh_cpp/src/detail/rmw_service_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class ServiceData final
// An owned queryable.
z_owned_queryable_t qable_;
// Liveliness token for the service.
zc_owned_liveliness_token_t token_;
z_owned_liveliness_token_t token_;
// Type support fields.
const void * request_type_support_impl_;
const void * response_type_support_impl_;
Expand Down
4 changes: 2 additions & 2 deletions rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ bool SubscriptionData::init()
[this]() {
z_drop(z_move(token_));
});
if (zc_liveliness_declare_token(
if (z_liveliness_declare_token(
context_impl->session(), &token_, z_loan(liveliness_ke), NULL) != Z_OK)
{
RMW_ZENOH_LOG_ERROR_NAMED(
Expand Down Expand Up @@ -393,7 +393,7 @@ rmw_ret_t SubscriptionData::shutdown()
graph_cache_->remove_qos_event_callbacks(entity_->keyexpr_hash());

// Unregister this subscription from the ROS graph.
zc_liveliness_undeclare_token(z_move(token_));
z_liveliness_undeclare_token(z_move(token_));

z_owned_subscriber_t * sub = std::get_if<z_owned_subscriber_t>(&sub_);
if (sub != nullptr) {
Expand Down
2 changes: 1 addition & 1 deletion rmw_zenoh_cpp/src/detail/rmw_subscription_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class SubscriptionData final : public std::enable_shared_from_this<SubscriptionD
// An owned subscriber or querying_subscriber depending on the QoS settings.
std::variant<z_owned_subscriber_t, ze_owned_querying_subscriber_t> sub_;
// Liveliness token for the subscription.
zc_owned_liveliness_token_t token_;
z_owned_liveliness_token_t token_;
// Type support fields
const void * type_support_impl_;
std::unique_ptr<MessageTypeSupport> type_support_;
Expand Down
2 changes: 1 addition & 1 deletion zenoh_c_vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ set(ZENOHC_CARGO_FLAGS "--no-default-features$<SEMICOLON>--features=shared-memor
# - https://github.com/eclipse-zenoh/zenoh-c/pull/620 (fix ze_querying_subscriber_get API to query newly discovered publishers)
ament_vendor(zenoh_c_vendor
VCS_URL https://github.com/eclipse-zenoh/zenoh-c.git
VCS_VERSION 4b759d4e4d35a97d7b20b5c4003b8b764a10f679
VCS_VERSION bd7c7172ff5a38d43dedf72dc2cf03607743e826
CMAKE_ARGS
"-DZENOHC_CARGO_FLAGS=${ZENOHC_CARGO_FLAGS}"
"-DZENOHC_BUILD_WITH_UNSTABLE_API=TRUE"
Expand Down