Public Member Functions | Public Attributes | List of all members
cras::GetParamResult< T > Struct Template Reference

Wrapper for the result of a getParam() call. It is designed to autoconvert to the result type sometimes. More...

#include <get_param_result.hpp>

Public Member Functions

 GetParamResult (const T &value, const ::cras::GetParamResultInfo &info)
 Construct the result from a value and info. More...
 
 operator T () const
 Autoconvert to the result value (works only sometimes). More...
 
template<typename = ::std::enable_if<::std::is_same<T, char*>::value>>
 operator::std::string () const
 Autoconvert C-string results to std::string. More...
 
template<int I, typename = ::std::enable_if<::std::is_same<T, char[I]>::value>>
 operator::std::string () const
 Autoconvert char* results to std::string. More...
 

Public Attributes

::cras::GetParamResultInfo info {}
 Details about getParam() execution. More...
 
value
 The returned value. More...
 

Detailed Description

template<typename T>
struct cras::GetParamResult< T >

Wrapper for the result of a getParam() call. It is designed to autoconvert to the result type sometimes.

Template Parameters
TType of the result.

Definition at line 45 of file get_param_result.hpp.

Constructor & Destructor Documentation

◆ GetParamResult()

template<typename T >
cras::GetParamResult< T >::GetParamResult ( const T &  value,
const ::cras::GetParamResultInfo info 
)
inline

Construct the result from a value and info.

Parameters
[in]valueThe returned value.
[in]infoDetails about getParam() execution.

Definition at line 52 of file get_param_result.hpp.

Member Function Documentation

◆ operator T()

template<typename T >
cras::GetParamResult< T >::operator T ( ) const
inline

Autoconvert to the result value (works only sometimes).

Returns
The result value.

Definition at line 58 of file get_param_result.hpp.

◆ operator::std::string() [1/2]

template<typename T >
template<typename = ::std::enable_if<::std::is_same<T, char*>::value>>
cras::GetParamResult< T >::operator::std::string ( ) const
inline

Autoconvert C-string results to std::string.

Returns
The value as std::string.

Definition at line 68 of file get_param_result.hpp.

◆ operator::std::string() [2/2]

template<typename T >
template<int I, typename = ::std::enable_if<::std::is_same<T, char[I]>::value>>
cras::GetParamResult< T >::operator::std::string ( ) const
inline

Autoconvert char* results to std::string.

Template Parameters
ILength of the C-string.
Returns
The value as std::string.

Definition at line 79 of file get_param_result.hpp.

Member Data Documentation

◆ info

template<typename T >
::cras::GetParamResultInfo cras::GetParamResult< T >::info {}

Details about getParam() execution.

Definition at line 88 of file get_param_result.hpp.

◆ value

template<typename T >
T cras::GetParamResult< T >::value

The returned value.

Definition at line 85 of file get_param_result.hpp.


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


cras_cpp_common
Author(s): Martin Pecka
autogenerated on Tue Nov 26 2024 03:49:04