rclcpp
master
C++ ROS Client Library API
|
Go to the documentation of this file.
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"
79 explicit ParameterValue(
const rcl_interfaces::msg::ParameterValue & value);
130 rcl_interfaces::msg::ParameterValue
145 template<ParameterType type>
153 return value_.bool_value;
156 template<ParameterType type>
164 return value_.integer_value;
167 template<ParameterType type>
175 return value_.double_value;
178 template<ParameterType type>
186 return value_.string_value;
189 template<ParameterType type>
198 return value_.byte_array_value;
201 template<ParameterType type>
210 return value_.bool_array_value;
213 template<ParameterType type>
222 return value_.integer_array_value;
225 template<ParameterType type>
234 return value_.double_array_value;
237 template<ParameterType type>
246 return value_.string_array_value;
251 template<
typename type>
256 return get<ParameterType::PARAMETER_BOOL>();
259 template<
typename type>
265 return get<ParameterType::PARAMETER_INTEGER>();
268 template<
typename type>
273 return get<ParameterType::PARAMETER_DOUBLE>();
276 template<
typename type>
281 return get<ParameterType::PARAMETER_STRING>();
284 template<
typename type>
291 return get<ParameterType::PARAMETER_BYTE_ARRAY>();
294 template<
typename type>
301 return get<ParameterType::PARAMETER_BOOL_ARRAY>();
304 template<
typename type>
311 return get<ParameterType::PARAMETER_INTEGER_ARRAY>();
314 template<
typename type>
321 return get<ParameterType::PARAMETER_DOUBLE_ARRAY>();
324 template<
typename type>
331 return get<ParameterType::PARAMETER_STRING_ARRAY>();
335 rcl_interfaces::msg::ParameterValue value_;
345 #endif // RCLCPP__PARAMETER_VALUE_HPP_
@ PARAMETER_INTEGER_ARRAY
Definition: parameter_value.hpp:41
rcl_interfaces::msg::ParameterValue to_value_msg() const
Return a message populated with the parameter value.
ParameterValue()
Construct a parameter value with type PARAMETER_NOT_SET.
constexpr std::enable_if< std::is_convertible< type, const std::vector< int64_t > & >::value, const std::vector< int64_t > & >::type get() const
Definition: parameter_value.hpp:309
Store the type and value of a parameter.
Definition: parameter_value.hpp:71
constexpr std::enable_if< type==ParameterType::PARAMETER_STRING_ARRAY, const std::vector< std::string > & >::type get() const
Definition: parameter_value.hpp:241
constexpr std::enable_if< std::is_convertible< type, const std::vector< bool > & >::value, const std::vector< bool > & >::type get() const
Definition: parameter_value.hpp:299
constexpr std::enable_if< std::is_floating_point< type >::value, const double & >::type get() const
Definition: parameter_value.hpp:271
std::ostream & operator<<(std::ostream &os, const FutureReturnCode &future_return_code)
Stream operator for FutureReturnCode.
constexpr std::enable_if< type==ParameterType::PARAMETER_STRING, const std::string & >::type get() const
Definition: parameter_value.hpp:181
constexpr std::enable_if< type==ParameterType::PARAMETER_BOOL_ARRAY, const std::vector< bool > & >::type get() const
Definition: parameter_value.hpp:205
constexpr std::enable_if< type==ParameterType::PARAMETER_BOOL, const bool & >::type get() const
Definition: parameter_value.hpp:148
@ PARAMETER_BYTE_ARRAY
Definition: parameter_value.hpp:39
@ PARAMETER_INTEGER
Definition: parameter_value.hpp:36
constexpr std::enable_if< type==ParameterType::PARAMETER_DOUBLE, const double & >::type get() const
Definition: parameter_value.hpp:170
Indicate the parameter type does not match the expected type.
Definition: parameter_value.hpp:56
constexpr std::enable_if< std::is_convertible< type, const std::vector< std::string > & >::value, const std::vector< std::string > & >::type get() const
Definition: parameter_value.hpp:329
constexpr std::enable_if< std::is_integral< type >::value &&!std::is_same< type, bool >::value, const int64_t & >::type get() const
Definition: parameter_value.hpp:263
constexpr std::enable_if< type==ParameterType::PARAMETER_DOUBLE_ARRAY, const std::vector< double > & >::type get() const
Definition: parameter_value.hpp:229
ParameterTypeException(ParameterType expected, ParameterType actual)
Construct an instance.
Definition: parameter_value.hpp:65
@ PARAMETER_DOUBLE_ARRAY
Definition: parameter_value.hpp:42
This header provides the get_node_base_interface() template function.
Definition: allocator_common.hpp:24
@ PARAMETER_STRING_ARRAY
Definition: parameter_value.hpp:43
@ PARAMETER_STRING
Definition: parameter_value.hpp:38
#define RCLCPP_PUBLIC
Definition: visibility_control.hpp:50
ParameterType get_type() const
Return an enum indicating the type of the set value.
bool operator!=(const ParameterValue &rhs) const
Not equal operator.
constexpr std::enable_if< std::is_convertible< type, std::string >::value, const std::string & >::type get() const
Definition: parameter_value.hpp:279
@ PARAMETER_DOUBLE
Definition: parameter_value.hpp:37
@ PARAMETER_NOT_SET
Definition: parameter_value.hpp:34
@ PARAMETER_BOOL
Definition: parameter_value.hpp:35
ParameterType
Definition: parameter_value.hpp:32
@ PARAMETER_BOOL_ARRAY
Definition: parameter_value.hpp:40
std::string to_string(const FutureReturnCode &future_return_code)
String conversion function for FutureReturnCode.
constexpr std::enable_if< std::is_same< type, bool >::value, const bool & >::type get() const
Definition: parameter_value.hpp:254
constexpr std::enable_if< type==ParameterType::PARAMETER_INTEGER_ARRAY, const std::vector< int64_t > & >::type get() const
Definition: parameter_value.hpp:217
constexpr std::enable_if< type==ParameterType::PARAMETER_INTEGER, const int64_t & >::type get() const
Definition: parameter_value.hpp:159
bool operator==(const ParameterValue &rhs) const
Equal operator.
constexpr std::enable_if< std::is_convertible< type, const std::vector< double > & >::value, const std::vector< double > & >::type get() const
Definition: parameter_value.hpp:319
constexpr std::enable_if< std::is_convertible< type, const std::vector< uint8_t > & >::value, const std::vector< uint8_t > & >::type get() const
Definition: parameter_value.hpp:289
constexpr std::enable_if< type==ParameterType::PARAMETER_BYTE_ARRAY, const std::vector< uint8_t > & >::type get() const
Definition: parameter_value.hpp:193