rclcpp  master
C++ ROS Client Library API
Public Types | Public Member Functions | List of all members
rclcpp::node_interfaces::NodeParameters Class Reference

Implementation of the NodeParameters part of the Node API. More...

#include <node_parameters.hpp>

Inheritance diagram for rclcpp::node_interfaces::NodeParameters:
Inheritance graph
[legend]
Collaboration diagram for rclcpp::node_interfaces::NodeParameters:
Collaboration graph
[legend]

Public Types

using CallbacksContainerType = std::list< OnSetParametersCallbackHandle::WeakPtr >
 
- Public Types inherited from rclcpp::node_interfaces::NodeParametersInterface
using OnParametersSetCallbackType = OnSetParametersCallbackHandle::OnParametersSetCallbackType
 

Public Member Functions

 NodeParameters (const node_interfaces::NodeBaseInterface::SharedPtr node_base, const node_interfaces::NodeLoggingInterface::SharedPtr node_logging, const node_interfaces::NodeTopicsInterface::SharedPtr node_topics, const node_interfaces::NodeServicesInterface::SharedPtr node_services, const node_interfaces::NodeClockInterface::SharedPtr node_clock, const std::vector< Parameter > &parameter_overrides, bool start_parameter_services, bool start_parameter_event_publisher, const rclcpp::QoS &parameter_event_qos, const rclcpp::PublisherOptionsBase &parameter_event_publisher_options, bool allow_undeclared_parameters, bool automatically_declare_parameters_from_overrides)
 
virtual ~NodeParameters ()
 
const rclcpp::ParameterValuedeclare_parameter (const std::string &name, const rclcpp::ParameterValue &default_value, const rcl_interfaces::msg::ParameterDescriptor &parameter_descriptor, bool ignore_override) override
 Declare and initialize a parameter. More...
 
void undeclare_parameter (const std::string &name) override
 Undeclare a parameter. More...
 
bool has_parameter (const std::string &name) const override
 Return true if the parameter has been declared, otherwise false. More...
 
std::vector< rcl_interfaces::msg::SetParametersResult > set_parameters (const std::vector< rclcpp::Parameter > &parameters) override
 Set one or more parameters, one at a time. More...
 
rcl_interfaces::msg::SetParametersResult set_parameters_atomically (const std::vector< rclcpp::Parameter > &parameters) override
 Set and initialize a parameter, all at once. More...
 
std::vector< rclcpp::Parameterget_parameters (const std::vector< std::string > &names) const override
 Get descriptions of parameters given their names. More...
 
rclcpp::Parameter get_parameter (const std::string &name) const override
 Get the description of one parameter given a name. More...
 
bool get_parameter (const std::string &name, rclcpp::Parameter &parameter) const override
 Get the description of one parameter given a name. More...
 
bool get_parameters_by_prefix (const std::string &prefix, std::map< std::string, rclcpp::Parameter > &parameters) const override
 Get all parameters that have the specified prefix into the parameters map. More...
 
std::vector< rcl_interfaces::msg::ParameterDescriptor > describe_parameters (const std::vector< std::string > &names) const override
 
std::vector< uint8_t > get_parameter_types (const std::vector< std::string > &names) const override
 
rcl_interfaces::msg::ListParametersResult list_parameters (const std::vector< std::string > &prefixes, uint64_t depth) const override
 
RCUTILS_WARN_UNUSED OnSetParametersCallbackHandle::SharedPtr add_on_set_parameters_callback (OnParametersSetCallbackType callback) override
 Add a callback for when parameters are being set. More...
 
void remove_on_set_parameters_callback (const OnSetParametersCallbackHandle *const handler) override
 Remove a callback registered with add_on_set_parameters_callback. More...
 
OnParametersSetCallbackType set_on_parameters_set_callback (OnParametersSetCallbackType callback) override
 Register a callback for when parameters are being set, return an existing one. More...
 
const std::map< std::string, rclcpp::ParameterValue > & get_parameter_overrides () const override
 Return the initial parameter values used by the NodeParameters to override default values. More...
 
- Public Member Functions inherited from rclcpp::node_interfaces::NodeParametersInterface
virtual ~NodeParametersInterface ()=default
 

Detailed Description

Implementation of the NodeParameters part of the Node API.

Member Typedef Documentation

◆ CallbacksContainerType

using rclcpp::node_interfaces::NodeParameters::CallbacksContainerType = std::list<OnSetParametersCallbackHandle::WeakPtr>

Constructor & Destructor Documentation

◆ NodeParameters()

rclcpp::node_interfaces::NodeParameters::NodeParameters ( const node_interfaces::NodeBaseInterface::SharedPtr  node_base,
const node_interfaces::NodeLoggingInterface::SharedPtr  node_logging,
const node_interfaces::NodeTopicsInterface::SharedPtr  node_topics,
const node_interfaces::NodeServicesInterface::SharedPtr  node_services,
const node_interfaces::NodeClockInterface::SharedPtr  node_clock,
const std::vector< Parameter > &  parameter_overrides,
bool  start_parameter_services,
bool  start_parameter_event_publisher,
const rclcpp::QoS parameter_event_qos,
const rclcpp::PublisherOptionsBase parameter_event_publisher_options,
bool  allow_undeclared_parameters,
bool  automatically_declare_parameters_from_overrides 
)

◆ ~NodeParameters()

