rclcpp  master
C++ ROS Client Library API
Public Member Functions | Static Public Member Functions | List of all members
rclcpp::Parameter Class Reference

Structure to store an arbitrary parameter with templated get/set methods. More...

#include <parameter.hpp>

Public Member Functions

 Parameter ()
 
 Parameter (const std::string &name, const ParameterValue &value)
 
template<typename ValueTypeT >
 Parameter (const std::string &name, ValueTypeT value)
 
ParameterType get_type () const
 
std::string get_type_name () const
 
const std::stringget_name () const
 
rcl_interfaces::msg::ParameterValue get_value_message () const
 
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. More...
 
bool as_bool () const
 
int64_t as_int () const
 
double as_double () const
 
const std::stringas_string () const
 
const std::vector< uint8_t > & as_byte_array () const
 
const std::vector< bool > & as_bool_array () const
 
const std::vector< int64_t > & as_integer_array () const
 
const std::vector< double > & as_double_array () const
 
const std::vector< std::string > & as_string_array () const
 
rcl_interfaces::msg::Parameter to_parameter_msg () const
 
std::string value_to_string () const
 

Static Public Member Functions

static Parameter from_parameter_msg (const rcl_interfaces::msg::Parameter &parameter)
 

Detailed Description

Structure to store an arbitrary parameter with templated get/set methods.

Constructor & Destructor Documentation

◆ Parameter() [1/3]

rclcpp::Parameter::Parameter ( )

◆ Parameter() [2/3]

rclcpp::Parameter::Parameter ( const std::string name,
const ParameterValue value 
)

◆ Parameter() [3/3]

template<typename ValueTypeT >
rclcpp::Parameter::Parameter ( const std::string name,
ValueTypeT  value 
)
inlineexplicit

Member Function Documentation

◆ get_type()

ParameterType rclcpp::Parameter::get_type ( ) const

◆ get_type_name()

std::string rclcpp::Parameter::get_type_name ( ) const

◆ get_name()

const std::string& rclcpp::Parameter::get_name ( ) const

◆ get_value_message()

rcl_interfaces::msg::ParameterValue rclcpp::Parameter::get_value_message ( ) const

◆ get_value() [1/2]

template<ParameterType ParamT>
decltype(auto) rclcpp::Parameter::get_value ( ) const
inline

Get value of parameter using rclcpp::ParameterType as template argument.

◆ get_value() [2/2]

template<typename T >
decltype(auto) rclcpp::Parameter::get_value ( ) const
inline

Get value of parameter using c++ types as template argument.

◆ as_bool()

bool rclcpp::Parameter::as_bool ( ) const

◆ as_int()

int64_t rclcpp::Parameter::as_int ( ) const

◆ as_double()

double rclcpp::Parameter::as_double ( ) const

◆ as_string()

const std::string& rclcpp::Parameter::as_string ( ) const

◆ as_byte_array()

const std::vector<uint8_t>& rclcpp::Parameter::as_byte_array ( ) const

◆ as_bool_array()

const std::vector<bool>& rclcpp::Parameter::as_bool_array ( ) const

◆ as_integer_array()

const std::vector<int64_t>& rclcpp::Parameter::as_integer_array ( ) const

◆ as_double_array()

const std::vector<double>& rclcpp::Parameter::as_double_array ( ) const

◆ as_string_array()

const std::vector<std::string>& rclcpp::Parameter::as_string_array ( ) const

◆ from_parameter_msg()

static Parameter rclcpp::Parameter::from_parameter_msg ( const rcl_interfaces::msg::Parameter &  parameter)
static

◆ to_parameter_msg()

rcl_interfaces::msg::Parameter rclcpp::Parameter::to_parameter_msg ( ) const

◆ value_to_string()

std::string rclcpp::Parameter::value_to_string ( ) const

The documentation for this class was generated from the following file: