rclcpp  master
C++ ROS Client Library API
node_base_interface_traits.hpp
Go to the documentation of this file.
1 // Copyright 2020 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__NODE_INTERFACES__NODE_BASE_INTERFACE_TRAITS_HPP_
16 #define RCLCPP__NODE_INTERFACES__NODE_BASE_INTERFACE_TRAITS_HPP_
17 
18 #include <functional>
19 #include <type_traits>
20 
22 
23 namespace rclcpp
24 {
25 namespace node_interfaces
26 {
27 
28 template<class T, typename = void>
30 {};
31 
32 template<class T>
34  T, typename std::enable_if<
35  std::is_same<
36  std::shared_ptr<rclcpp::node_interfaces::NodeBaseInterface>,
37  decltype(std::declval<T>().get_node_base_interface())>::value>::type> : std::true_type
38 {};
39 
40 } // namespace node_interfaces
41 } // namespace rclcpp
42 
43 #endif // RCLCPP__NODE_INTERFACES__NODE_BASE_INTERFACE_TRAITS_HPP_
std::false_type
rclcpp::node_interfaces::has_node_base_interface
Definition: node_base_interface_traits.hpp:29
rclcpp
This header provides the get_node_base_interface() template function.
Definition: allocator_common.hpp:24
node_base_interface.hpp
std