Static Public Member Functions | List of all members
cras::DefaultToParamFn< ParamServerType > Struct Template Reference

Default function for converting XmlRpcValue to an intermediate value of type ParamServerType. More...

#include <get_param_options.hpp>

Static Public Member Functions

static bool toParam (const ::XmlRpc::XmlRpcValue &x, ParamServerType &v, bool skipNonConvertible=false, ::std::list<::std::string > *errors=nullptr)
 Function converting XmlRpcValue to an intermediate value of type ParamServerType. More...
 

Detailed Description

template<typename ParamServerType>
struct cras::DefaultToParamFn< ParamServerType >

Default function for converting XmlRpcValue to an intermediate value of type ParamServerType.

Template Parameters
ParamServerTypeType of the intermediate value to which the XmlRpcValue param is converted.
Note
Create a specialization of this struct in case you need a different implementation of the conversion or if you add an overload of cras::convert() that can be included after this file (and declare the specialization after the declaration of your overload).

Definition at line 52 of file get_param_options.hpp.

Member Function Documentation

◆ toParam()

template<typename ParamServerType >
static bool cras::DefaultToParamFn< ParamServerType >::toParam ( const ::XmlRpc::XmlRpcValue x,
ParamServerType &  v,
bool  skipNonConvertible = false,
::std::list<::std::string > *  errors = nullptr 
)
inlinestatic

Function converting XmlRpcValue to an intermediate value of type ParamServerType.

Parameters
[in]xThe XmlRpcValue read from parameter server.
[out]vThe converted value. It is not valid if this function returns false.
[in]skipNonConvertibleIf true and the target value is a container, all non-convertible items will be skipped. If false, non-convertible values mean failure of the whole conversion. If all items of a container are skipped (and there were some), the conversion also fails.
[out]errorsIf non-null, any error messages coming from the conversion can be appended to this list.
Returns
Whether the conversion succeeded.
Note
This function should not throw.

Definition at line 66 of file get_param_options.hpp.


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


cras_cpp_common
Author(s): Martin Pecka
autogenerated on Sun Jan 14 2024 03:48:14