rclcpp  master
C++ ROS Client Library API
subscription_traits.hpp
Go to the documentation of this file.
1 // Copyright 2017 Open Source Robotics Foundation, Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef RCLCPP__SUBSCRIPTION_TRAITS_HPP_
16 #define RCLCPP__SUBSCRIPTION_TRAITS_HPP_
17 
18 #include <memory>
19 
21 
22 namespace rclcpp
23 {
24 namespace subscription_traits
25 {
26 
27 /*
28  * The current version of uncrustify has a misinterpretion here
29  * between `:` used for inheritance vs for initializer list
30  * The result is that whenever a templated struct is used,
31  * the colon has to be without any whitespace next to it whereas
32  * when no template is used, the colon has to be separated by a space.
33  * Cheers!
34  */
35 template<typename T>
37 {};
38 
39 template<>
41 {};
42 
43 template<>
44 struct is_serialized_subscription_argument<std::shared_ptr<rcl_serialized_message_t>>
46 {};
47 
48 template<typename T>
50 {};
51 
52 template<typename CallbackT>
55  typename rclcpp::function_traits::function_traits<CallbackT>::template argument_type<0>>
56 {};
57 
58 template<typename MessageT>
60 {
62 };
63 
64 template<typename MessageT>
65 struct extract_message_type<std::shared_ptr<MessageT>>: extract_message_type<MessageT>
66 {};
67 
68 template<typename MessageT, typename Deleter>
69 struct extract_message_type<std::unique_ptr<MessageT, Deleter>>: extract_message_type<MessageT>
70 {};
71 
72 template<typename CallbackT>
74  typename rclcpp::function_traits::function_traits<CallbackT>::template argument_type<0>>
75 {};
76 
77 } // namespace subscription_traits
78 } // namespace rclcpp
79 
80 #endif // RCLCPP__SUBSCRIPTION_TRAITS_HPP_
Definition: subscription_traits.hpp:49
Definition: allocator_common.hpp:24
Definition: subscription_traits.hpp:73
typename std::remove_cv< rclcpp::function_traits::function_traits< CallbackT >::template argument_type< 0 > >::type type
Definition: subscription_traits.hpp:61
Definition: subscription_traits.hpp:59
Definition: subscription_traits.hpp:53