Public Member Functions | List of all members
cras::GetParamAdapter Struct Referenceabstract

An adapter that allows getting ROS parameters from various sources. More...

#include <get_param_adapter.hpp>

Inheritance diagram for cras::GetParamAdapter:
Inheritance graph
[legend]

Public Member Functions

virtual std::string getNamespace () const noexcept=0
 Get the namespace of this adapter. It should somehow represent the source of the parameters. More...
 
virtual std::shared_ptr< GetParamAdaptergetNamespaced (const std::string &ns) const noexcept(false)=0
 Construct another adapter whose source are parameters that are in a sub-namespace of this adapter. More...
 
virtual bool getParam (const std::string &name, XmlRpc::XmlRpcValue &value) const noexcept=0
 Get the value of a parameter as XmlRpcValue. More...
 
virtual bool hasParam (const std::string &name) const noexcept=0
 Return whether this adapter is able to get a value of the given parameter. More...
 
virtual ~GetParamAdapter ()=default
 

Detailed Description

An adapter that allows getting ROS parameters from various sources.

Definition at line 22 of file get_param_adapter.hpp.

Constructor & Destructor Documentation

◆ ~GetParamAdapter()

virtual cras::GetParamAdapter::~GetParamAdapter ( )
virtualdefault

Member Function Documentation

◆ getNamespace()

virtual std::string cras::GetParamAdapter::getNamespace ( ) const
pure virtualnoexcept

Get the namespace of this adapter. It should somehow represent the source of the parameters.

Returns
The namespace.

Implemented in cras::NodeHandleGetParamAdapter, and cras::XmlRpcValueGetParamAdapter.

◆ getNamespaced()

virtual std::shared_ptr<GetParamAdapter> cras::GetParamAdapter::getNamespaced ( const std::string &  ns) const
pure virtualnoexcept

Construct another adapter whose source are parameters that are in a sub-namespace of this adapter.

Parameters
[in]nsThe namespace to search parameters in.
Returns
The constructed adapter. The function should never return null (throw an exception on failure).
Exceptions
std::runtime_errorIf something fails.
ros::InvalidNameExceptionIf the namespace specification does not follow ROS parameter name rules.

◆ getParam()

virtual bool cras::GetParamAdapter::getParam ( const std::string &  name,
XmlRpc::XmlRpcValue value 
) const
pure virtualnoexcept

Get the value of a parameter as XmlRpcValue.

Parameters
[in]nameName of the parameter.
[out]valueValue of the parameter (unchanged if getting the parameter failed).
Returns
Whether getting the parameter succeeded.

◆ hasParam()

virtual bool cras::GetParamAdapter::hasParam ( const std::string &  name) const
pure virtualnoexcept

Return whether this adapter is able to get a value of the given parameter.

Parameters
[in]nameName of the parameter.
Returns
Whether this adapter is able to get a value of the given parameter.

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


cras_cpp_common
Author(s): Martin Pecka
autogenerated on Sat Jun 17 2023 02:32:53