Skip to content

Commit

Permalink
Fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
methylDragon committed Aug 28, 2020
1 parent ba06e8e commit 32f6f25
Show file tree
Hide file tree
Showing 21 changed files with 308 additions and 456 deletions.
22 changes: 7 additions & 15 deletions rmw_zenoh_cpp/src/impl/client_impl.cpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
extern "C"
{
#include "zenoh/zenoh-ffi.h"
}
#include "client_impl.hpp"

#include <iostream>
#include <mutex>

#include "rcutils/logging_macros.h"

#include "rmw_zenoh_cpp/TypeSupport.hpp"
#include "client_impl.hpp"

std::mutex response_callback_mutex;
std::mutex query_callback_mutex;

Expand Down Expand Up @@ -42,12 +36,11 @@ void rmw_client_data_t::zn_response_sub_callback(const zn_sample * sample) {
// So this might break if a service is being spammed.
// TODO(CH3): Implement queuing logic
if (rmw_client_data_t::zn_response_messages_.find(key)
!= rmw_client_data_t::zn_response_messages_.end()) {
// Log warning if message is clobbered
RCUTILS_LOG_WARN_NAMED(
"rmw_zenoh_cpp", "overwriting existing untaken zenoh response message: %s", key.c_str()
);
}
!= rmw_client_data_t::zn_response_messages_.end()) {
// Log warning if message is clobbered
RCUTILS_LOG_WARN_NAMED(
"rmw_zenoh_cpp", "overwriting existing untaken zenoh response message: %s", key.c_str());
}

