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

This class wraps an XmlRpcValue for convenience. More...

#include <ros-parameter-manager.hpp>

Public Member Functions

 ParamValue (const XmlRpc::XmlRpcValue &v)
 
template<typename T >
as ()
 Convert the stored value to a specific type.
 
template<typename T >
void as (T &x)
 Convert the stored value to a specific type and store it in the given variable.
 
template<typename T >
std::vector< T > as_vec ()
 Convert the stored value to a vector of a specific type.
 
template<typename T >
void as_vec (std::vector< T > &x)
 Convert the stored value to a vector of a specific type and store it in the given vector.
 

Friends

std::ostream & operator<< (std::ostream &os, const ParamValue &obj)
 Overloaded stream insertion operator to print the stored value.
 

Detailed Description

This class wraps an XmlRpcValue for convenience.

Member Function Documentation

◆ as() [1/2]

template<typename T >
T rush::ros::ParamValue::as ( )
inline

Convert the stored value to a specific type.

Template Parameters
TThe type to convert to.
Returns
The converted value.

◆ as() [2/2]

template<typename T >
void rush::ros::ParamValue::as ( T & x)
inline

Convert the stored value to a specific type and store it in the given variable.

Template Parameters
TThe type to convert to.
Parameters
xReference to the variable where the converted value will be stored.

◆ as_vec() [1/2]

template<typename T >
std::vector< T > rush::ros::ParamValue::as_vec ( )
inline

Convert the stored value to a vector of a specific type.

Template Parameters
TThe type to convert to.
Returns
The vector of converted values.

◆ as_vec() [2/2]

template<typename T >
void rush::ros::ParamValue::as_vec ( std::vector< T > & x)
inline

Convert the stored value to a vector of a specific type and store it in the given vector.

Template Parameters
TThe type to convert to.
Parameters
xReference to the vector where the converted values will be stored.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
const ParamValue & obj )
friend

Overloaded stream insertion operator to print the stored value.

Parameters
osOutput stream.
objParamValue object to be printed.
Returns
The output stream.

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