rclcpp  master
C++ ROS Client Library API
resolve_use_intra_process.hpp
Go to the documentation of this file.
1 // Copyright 2019 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__DETAIL__RESOLVE_USE_INTRA_PROCESS_HPP_
16 #define RCLCPP__DETAIL__RESOLVE_USE_INTRA_PROCESS_HPP_
17 
18 #include <stdexcept>
19 
21 
22 namespace rclcpp
23 {
24 
25 namespace detail
26 {
27 
29 template<typename OptionsT, typename NodeBaseT>
30 bool
31 resolve_use_intra_process(const OptionsT & options, const NodeBaseT & node_base)
32 {
33  bool use_intra_process;
34  switch (options.use_intra_process_comm) {
36  use_intra_process = true;
37  break;
39  use_intra_process = false;
40  break;
42  use_intra_process = node_base.get_use_intra_process_default();
43  break;
44  default:
45  throw std::runtime_error("Unrecognized IntraProcessSetting value");
46  break;
47  }
48 
49  return use_intra_process;
50 }
51 
52 } // namespace detail
53 
54 } // namespace rclcpp
55 
56 #endif // RCLCPP__DETAIL__RESOLVE_USE_INTRA_PROCESS_HPP_
This header provides the get_node_base_interface() template function.
Definition: allocator_common.hpp:24
bool resolve_use_intra_process(const OptionsT &options, const NodeBaseT &node_base)
Return whether or not intra process is enabled, resolving "NodeDefault" if needed.
Definition: resolve_use_intra_process.hpp:31
Explicitly enable intraprocess comm at publisher/subscription level.
Explicitly disable intraprocess comm at publisher/subscription level.
Take intraprocess configuration from the node.