RUSH
Reusable Utilities in Single Headers is a collection of header-only utilities for C++
Loading...
Searching...
No Matches
rush::ros::ParamMapper Class Reference

This class represents a map of parameter names to ParamValue objects. More...

#include <ros-parameter-manager.hpp>

Inheritance diagram for rush::ros::ParamMapper:

Public Member Functions

 ParamMapper (const std::string &ns)
 Constructor that loads parameters from a specified namespace.
 
ParamValueoperator[] (const std::string &key)
 Overloaded subscript operator to access a parameter by name.
 
void load (std::string ns="")
 Load parameters from a specified namespace.
 
void reload ()
 Reload parameters from all stored namespaces.
 
std::vector< std::string > getKeys () const
 Get a vector of parameter names in the map.
 

Detailed Description

This class represents a map of parameter names to ParamValue objects.

Constructor & Destructor Documentation

◆ ParamMapper()

rush::ros::ParamMapper::ParamMapper ( const std::string & ns)
inlineexplicit

Constructor that loads parameters from a specified namespace.

Parameters
nsThe namespace to load parameters from.

Member Function Documentation

◆ getKeys()

std::vector< std::string > rush::ros::ParamMapper::getKeys ( ) const
inlinenodiscard

Get a vector of parameter names in the map.

Returns
Vector of parameter names.

◆ load()

void rush::ros::ParamMapper::load ( std::string ns = "")
inline

Load parameters from a specified namespace.

Parameters
nsThe namespace to load parameters from.

◆ operator[]()

ParamValue & rush::ros::ParamMapper::operator[] ( const std::string & key)
inline

Overloaded subscript operator to access a parameter by name.

Parameters
keyThe name of the parameter.
Returns
Reference to the ParamValue associated with the parameter name.
Exceptions
std::runtime_errorif the parameter name is not found.

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