Gazebo Transport

API Reference

12.2.1
ParametersClient Class Reference

Allow to get, set, declare or list parameters. More...

#include <Client.hh>

Public Member Functions

 ParametersClient (const ParametersClient &)=delete
 No copy constructor. More...
 
 ParametersClient (const std::string &_serverNamespace="", unsigned int _timeoutMs=kDefaultTimeoutMs)
 Constructor. More...
 
 ParametersClient (ParametersClient &&)
 Default move constructor. More...
 
 ~ParametersClient ()
 Destructor. More...
 
ParameterResult DeclareParameter (const std::string &_parameterName, const google::protobuf::Message &_msg) final
 Declare a new parameter. See ParametersInterface::DeclareParameter(). More...
 
gz::msgs::ParameterDeclarations ListParameters () const final
 List all parameters. More...
 
ParametersClientoperator= (const ParametersClient &)=delete
 No copy assignment. More...
 
ParametersClientoperator= (ParametersClient &&)
 Default move assignment. More...
 
ParameterResult Parameter (const std::string &_parameterName, google::protobuf::Message &_parameter) const final
 Request the value of a parameter. See ParametersInterface::Parameter(). More...
 
ParameterResult Parameter (const std::string &_parameterName, std::unique_ptr< google::protobuf::Message > &_parameter) const final
 Request the value of a parameter. Similar to the other overload, but it allocates a message of the right type. More...
 
ParameterResult SetParameter (const std::string &_parameterName, const google::protobuf::Message &_msg) final
 Set the value of a parameter. See ParametersInterface::SetParameter(). More...
 
- Public Member Functions inherited from ParametersInterface
virtual ~ParametersInterface ()=default
 Default virtual destructor. More...
 

Detailed Description

Allow to get, set, declare or list parameters.

in a remote registry.

Constructor & Destructor Documentation

◆ ParametersClient() [1/3]

ParametersClient ( const std::string _serverNamespace = "",
unsigned int  _timeoutMs = kDefaultTimeoutMs 
)

Constructor.

Parameters
[in]_serverNamespaceNamespace of the parameters registry services. The client will send requests to:
  • /${_serverNamespace}/get_parameter
  • /${_serverNamespace}/list_parameters
  • /${_serverNamespace}/set_parameter
  • /${_serverNamespace}/declare_parameter
[in]_timeoutMsTime to wait for the server to respond.

◆ ~ParametersClient()

Destructor.

◆ ParametersClient() [2/3]

ParametersClient ( const ParametersClient )
delete

No copy constructor.

◆ ParametersClient() [3/3]

Default move constructor.

Member Function Documentation

◆ DeclareParameter()

ParameterResult DeclareParameter ( const std::string _parameterName,
const google::protobuf::Message &  _msg 
)
finalvirtual

Declare a new parameter. See ParametersInterface::DeclareParameter().

Implements ParametersInterface.

◆ ListParameters()

gz::msgs::ParameterDeclarations ListParameters ( ) const
finalvirtual

List all parameters.

Returns
Protobuf message with a list of all declared parameter names and their types.

Implements ParametersInterface.

◆ operator=() [1/2]

ParametersClient& operator= ( const ParametersClient )
delete

No copy assignment.

◆ operator=() [2/2]

ParametersClient& operator= ( ParametersClient &&  )

Default move assignment.

◆ Parameter() [1/2]

ParameterResult Parameter ( const std::string _parameterName,
google::protobuf::Message &  _parameter 
) const
finalvirtual

Request the value of a parameter. See ParametersInterface::Parameter().

Implements ParametersInterface.

◆ Parameter() [2/2]

ParameterResult Parameter ( const std::string _parameterName,
std::unique_ptr< google::protobuf::Message > &  _parameter 
) const
finalvirtual

Request the value of a parameter. Similar to the other overload, but it allocates a message of the right type.

Parameters
[in]_parameterNameName of the parameter to be requested.
[out]_parameterOutput were the parameter value will be set.
Returns
A ParameterResult return code, can return error types:

Implements ParametersInterface.

◆ SetParameter()

ParameterResult SetParameter ( const std::string _parameterName,
const google::protobuf::Message &  _msg 
)
finalvirtual

Set the value of a parameter. See ParametersInterface::SetParameter().

Implements ParametersInterface.


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