rclcpp
master
C++ ROS Client Library API
|
Go to the documentation of this file.
15 #ifndef RCLCPP__PARAMETER_HPP_
16 #define RCLCPP__PARAMETER_HPP_
24 #include "rcl_interfaces/msg/parameter.hpp"
34 namespace node_interfaces
68 template<
typename ValueTypeT>
103 rcl_interfaces::msg::ParameterValue
115 template<ParameterType ParamT>
119 return value_.
get<ParamT>();
164 const
std::vector<uint8_t> &
172 const
std::vector<
bool> &
180 const
std::vector<int64_t> &
188 const
std::vector<
double> &
196 const
std::vector<
std::
string> &
230 operator<<(
std::ostream & os, const
std::vector<
Parameter> & parameters);
258 auto type_enforcing_lambda =
262 return type_enforcing_lambda();
273 return detail::get_value_helper<T>(
this);
274 }
catch (
const ParameterTypeException & ex) {
275 throw exceptions::InvalidParameterTypeException(this->name_, ex.what());
296 #endif // RCLCPP__PARAMETER_HPP_
const std::vector< std::string > & as_string_array() const
Get value of parameter as string array (vector<std::string>).
Store the type and value of a parameter.
Definition: parameter_value.hpp:71
bool as_bool() const
Get value of parameter as boolean.
rcl_interfaces::msg::ParameterValue get_value_message() const
Get value of parameter as a parameter message.
std::string get_type_name() const
Get the type name of the parameter.
int64_t as_int() const
Get value of parameter as integer.
rcl_interfaces::msg::Parameter to_parameter_msg() const
Convert the class in a parameter message.
Definition: node_parameters.hpp:48
const std::vector< int64_t > & as_integer_array() const
Get value of parameter as integer array (vector<int64_t>).
constexpr std::enable_if< type==ParameterType::PARAMETER_BOOL, const bool & >::type get() const
Definition: parameter_value.hpp:148
const std::vector< bool > & as_bool_array() const
Get value of parameter as bool array (vector<bool>).
decltype(auto) get_value() const
Get value of parameter using rclcpp::ParameterType as template argument.
Definition: parameter.hpp:117
ParameterType get_type() const
Get the type of the parameter.
bool operator==(const Parameter &rhs) const
Equal operator.
This header provides the get_node_base_interface() template function.
Definition: allocator_common.hpp:24
#define RCLCPP_PUBLIC
Definition: visibility_control.hpp:50
bool operator!=(const Parameter &rhs) const
Not equal operator.
const std::vector< double > & as_double_array() const
Get value of parameter as double array (vector<double>).
static Parameter from_parameter_msg(const rcl_interfaces::msg::Parameter ¶meter)
Convert a parameter message in a Parameter class object.
std::string value_to_string() const
Get value of parameter as a string.
const rclcpp::ParameterValue & get_parameter_value() const
Get the internal storage for the parameter value.
double as_double() const
Get value of parameter as double.
const std::string & as_string() const
Get value of parameter as string.
const std::string & get_name() const
Get the name of the parameter.
Parameter(const std::string &name, ValueTypeT value)
Construct with given name and given parameter value.
Definition: parameter.hpp:69
ParameterType
Definition: parameter_value.hpp:32
std::string to_string(const FutureReturnCode &future_return_code)
String conversion function for FutureReturnCode.
Definition: future_return_code.hpp:53
const std::vector< uint8_t > & as_byte_array() const
Get value of parameter as byte array (vector<uint8_t>).
Parameter()
Construct with an empty name and a parameter value of type rclcpp::PARAMETER_NOT_SET.
Structure to store an arbitrary parameter with templated get/set methods.
Definition: parameter.hpp:52
auto get_value_helper(const rclcpp::Parameter *parameter)
Definition: parameter.hpp:237
std::string _to_json_dict_entry(const Parameter ¶m)
Return a json encoded version of the parameter intended for a dict.