rclcpp  master
C++ ROS Client Library API
node_parameters_interface.hpp
Go to the documentation of this file.
1 // Copyright 2016 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_PARAMETERS_INTERFACE_HPP_
16 #define RCLCPP__NODE_INTERFACES__NODE_PARAMETERS_INTERFACE_HPP_
17 
18 #include <string>
19 #include <vector>
20 
21 #include "rcl_interfaces/msg/list_parameters_result.hpp"
22 #include "rcl_interfaces/msg/parameter_descriptor.hpp"
23 #include "rcl_interfaces/msg/set_parameters_result.hpp"
24 
25 #include "rclcpp/macros.hpp"
26 #include "rclcpp/parameter.hpp"
28 
29 namespace rclcpp
30 {
31 namespace node_interfaces
32 {
33 
36 {
37 public:
39 
41  virtual
44  const std::vector<rclcpp::Parameter> & parameters) = 0;
45 
47  virtual
48  rcl_interfaces::msg::SetParametersResult
50  const std::vector<rclcpp::Parameter> & parameters) = 0;
51 
53  /*
54  * \param[in] names a list of parameter names to check.
55  * \return the list of parameters that were found.
56  * Any parameter not found is omitted from the returned list.
57  */
59  virtual
61  get_parameters(const std::vector<std::string> & names) const = 0;
62 
64  /*
65  * \param[in] name the name of the parameter to look for.
66  * \return the parameter if it exists on the node.
67  * \throws std::out_of_range if the parameter does not exist on the node.
68  */
70  virtual
72  get_parameter(const std::string & name) const = 0;
73 
75  /*
76  * \param[in] name the name of the parameter to look for.
77  * \param[out] parameter the description if parameter exists on the node.
78  * \return true if the parameter exists on the node, or
79  * \return false if the parameter does not exist.
80  */
82  virtual
83  bool
85  const std::string & name,
86  rclcpp::Parameter & parameter) const = 0;
87 
89  virtual
91  describe_parameters(const std::vector<std::string> & names) const = 0;
92 
94  virtual
96  get_parameter_types(const std::vector<std::string> & names) const = 0;
97 
99  virtual
100  rcl_interfaces::msg::ListParametersResult
101  list_parameters(const std::vector<std::string> & prefixes, uint64_t depth) const = 0;
102 
104  rcl_interfaces::msg::SetParametersResult(
106 
108  virtual
109  void
111 };
112 
113 } // namespace node_interfaces
114 } // namespace rclcpp
115 
116 #endif // RCLCPP__NODE_INTERFACES__NODE_PARAMETERS_INTERFACE_HPP_
virtual std::vector< rclcpp::Parameter > get_parameters(const std::vector< std::string > &names) const =0
Get descriptions of parameters given their names.
Pure virtual interface class for the NodeParameters part of the Node API.
Definition: node_parameters_interface.hpp:35
#define RCLCPP_SMART_PTR_ALIASES_ONLY(...)
Definition: macros.hpp:66
Definition: allocator_common.hpp:24
virtual std::vector< uint8_t > get_parameter_types(const std::vector< std::string > &names) const =0
Structure to store an arbitrary parameter with templated get/set methods.
Definition: parameter.hpp:32
virtual rclcpp::Parameter get_parameter(const std::string &name) const =0
Get the description of one parameter given a name.
virtual rcl_interfaces::msg::ListParametersResult list_parameters(const std::vector< std::string > &prefixes, uint64_t depth) const =0
virtual rcl_interfaces::msg::SetParametersResult set_parameters_atomically(const std::vector< rclcpp::Parameter > &parameters)=0
virtual std::vector< rcl_interfaces::msg::SetParametersResult > set_parameters(const std::vector< rclcpp::Parameter > &parameters)=0
#define RCLCPP_PUBLIC
Definition: visibility_control.hpp:50
virtual void register_param_change_callback(ParametersCallbackFunction callback)=0
virtual std::vector< rcl_interfaces::msg::ParameterDescriptor > describe_parameters(const std::vector< std::string > &names) const =0