ROS 2 rclcpp + rcl - jazzy  jazzy
ROS 2 C++ Client Library with ROS Client Library
typesupport_helpers.hpp
1 // Copyright 2018, Bosch Software Innovations GmbH.
2 // Copyright 2021, Apex.AI Inc.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 
16 #ifndef RCLCPP__TYPESUPPORT_HELPERS_HPP_
17 #define RCLCPP__TYPESUPPORT_HELPERS_HPP_
18 
19 #include <memory>
20 #include <string>
21 #include <tuple>
22 
23 #include "rcpputils/shared_library.hpp"
24 #include "rosidl_runtime_cpp/message_type_support_decl.hpp"
25 #include "rosidl_runtime_cpp/service_type_support_decl.hpp"
26 
27 #include "rclcpp/visibility_control.hpp"
28 
29 namespace rclcpp
30 {
31 
41 RCLCPP_PUBLIC
42 std::tuple<std::string, std::string, std::string>
43 extract_type_identifier(const std::string & full_type);
44 
52 RCLCPP_PUBLIC
54  const std::string & package_name, const std::string & typesupport_identifier);
55 
61 RCLCPP_PUBLIC
62 std::shared_ptr<rcpputils::SharedLibrary>
63 get_typesupport_library(const std::string & type, const std::string & typesupport_identifier);
64 
73 [[deprecated("Use `get_message_typesupport_handle` instead")]]
74 RCLCPP_PUBLIC
75 const rosidl_message_type_support_t *
77  const std::string & type,
78  const std::string & typesupport_identifier,
79  rcpputils::SharedLibrary & library);
80 
89 RCLCPP_PUBLIC
90 const rosidl_message_type_support_t *
92  const std::string & type,
93  const std::string & typesupport_identifier,
94  rcpputils::SharedLibrary & library);
95 
104 RCLCPP_PUBLIC
105 const rosidl_service_type_support_t *
107  const std::string & type,
108  const std::string & typesupport_identifier,
109  rcpputils::SharedLibrary & library);
110 
111 } // namespace rclcpp
112 
113 #endif // RCLCPP__TYPESUPPORT_HELPERS_HPP_
Versions of rosidl_typesupport_cpp::get_message_type_support_handle that handle adapted types.
RCLCPP_PUBLIC std::string get_typesupport_library_path(const std::string &package_name, const std::string &typesupport_identifier)
Look for the library in the ament prefix paths and return the path to the type support library.
RCLCPP_PUBLIC std::shared_ptr< rcpputils::SharedLibrary > get_typesupport_library(const std::string &type, const std::string &typesupport_identifier)
Load the type support library for the given type.
RCLCPP_PUBLIC const rosidl_message_type_support_t * get_message_typesupport_handle(const std::string &type, const std::string &typesupport_identifier, rcpputils::SharedLibrary &library)
Extracts the message type support handle from the library.
RCLCPP_PUBLIC const rosidl_message_type_support_t * get_typesupport_handle(const std::string &type, const std::string &typesupport_identifier, rcpputils::SharedLibrary &library)
Extract the type support handle from the library.
RCLCPP_PUBLIC const rosidl_service_type_support_t * get_service_typesupport_handle(const std::string &type, const std::string &typesupport_identifier, rcpputils::SharedLibrary &library)
Extracts the service type support handle from the library.
RCLCPP_PUBLIC std::tuple< std::string, std::string, std::string > extract_type_identifier(const std::string &full_type)
Extract the package name, middle module, and type name from a full type string.