Skip to content

Commit

Permalink
make linters happy
Browse files Browse the repository at this point in the history
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
  • Loading branch information
ahcorde committed Nov 25, 2024
1 parent da108bf commit 0f58e29
Show file tree
Hide file tree
Showing 21 changed files with 45 additions and 74 deletions.
6 changes: 4 additions & 2 deletions rmw_zenoh_cpp/src/detail/attachment_helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <zenoh.h>

#include <cstdlib>
#include <cstring>
#include <stdexcept>
#include <string>
#include <string_view>
#include <utility>
#include <vector>

#include <zenoh.hxx>

#include "rmw/types.h"

Expand Down
3 changes: 3 additions & 0 deletions rmw_zenoh_cpp/src/detail/attachment_helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
#ifndef DETAIL__ATTACHMENT_HELPERS_HPP_
#define DETAIL__ATTACHMENT_HELPERS_HPP_

#include <cstdint>
#include <vector>

#include <zenoh.hxx>

#include "rmw/types.h"
Expand Down
4 changes: 2 additions & 2 deletions rmw_zenoh_cpp/src/detail/liveliness_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

#include "liveliness_utils.hpp"

#include <zenoh.h>

#include <functional>
#include <limits>
#include <optional>
Expand All @@ -27,6 +25,8 @@
#include <utility>
#include <vector>

#include <zenoh.hxx>

#include "logging_macros.hpp"
#include "qos.hpp"
#include "simplified_xxhash3.hpp"
Expand Down
4 changes: 2 additions & 2 deletions rmw_zenoh_cpp/src/detail/liveliness_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
#ifndef DETAIL__LIVELINESS_UTILS_HPP_
#define DETAIL__LIVELINESS_UTILS_HPP_

#include <zenoh.hxx>

#include <cstddef>
#include <cstdint>
#include <functional>
#include <memory>
#include <optional>
#include <string>

#include <zenoh.hxx>

#include "rmw/types.h"

namespace rmw_zenoh_cpp
Expand Down
5 changes: 3 additions & 2 deletions rmw_zenoh_cpp/src/detail/rmw_client_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@
#include "rmw_client_data.hpp"

#include <fastcdr/FastBuffer.h>
#include <zenoh.h>

#include <chrono>
#include <limits>
#include <memory>
#include <mutex>
#include <string>
#include <utility>
#include <vector>

#include <zenoh.hxx>