rmw_client_data_t::zn_response_messages_[key] = std::vector<unsigned char>(byte_vec);
}
Expand All @@ -64,8 +57,7 @@ void rmw_client_data_t::zn_service_availability_query_callback(const zn_source_i

// Insert if key not found in query response set
if (rmw_client_data_t::zn_availability_query_responses_.find(key)
== rmw_client_data_t::zn_availability_query_responses_.end())
{
== rmw_client_data_t::zn_availability_query_responses_.end()) {
rmw_client_data_t::zn_availability_query_responses_.insert(key);
} else {
RCUTILS_LOG_INFO_NAMED("rmw_zenoh_cpp", "zenoh availability for %s already set", key.c_str());
Expand Down
6 changes: 3 additions & 3 deletions rmw_zenoh_cpp/src/impl/client_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
#include <string>
#include <vector>

#include "rmw/rmw.h"
#include "rmw_zenoh_cpp/TypeSupport.hpp"

extern "C"
{
#include "zenoh/zenoh-ffi.h"
}

#include "rmw/rmw.h"
#include "rmw_zenoh_cpp/TypeSupport.hpp"

struct rmw_client_data_t
{
/// STATIC MEMBERS ===========================================================
Expand Down
23 changes: 11 additions & 12 deletions rmw_zenoh_cpp/src/impl/pubsub_impl.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
extern "C"
{
#include "zenoh/zenoh-ffi.h"
}
#include "pubsub_impl.hpp"

#include <iostream>
#include <mutex>

#include "rmw_zenoh_cpp/TypeSupport.hpp"
#include "rcutils/logging_macros.h"

#include "rmw_zenoh_cpp/TypeSupport.hpp"
#include "pubsub_impl.hpp"
extern "C"
{
#include "zenoh/zenoh-ffi.h"
}

std::mutex sub_callback_mutex;

Expand All @@ -34,12 +34,11 @@ void rmw_subscription_data_t::zn_sub_callback(const zn_sample * sample) {
// So this might break if a topic is being spammed.
// TODO(CH3): Implement queuing logic
if (rmw_subscription_data_t::zn_messages_.find(key)
!= rmw_subscription_data_t::zn_messages_.end()) {
// Log warning if message is clobbered
RCUTILS_LOG_WARN_NAMED(
"rmw_zenoh_cpp", "overwriting existing untaken zenoh message: %s", key.c_str()
);
}
!= rmw_subscription_data_t::zn_messages_.end()) {
// Log warning if message is clobbered
RCUTILS_LOG_WARN_NAMED(
"rmw_zenoh_cpp", "overwriting existing untaken zenoh message: %s", key.c_str());
}

rmw_subscription_data_t::zn_messages_[key] = std::vector<unsigned char>(byte_vec);
}
6 changes: 3 additions & 3 deletions rmw_zenoh_cpp/src/impl/pubsub_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
#include <string>
#include <vector>

#include "rmw/rmw.h"
#include "rmw_zenoh_cpp/TypeSupport.hpp"

extern "C"
{
#include "zenoh/zenoh-ffi.h"
}

#include "rmw/rmw.h"
#include "rmw_zenoh_cpp/TypeSupport.hpp"

struct rmw_node_impl_t
{

Expand Down
23 changes: 11 additions & 12 deletions rmw_zenoh_cpp/src/impl/service_impl.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
extern "C"
{
#include "zenoh/zenoh-ffi.h"
}
#include "service_impl.hpp"

#include <iostream>
#include <mutex>

#include "rcutils/logging_macros.h"

#include "rmw_zenoh_cpp/TypeSupport.hpp"
#include "service_impl.hpp"

extern "C"
{
#include "zenoh/zenoh-ffi.h"
}

std::mutex request_callback_mutex;

Expand All @@ -34,12 +34,11 @@ void rmw_service_data_t::zn_request_sub_callback(const zn_sample * sample) {
// So this might break if a service is being spammed.
// TODO(CH3): Implement queuing logic
if (rmw_service_data_t::zn_request_messages_.find(key)
!= rmw_service_data_t::zn_request_messages_.end()) {
// Log warning if message is clobbered
RCUTILS_LOG_WARN_NAMED(
"rmw_zenoh_cpp", "overwriting existing untaken zenoh request message: %s", key.c_str()
);
}
!= rmw_service_data_t::zn_request_messages_.end()) {
// Log warning if message is clobbered
RCUTILS_LOG_WARN_NAMED(
"rmw_zenoh_cpp", "overwriting existing untaken zenoh request message: %s", key.c_str());
}

rmw_service_data_t::zn_request_messages_[key] = std::vector<unsigned char>(byte_vec);
}
6 changes: 3 additions & 3 deletions rmw_zenoh_cpp/src/impl/service_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
#include <string>
#include <vector>

#include "rmw/rmw.h"
#include "rmw_zenoh_cpp/TypeSupport.hpp"

extern "C"
{
#include "zenoh/zenoh-ffi.h"
}

#include "rmw/rmw.h"
#include "rmw_zenoh_cpp/TypeSupport.hpp"

struct rmw_service_data_t
{
/// STATIC MEMBERS ===========================================================
Expand Down
1 change: 0 additions & 1 deletion rmw_zenoh_cpp/src/impl/type_support_common.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <string>

#include "rmw/error_handling.h"

#include "type_support_common.hpp"

namespace rmw_zenoh_cpp
Expand Down
1 change: 0 additions & 1 deletion rmw_zenoh_cpp/src/impl/type_support_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include "rmw/error_handling.h"

#include "rmw_zenoh_cpp/TypeSupport.hpp"

#include "rmw_zenoh_cpp/MessageTypeSupport.hpp"
#include "rmw_zenoh_cpp/ServiceTypeSupport.hpp"

Expand Down
6 changes: 3 additions & 3 deletions rmw_zenoh_cpp/src/impl/wait_impl.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include "rcutils/logging_macros.h"

#include "wait_impl.hpp"
#include "pubsub_impl.hpp"

#include "rcutils/logging_macros.h"
#include "service_impl.hpp"
#include "client_impl.hpp"
#include "pubsub_impl.hpp"

/// HELPER FUNCTION FOR WAIT ===================================================
bool check_wait_conditions(
Expand Down
Loading

0 comments on commit 32f6f25

Please sign in to comment.