ROS 2 rclcpp + rcl - rolling
rolling-a919a6e5
ROS 2 C++ Client Library with ROS Client Library
|
Structure to store an arbitrary parameter with templated get/set methods. More...
#include <rclcpp/parameter.hpp>
Public Member Functions | |
RCLCPP_PUBLIC | Parameter () |
Construct with an empty name and a parameter value of type rclcpp::PARAMETER_NOT_SET. | |
RCLCPP_PUBLIC | Parameter (const std::string &name) |
Construct with given name and a parameter value of type rclcpp::PARAMETER_NOT_SET. | |
RCLCPP_PUBLIC | Parameter (const std::string &name, const ParameterValue &value) |
Construct with given name and given parameter value. | |
template<typename ValueTypeT > | |
Parameter (const std::string &name, ValueTypeT value) | |
Construct with given name and given parameter value. | |
RCLCPP_PUBLIC | Parameter (const rclcpp::node_interfaces::ParameterInfo ¶meter_info) |
RCLCPP_PUBLIC bool | operator== (const Parameter &rhs) const |
Equal operator. | |
RCLCPP_PUBLIC bool | operator!= (const Parameter &rhs) const |
Not equal operator. | |
RCLCPP_PUBLIC ParameterType | get_type () const |
Get the type of the parameter. | |
RCLCPP_PUBLIC std::string | get_type_name () const |
Get the type name of the parameter. | |
RCLCPP_PUBLIC const std::string & | get_name () const |
Get the name of the parameter. | |
RCLCPP_PUBLIC rcl_interfaces::msg::ParameterValue | get_value_message () const |
Get value of parameter as a parameter message. | |
RCLCPP_PUBLIC const rclcpp::ParameterValue & | get_parameter_value () const |
Get the internal storage for the parameter value. | |
template<ParameterType ParamT> | |
decltype(auto) | get_value () const |
Get value of parameter using rclcpp::ParameterType as template argument. More... | |
template<typename T > | |
decltype(auto) | get_value () const |
Get value of parameter using c++ types as template argument. | |
RCLCPP_PUBLIC bool | as_bool () const |
Get value of parameter as boolean. More... | |
RCLCPP_PUBLIC int64_t | as_int () const |
Get value of parameter as integer. More... | |
RCLCPP_PUBLIC double | as_double () const |
Get value of parameter as double. More... | |
RCLCPP_PUBLIC const std::string & | as_string () const |
Get value of parameter as string. More... | |
RCLCPP_PUBLIC const std::vector< uint8_t > & | as_byte_array () const |
Get value of parameter as byte array (vector<uint8_t>). More... | |
RCLCPP_PUBLIC const std::vector< bool > & | as_bool_array () const |
Get value of parameter as bool array (vector<bool>). More... | |
RCLCPP_PUBLIC const std::vector< int64_t > & | as_integer_array () const |
Get value of parameter as integer array (vector<int64_t>). More... | |
RCLCPP_PUBLIC const std::vector< double > & | as_double_array () const |
Get value of parameter as double array (vector<double>). More... | |
RCLCPP_PUBLIC const std::vector< std::string > & | as_string_array () const |
Get value of parameter as string array (vector<std::string>). More... | |
RCLCPP_PUBLIC rcl_interfaces::msg::Parameter | to_parameter_msg () const |
Convert the class in a parameter message. | |
RCLCPP_PUBLIC std::string | value_to_string () const |
Get value of parameter as a string. | |
Static Public Member Functions | |
static RCLCPP_PUBLIC Parameter | from_parameter_msg (const rcl_interfaces::msg::Parameter ¶meter) |
Convert a parameter message in a Parameter class object. | |
Structure to store an arbitrary parameter with templated get/set methods.
Definition at line 52 of file parameter.hpp.
bool Parameter::as_bool | ( | ) | const |
Get value of parameter as boolean.
rclcpp::ParameterTypeException | if the type doesn't match |
Definition at line 91 of file parameter.cpp.
const std::vector< bool > & Parameter::as_bool_array | ( | ) | const |
Get value of parameter as bool array (vector<bool>).
rclcpp::ParameterTypeException | if the type doesn't match |
Definition at line 121 of file parameter.cpp.
const std::vector< uint8_t > & Parameter::as_byte_array | ( | ) | const |
Get value of parameter as byte array (vector<uint8_t>).
rclcpp::ParameterTypeException | if the type doesn't match |
Definition at line 115 of file parameter.cpp.
double Parameter::as_double | ( | ) | const |
Get value of parameter as double.
rclcpp::ParameterTypeException | if the type doesn't match |
Definition at line 103 of file parameter.cpp.
const std::vector< double > & Parameter::as_double_array | ( | ) | const |
Get value of parameter as double array (vector<double>).
rclcpp::ParameterTypeException | if the type doesn't match |
Definition at line 133 of file parameter.cpp.
int64_t Parameter::as_int | ( | ) | const |
Get value of parameter as integer.
rclcpp::ParameterTypeException | if the type doesn't match |
Definition at line 97 of file parameter.cpp.
const std::vector< int64_t > & Parameter::as_integer_array | ( | ) | const |
Get value of parameter as integer array (vector<int64_t>).
rclcpp::ParameterTypeException | if the type doesn't match |
Definition at line 127 of file parameter.cpp.
const std::string & Parameter::as_string | ( | ) | const |
Get value of parameter as string.
rclcpp::ParameterTypeException | if the type doesn't match |
Definition at line 109 of file parameter.cpp.
const std::vector< std::string > & Parameter::as_string_array | ( | ) | const |
Get value of parameter as string array (vector<std::string>).
rclcpp::ParameterTypeException | if the type doesn't match |
Definition at line 139 of file parameter.cpp.
|
inline |
Get value of parameter using rclcpp::ParameterType as template argument.
rclcpp::exceptions::InvalidParameterTypeException | if the type doesn't match |
Definition at line 117 of file parameter.hpp.
Referenced by rclcpp::Node::get_parameter().