Skip to content

Commit 0d56de9

Browse files
committed
clang-format
Signed-off-by: Dominik Authaler <dominik.authaler@uni-ulm.de>
1 parent 0c1710d commit 0d56de9

4 files changed

Lines changed: 38 additions & 38 deletions

File tree

src/TopicPublisherROS2/generic_publisher.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,8 @@ class GenericPublisher : public rclcpp::PublisherBase
5050
static std::shared_ptr<GenericPublisher> create(rclcpp::Node& node, const std::string& topic_name,
5151
const std::string& topic_type)
5252
{
53-
54-
auto library = std::move(wrapper::get_typesupport_library(topic_type, "rosidl_typesupport_cpp"));
55-
auto type_support = wrapper::get_message_typesupport_handle(topic_type, "rosidl_typesupport_cpp", library);
53+
auto library = std::move(wrapper::get_typesupport_library(topic_type, "rosidl_typesupport_cpp"));
54+
auto type_support = wrapper::get_message_typesupport_handle(topic_type, "rosidl_typesupport_cpp", library);
5655

5756
return std::make_shared<GenericPublisher>(node.get_node_base_interface().get(), topic_name, *type_support);
5857
}

src/ros_parsers/ros2_parser.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ std::string CreateSchema(const std::string& base_type)
4242
std::set<std::string> secondary_types_pending;
4343
std::set<std::string> secondary_types_done;
4444

45-
auto addTypeToSchema = [&](const std::string& type_name, bool add_header)
46-
{
45+
auto addTypeToSchema = [&](const std::string& type_name, bool add_header) {
4746
auto introspection_library = wrapper::get_typesupport_library(type_name, "rosidl_typesupport_introspection_cpp");
4847
auto introspection_support = wrapper::get_message_typesupport_handle(
4948
type_name, "rosidl_typesupport_introspection_cpp", introspection_library);
@@ -149,10 +148,10 @@ TopicInfo CreateTopicInfo(const std::string& topic_name, const std::string& type
149148
info.type = type_name;
150149

151150
info.introspection_library = wrapper::get_typesupport_library(type_name, "rosidl_typesupport_introspection_cpp");
152-
info.introspection_support = wrapper::get_message_typesupport_handle(type_name, "rosidl_typesupport_introspection_cpp",
153-
info.introspection_library);
151+
info.introspection_support = wrapper::get_message_typesupport_handle(
152+
type_name, "rosidl_typesupport_introspection_cpp", info.introspection_library);
154153

155-
auto identifier = rosidl_typesupport_cpp::typesupport_identifier;
154+
auto identifier = rosidl_typesupport_cpp::typesupport_identifier;
156155
info.support_library = wrapper::get_typesupport_library(type_name, identifier);
157156
info.type_support = wrapper::get_message_typesupport_handle(type_name, identifier, info.support_library);
158157

src/typesupport_wrapper.cpp

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,31 @@
44
#include "rosidl_runtime_cpp/message_type_support_decl.hpp"
55

66
#ifdef ROS_HUMBLE
7-
#include "rosbag2_cpp/typesupport_helpers.hpp"
7+
#include "rosbag2_cpp/typesupport_helpers.hpp"
88
#else
9-
#include "rclcpp/typesupport_helpers.hpp"
9+
#include "rclcpp/typesupport_helpers.hpp"
1010
#endif
1111

12-
namespace wrapper {
13-
std::shared_ptr<rcpputils::SharedLibrary>
14-
get_typesupport_library(const std::string & type, const std::string & typesupport_identifier) {
15-
#ifdef ROS_HUMBLE
16-
return rosbag2_cpp::get_typesupport_library(type, typesupport_identifier);
17-
#else
18-
return rclcpp::get_typesupport_library(type, typesupport_identifier);
19-
#endif
20-
}
12+
namespace wrapper
13+
{
14+
std::shared_ptr<rcpputils::SharedLibrary> get_typesupport_library(const std::string& type,
15+
const std::string& typesupport_identifier)
16+
{
17+
#ifdef ROS_HUMBLE
18+
return rosbag2_cpp::get_typesupport_library(type, typesupport_identifier);
19+
#else
20+
return rclcpp::get_typesupport_library(type, typesupport_identifier);
21+
#endif
22+
}
2123

22-
const rosidl_message_type_support_t *
23-
get_message_typesupport_handle(const std::string &type,
24-
const std::string &typesupport_identifier,
25-
std::shared_ptr<rcpputils::SharedLibrary> library) {
26-
#ifdef ROS_HUMBLE
27-
return rosbag2_cpp::get_typesupport_handle(type, typesupport_identifier, library);
28-
#else
29-
return rclcpp::get_message_typesupport_handle(type, typesupport_identifier, *library);
30-
#endif
31-
}
24+
const rosidl_message_type_support_t* get_message_typesupport_handle(const std::string& type,
25+
const std::string& typesupport_identifier,
26+
std::shared_ptr<rcpputils::SharedLibrary> library)
27+
{
28+
#ifdef ROS_HUMBLE
29+
return rosbag2_cpp::get_typesupport_handle(type, typesupport_identifier, library);
30+
#else
31+
return rclcpp::get_message_typesupport_handle(type, typesupport_identifier, *library);
32+
#endif
3233
}
34+
} // namespace wrapper

src/typesupport_wrapper.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
#include "rcpputils/shared_library.hpp"
1111
#include "rosidl_runtime_cpp/message_type_support_decl.hpp"
1212

13-
namespace wrapper {
14-
std::shared_ptr<rcpputils::SharedLibrary>
15-
get_typesupport_library(const std::string & type, const std::string & typesupport_identifier);
13+
namespace wrapper
14+
{
15+
std::shared_ptr<rcpputils::SharedLibrary> get_typesupport_library(const std::string& type,
16+
const std::string& typesupport_identifier);
1617

17-
const rosidl_message_type_support_t *
18-
get_message_typesupport_handle(const std::string &type,
19-
const std::string &typesupport_identifier,
20-
std::shared_ptr<rcpputils::SharedLibrary> library);
21-
}
18+
const rosidl_message_type_support_t* get_message_typesupport_handle(const std::string& type,
19+
const std::string& typesupport_identifier,
20+
std::shared_ptr<rcpputils::SharedLibrary> library);
21+
} // namespace wrapper
2222

23-
#endif //TYPESUPPORT_WRAPPER_H
23+
#endif // TYPESUPPORT_WRAPPER_H

0 commit comments

Comments
 (0)