15 #ifndef RCLCPP__PARAMETER_VALUE_HPP_ 16 #define RCLCPP__PARAMETER_VALUE_HPP_ 25 #include "rcl_interfaces/msg/parameter_type.hpp" 26 #include "rcl_interfaces/msg/parameter_value.hpp" 78 explicit ParameterValue(
const rcl_interfaces::msg::ParameterValue & value);
129 rcl_interfaces::msg::ParameterValue
134 template<ParameterType type>
141 return value_.bool_value;
144 template<ParameterType type>
151 return value_.integer_value;
154 template<ParameterType type>
161 return value_.double_value;
164 template<ParameterType type>
171 return value_.string_value;
174 template<ParameterType type>
182 return value_.byte_array_value;
185 template<ParameterType type>
193 return value_.bool_array_value;
196 template<ParameterType type>
204 return value_.integer_array_value;
207 template<ParameterType type>
215 return value_.double_array_value;
218 template<ParameterType type>
226 return value_.string_array_value;
231 template<
typename type>
235 return get<ParameterType::PARAMETER_BOOL>();
238 template<
typename type>
243 return get<ParameterType::PARAMETER_INTEGER>();
246 template<
typename type>
250 return get<ParameterType::PARAMETER_DOUBLE>();
253 template<
typename type>
257 return get<ParameterType::PARAMETER_STRING>();
260 template<
typename type>
266 return get<ParameterType::PARAMETER_BYTE_ARRAY>();
269 template<
typename type>
275 return get<ParameterType::PARAMETER_BOOL_ARRAY>();
278 template<
typename type>
284 return get<ParameterType::PARAMETER_INTEGER_ARRAY>();
287 template<
typename type>
293 return get<ParameterType::PARAMETER_DOUBLE_ARRAY>();
296 template<
typename type>
302 return get<ParameterType::PARAMETER_STRING_ARRAY>();
306 rcl_interfaces::msg::ParameterValue value_;
316 #endif // RCLCPP__PARAMETER_VALUE_HPP_ Definition: parameter_value.hpp:34
Definition: parameter_value.hpp:41
Store the type and value of a parameter.
Definition: parameter_value.hpp:70
Definition: parameter_value.hpp:42
std::string to_string(const ParameterType type)
Return the name of a parameter type.
Definition: allocator_common.hpp:24
Definition: parameter_value.hpp:39
Indicate the parameter type does not match the expected type.
Definition: parameter_value.hpp:55
ParameterType
Definition: parameter_value.hpp:31
Definition: parameter_value.hpp:36
ParameterTypeException(ParameterType expected, ParameterType actual)
Construct an instance.
Definition: parameter_value.hpp:64
Definition: parameter_value.hpp:40
#define RCLCPP_PUBLIC
Definition: visibility_control.hpp:50
Definition: parameter_value.hpp:37
ParameterType get_type() const
Return an enum indicating the type of the set value.
Definition: parameter_value.hpp:33
ParameterValue()
Construct a parameter value with type PARAMETER_NOT_SET.
std::ostream & operator<<(std::ostream &os, const rclcpp::Parameter &pv)
Definition: parameter_value.hpp:38
Definition: parameter_value.hpp:35
rcl_interfaces::msg::ParameterValue to_value_msg() const
Return a message populated with the parameter value.