#include "cdr.hpp"
#include "liveliness_utils.hpp"
Expand Down Expand Up @@ -387,7 +389,6 @@ rmw_ret_t ClientData::send_request(
keyexpr_.value(),
parameters,
[client_data](const zenoh::Reply & reply) {

if (!reply.is_ok()) {
RMW_ZENOH_LOG_ERROR_NAMED(
"rmw_zenoh_cpp",
Expand Down
4 changes: 2 additions & 2 deletions rmw_zenoh_cpp/src/detail/rmw_client_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
#ifndef DETAIL__RMW_CLIENT_DATA_HPP_
#define DETAIL__RMW_CLIENT_DATA_HPP_

#include <zenoh.h>

#include <cstddef>
#include <cstdint>
#include <deque>
#include <memory>
#include <mutex>
#include <string>

#include <zenoh.hxx>

#include "event.hpp"
#include "liveliness_utils.hpp"
#include "service_type_support.hpp"
Expand Down
17 changes: 7 additions & 10 deletions rmw_zenoh_cpp/src/detail/rmw_context_impl_s.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
// limitations under the License.

#include "rmw_context_impl_s.hpp"
#include <zenoh.h>

#include <cstddef>
#include <cstdint>
Expand All @@ -26,6 +25,8 @@
#include <unordered_map>
#include <utility>

#include <zenoh.hxx>

#include "graph_cache.hpp"
#include "guard_condition.hpp"
#include "identifier.hpp"
Expand Down Expand Up @@ -153,10 +154,9 @@ class rmw_context_impl_s::Data final
// the code will be simpler, and if we're just going to spin over the non-blocking
// reads until we obtain responses, we'll just be hogging CPU time by convincing
// the OS that we're doing actual work when it could instead park the thread.
// z_owned_fifo_handler_reply_t handler;
// z_owned_closure_reply_t closure;
// z_fifo_channel_reply_new(&closure, &handler, SIZE_MAX - 1);
// Intuitively use a FIFO channel rather than building it up with a closure and a handler to FIFO channel

// Intuitively use a FIFO channel rather than building it up with a closure and a
// handler to FIFO channel
zenoh::KeyExpr keyexpr(liveliness_str);

zenoh::Session::GetOptions options = zenoh::Session::GetOptions::create_default();
Expand All @@ -177,7 +177,6 @@ class rmw_context_impl_s::Data final
for (auto res = replies.recv(); std::holds_alternative<zenoh::Reply>(res);
res = replies.recv())
{

const zenoh::Reply & reply = std::get<zenoh::Reply>(res);
if (reply.is_ok()) {
const auto & sample = reply.get_ok();
Expand All @@ -195,7 +194,6 @@ class rmw_context_impl_s::Data final
throw std::runtime_error("Unable to create shm provider.");
}
shm_provider_ = std::move(provider);

}

graph_guard_condition_ = std::make_unique<rmw_guard_condition_t>();
Expand All @@ -211,9 +209,8 @@ class rmw_context_impl_s::Data final
graph_subscriber_cpp_ = session_->liveliness_declare_subscriber(
keyexpr_cpp,
[&](const zenoh::Sample & sample) {

// // Look up the data shared_ptr in the global map. If it is in there, use it.
// If not, it is being shutdown so we can just ignore this update.
// Look up the data shared_ptr in the global map. If it is in there, use it.
// If not, it is being shutdown so we can just ignore this update.
std::shared_ptr<rmw_context_impl_s::Data> data_shared_ptr{nullptr};
{
std::lock_guard<std::mutex> lk(data_to_data_shared_ptr_map_mutex);
Expand Down
4 changes: 2 additions & 2 deletions rmw_zenoh_cpp/src/detail/rmw_context_impl_s.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
#ifndef DETAIL__RMW_CONTEXT_IMPL_S_HPP_
#define DETAIL__RMW_CONTEXT_IMPL_S_HPP_

#include <zenoh.h>

#include <cstddef>
#include <memory>
#include <optional>
#include <string>

#include <zenoh.hxx>

#include "graph_cache.hpp"
#include "rmw_node_data.hpp"

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 @@ -15,14 +15,14 @@
#ifndef DETAIL__RMW_NODE_DATA_HPP_
#define DETAIL__RMW_NODE_DATA_HPP_

#include <zenoh.hxx>

#include <cstddef>
#include <memory>
#include <mutex>
#include <string>
#include <unordered_map>

#include <zenoh.hxx>

#include "graph_cache.hpp"
#include "liveliness_utils.hpp"
#include "rmw_client_data.hpp"
Expand Down
2 changes: 1 addition & 1 deletion rmw_zenoh_cpp/src/detail/rmw_publisher_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <mutex>
#include <string>
#include <utility>
#include <vector>

#include "cdr.hpp"
#include "message_type_support.hpp"
Expand Down Expand Up @@ -104,7 +105,6 @@ std::shared_ptr<PublisherData> PublisherData::make(
zenoh::KeyExpr pub_ke(entity->topic_info()->topic_keyexpr_);
// Create a Publication Cache if durability is transient_local.
if (adapted_qos_profile.durability == RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL) {

zenoh::Session::PublicationCacheOptions pub_cache_opts =
zenoh::Session::PublicationCacheOptions::create_default();

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 @@ -15,15 +15,15 @@
#ifndef DETAIL__RMW_PUBLISHER_DATA_HPP_
#define DETAIL__RMW_PUBLISHER_DATA_HPP_

#include <zenoh.hxx>

#include <cstddef>
#include <cstdint>
#include <memory>
#include <mutex>
#include <optional>
#include <string>

#include <zenoh.hxx>

#include "event.hpp"
#include "liveliness_utils.hpp"
#include "message_type_support.hpp"
Expand Down
4 changes: 3 additions & 1 deletion rmw_zenoh_cpp/src/detail/rmw_service_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
#include "rmw_service_data.hpp"

#include <fastcdr/FastBuffer.h>
#include <zenoh.h>

#include <memory>
#include <mutex>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>

#include <zenoh.hxx>

#include "attachment_helpers.hpp"
#include "cdr.hpp"
Expand Down
4 changes: 2 additions & 2 deletions rmw_zenoh_cpp/src/detail/rmw_service_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
#ifndef DETAIL__RMW_SERVICE_DATA_HPP_
#define DETAIL__RMW_SERVICE_DATA_HPP_

#include <zenoh.hxx>

#include <cstddef>
#include <cstdint>
#include <deque>
Expand All @@ -25,6 +23,8 @@
#include <string>
#include <unordered_map>

#include <zenoh.hxx>

#include "event.hpp"
#include "liveliness_utils.hpp"
#include "service_type_support.hpp"
Expand Down
2 changes: 0 additions & 2 deletions rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ bool SubscriptionData::init()
zenoh::Subscriber<void> sub = context_impl->session()->declare_subscriber(
sub_ke,
[data_wp](const zenoh::Sample & sample) {

zenoh::KeyExpr keystr(std::string(sample.get_keyexpr().as_string_view()));

auto sub_data = data_wp.lock();
Expand Down Expand Up @@ -426,7 +425,6 @@ rmw_ret_t SubscriptionData::shutdown()
return RMW_RET_ERROR;
}
}

}
}

Expand Down
4 changes: 2 additions & 2 deletions rmw_zenoh_cpp/src/detail/rmw_subscription_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
#ifndef DETAIL__RMW_SUBSCRIPTION_DATA_HPP_
#define DETAIL__RMW_SUBSCRIPTION_DATA_HPP_

#include <zenoh.h>

#include <condition_variable>
#include <cstddef>
#include <cstdint>
Expand All @@ -28,6 +26,8 @@
#include <unordered_map>
#include <variant>

#include <zenoh.hxx>

#include "event.hpp"
#include "graph_cache.hpp"
#include "liveliness_utils.hpp"
Expand Down
34 changes: 0 additions & 34 deletions rmw_zenoh_cpp/src/detail/shm_context.hpp

This file was deleted.

3 changes: 2 additions & 1 deletion rmw_zenoh_cpp/src/detail/zenoh_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
#ifndef DETAIL__ZENOH_CONFIG_HPP_
#define DETAIL__ZENOH_CONFIG_HPP_

#include <optional>

#include <zenoh.hxx>
#include <zenoh/api/config.hxx>
#include <optional>

#include "rmw/ret_types.h"

Expand Down
1 change: 1 addition & 0 deletions rmw_zenoh_cpp/src/detail/zenoh_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "zenoh_utils.hpp"

#include <chrono>
#include <utility>

#include "attachment_helpers.hpp"
#include "rmw/types.h"
Expand Down
4 changes: 2 additions & 2 deletions rmw_zenoh_cpp/src/rmw_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <zenoh.h>

#include <string>

#include <zenoh.hxx>

#include "detail/identifier.hpp"
#include "detail/rmw_context_impl_s.hpp"
#include "detail/zenoh_config.hpp"
Expand Down
3 changes: 1 addition & 2 deletions rmw_zenoh_cpp/src/rmw_init_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <zenoh.h>
#include <string.h>
#include <zenoh.hxx>

#include "detail/identifier.hpp"

Expand Down
3 changes: 2 additions & 1 deletion rmw_zenoh_cpp/src/rmw_zenoh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

#include <fastcdr/FastBuffer.h>
#include <rmw/get_topic_endpoint_info.h>
#include <zenoh.h>

#include <chrono>
#include <cinttypes>
Expand All @@ -23,6 +22,8 @@
#include <string>
#include <utility>

#include <zenoh.hxx>

#include "detail/cdr.hpp"
#include "detail/guard_condition.hpp"
#include "detail/identifier.hpp"
Expand Down

0 comments on commit 0f58e29

Please sign in to comment.