virtual rclcpp::node_interfaces::NodeParameters::~NodeParameters ( )
virtual

Member Function Documentation

◆ declare_parameter()

const rclcpp::ParameterValue& rclcpp::node_interfaces::NodeParameters::declare_parameter ( const std::string name,
const rclcpp::ParameterValue default_value,
const rcl_interfaces::msg::ParameterDescriptor &  parameter_descriptor,
bool  ignore_override 
)
overridevirtual

Declare and initialize a parameter.

See also
rclcpp::Node::declare_parameter

Implements rclcpp::node_interfaces::NodeParametersInterface.

◆ undeclare_parameter()

void rclcpp::node_interfaces::NodeParameters::undeclare_parameter ( const std::string name)
overridevirtual

◆ has_parameter()

bool rclcpp::node_interfaces::NodeParameters::has_parameter ( const std::string name) const
overridevirtual

Return true if the parameter has been declared, otherwise false.

See also
rclcpp::Node::has_parameter

Implements rclcpp::node_interfaces::NodeParametersInterface.

◆ set_parameters()

std::vector<rcl_interfaces::msg::SetParametersResult> rclcpp::node_interfaces::NodeParameters::set_parameters ( const std::vector< rclcpp::Parameter > &  parameters)
overridevirtual

Set one or more parameters, one at a time.

See also
rclcpp::Node::set_parameters

Implements rclcpp::node_interfaces::NodeParametersInterface.

◆ set_parameters_atomically()

rcl_interfaces::msg::SetParametersResult rclcpp::node_interfaces::NodeParameters::set_parameters_atomically ( const std::vector< rclcpp::Parameter > &  parameters)
overridevirtual

Set and initialize a parameter, all at once.

See also
rclcpp::Node::set_parameters_atomically

Implements rclcpp::node_interfaces::NodeParametersInterface.

◆ get_parameters()

std::vector<rclcpp::Parameter> rclcpp::node_interfaces::NodeParameters::get_parameters ( const std::vector< std::string > &  names) const
overridevirtual

Get descriptions of parameters given their names.

Implements rclcpp::node_interfaces::NodeParametersInterface.

◆ get_parameter() [1/2]

rclcpp::Parameter rclcpp::node_interfaces::NodeParameters::get_parameter ( const std::string name) const
overridevirtual

Get the description of one parameter given a name.

Implements rclcpp::node_interfaces::NodeParametersInterface.

◆ get_parameter() [2/2]

bool rclcpp::node_interfaces::NodeParameters::get_parameter ( const std::string name,
rclcpp::Parameter parameter 
) const
overridevirtual

Get the description of one parameter given a name.

Implements rclcpp::node_interfaces::NodeParametersInterface.

◆ get_parameters_by_prefix()

bool rclcpp::node_interfaces::NodeParameters::get_parameters_by_prefix ( const std::string prefix,
std::map< std::string, rclcpp::Parameter > &  parameters 
) const
overridevirtual

Get all parameters that have the specified prefix into the parameters map.

Implements rclcpp::node_interfaces::NodeParametersInterface.

◆ describe_parameters()

std::vector<rcl_interfaces::msg::ParameterDescriptor> rclcpp::node_interfaces::NodeParameters::describe_parameters ( const std::vector< std::string > &  names) const
overridevirtual

◆ get_parameter_types()

std::vector<uint8_t> rclcpp::node_interfaces::NodeParameters::get_parameter_types ( const std::vector< std::string > &  names) const
overridevirtual

◆ list_parameters()

rcl_interfaces::msg::ListParametersResult rclcpp::node_interfaces::NodeParameters::list_parameters ( const std::vector< std::string > &  prefixes,
uint64_t  depth 
) const
overridevirtual

◆ add_on_set_parameters_callback()

RCUTILS_WARN_UNUSED OnSetParametersCallbackHandle::SharedPtr rclcpp::node_interfaces::NodeParameters::add_on_set_parameters_callback ( OnParametersSetCallbackType  callback)
overridevirtual

Add a callback for when parameters are being set.

See also
rclcpp::Node::add_on_set_parameters_callback

Implements rclcpp::node_interfaces::NodeParametersInterface.

◆ remove_on_set_parameters_callback()

void rclcpp::node_interfaces::NodeParameters::remove_on_set_parameters_callback ( const OnSetParametersCallbackHandle *const  handler)
overridevirtual

Remove a callback registered with add_on_set_parameters_callback.

See also
rclcpp::Node::remove_on_set_parameters_callback

Implements rclcpp::node_interfaces::NodeParametersInterface.

◆ set_on_parameters_set_callback()

OnParametersSetCallbackType rclcpp::node_interfaces::NodeParameters::set_on_parameters_set_callback ( OnParametersSetCallbackType  callback)
overridevirtual

Register a callback for when parameters are being set, return an existing one.

Deprecated:
Use add_on_set_parameters_callback instead.
See also
rclcpp::Node::set_on_parameters_set_callback

Implements rclcpp::node_interfaces::NodeParametersInterface.

◆ get_parameter_overrides()

const std::map<std::string, rclcpp::ParameterValue>& rclcpp::node_interfaces::NodeParameters::get_parameter_overrides ( ) const
overridevirtual

Return the initial parameter values used by the NodeParameters to override default values.

Implements rclcpp::node_interfaces::NodeParametersInterface.


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