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

Close #47

Open
wants to merge 4 commits into
base: dev/1.0.0
Choose a base branch
from
Open
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
Prev Previous commit
Revert "code format fix"
This reverts commit 5ebce21.
yellowhatter committed Dec 5, 2024
commit 2b33def6287594a48fbab785157eeaa806ab769a
14 changes: 7 additions & 7 deletions rmw_zenoh_cpp/src/detail/graph_cache.cpp
Original file line number Diff line number Diff line change
@@ -700,13 +700,13 @@ rmw_ret_t GraphCache::get_node_names(
});

auto free_enclaves_lambda = [enclaves]() -> void {
rcutils_ret_t ret = rcutils_string_array_fini(enclaves);
if (ret != RCUTILS_RET_OK) {
RMW_ZENOH_LOG_ERROR_NAMED(
"rmw_zenoh_cpp",
"failed to cleanup during error handling: %s", rcutils_get_error_string().str);
}
};
rcutils_ret_t ret = rcutils_string_array_fini(enclaves);
if (ret != RCUTILS_RET_OK) {
RMW_ZENOH_LOG_ERROR_NAMED(
"rmw_zenoh_cpp",
"failed to cleanup during error handling: %s", rcutils_get_error_string().str);
}
};

std::shared_ptr<rcpputils::scope_exit<decltype(free_enclaves_lambda)>> free_enclaves{nullptr};
if (enclaves) {
10 changes: 5 additions & 5 deletions rmw_zenoh_cpp/src/detail/logging_macros.hpp
Original file line number Diff line number Diff line change
@@ -24,14 +24,14 @@
// invoke GraphCache::parse_put() and GraphCache::parse_del() functions.
// See https://github.com/ros2/rmw_zenoh/issues/182 for more details.
#define RMW_ZENOH_LOG_DEBUG_NAMED(...) {rmw_zenoh_cpp::Logger::get().log_named( \
RCUTILS_LOG_SEVERITY_DEBUG, __func__, __FILE__, __LINE__, __VA_ARGS__);}
RCUTILS_LOG_SEVERITY_DEBUG, __func__, __FILE__, __LINE__, __VA_ARGS__);}
#define RMW_ZENOH_LOG_ERROR_NAMED(...) {rmw_zenoh_cpp::Logger::get().log_named( \
RCUTILS_LOG_SEVERITY_ERROR, __func__, __FILE__, __LINE__, __VA_ARGS__);}
RCUTILS_LOG_SEVERITY_ERROR, __func__, __FILE__, __LINE__, __VA_ARGS__);}
#define RMW_ZENOH_LOG_FATAL_NAMED(...) {rmw_zenoh_cpp::Logger::get().log_named( \
RCUTILS_LOG_SEVERITY_FATAL, __func__, __FILE__, __LINE__, __VA_ARGS__);}
RCUTILS_LOG_SEVERITY_FATAL, __func__, __FILE__, __LINE__, __VA_ARGS__);}
#define RMW_ZENOH_LOG_INFO_NAMED(...) {rmw_zenoh_cpp::Logger::get().log_named( \
RCUTILS_LOG_SEVERITY_INFO, __func__, __FILE__, __LINE__, __VA_ARGS__);}
RCUTILS_LOG_SEVERITY_INFO, __func__, __FILE__, __LINE__, __VA_ARGS__);}
#define RMW_ZENOH_LOG_WARN_NAMED(...) {rmw_zenoh_cpp::Logger::get().log_named( \
RCUTILS_LOG_SEVERITY_WARN, __func__, __FILE__, __LINE__, __VA_ARGS__);}
RCUTILS_LOG_SEVERITY_WARN, __func__, __FILE__, __LINE__, __VA_ARGS__);}

#endif // DETAIL__LOGGING_MACROS_HPP_
2 changes: 1 addition & 1 deletion rmw_zenoh_cpp/src/detail/qos.hpp
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ namespace rmw_zenoh_cpp
{
//==============================================================================
/// Signature matching rmw_get_publishers_info_by_topic and rmw_get_subscriptions_info_by_topic
using GetEndpointInfoByTopicFunction = std::function<rmw_ret_t (
using GetEndpointInfoByTopicFunction = std::function<rmw_ret_t(
const rmw_node_t *,
rcutils_allocator_t *,
const char *,
2 changes: 1 addition & 1 deletion rmw_zenoh_cpp/src/detail/rmw_context_impl_s.cpp
Original file line number Diff line number Diff line change
@@ -240,7 +240,7 @@ class rmw_context_impl_s::Data final
RMW_SET_ERROR_MSG("Error while starting zenoh session close!");
return RMW_RET_ERROR;
}

return RMW_RET_OK;
}

16 changes: 8 additions & 8 deletions rmw_zenoh_cpp/src/detail/zenoh_router_check.cpp
Original file line number Diff line number Diff line change
@@ -33,14 +33,14 @@ rmw_ret_t zenoh_router_check(const z_loaned_session_t * session)

// Define callback
auto callback = [](const struct z_id_t * id, void * ctx) {
const std::string id_str = liveliness::zid_to_str(*id);
RMW_ZENOH_LOG_INFO_NAMED(
"rmw_zenoh_cpp",
"Successfully connected to a Zenoh router with id %s.", id_str.c_str());
// Note: Callback is guaranteed to never be called
// concurrently according to z_info_routers_zid docstring
(*(static_cast<int *>(ctx)))++;
};
const std::string id_str = liveliness::zid_to_str(*id);
RMW_ZENOH_LOG_INFO_NAMED(
"rmw_zenoh_cpp",
"Successfully connected to a Zenoh router with id %s.", id_str.c_str());
// Note: Callback is guaranteed to never be called
// concurrently according to z_info_routers_zid docstring
(*(static_cast<int *>(ctx)))++;
};

z_owned_closure_zid_t router_callback;
z_closure(&router_callback, callback, NULL, &context);