24typedef std::map<std::string, std::string>
Kwargs;
48template <
typename Type>
58template <
typename Type>
72 Range(
const double minimum,
const double maximum,
const double step=0.0);
75 double minimum(
void)
const;
78 double maximum(
void)
const;
81 double step(
void)
const;
84 double _min, _max, _step;
174template <
typename Type>
175typename std::enable_if<std::is_same<Type, bool>::value, Type>::type
StringToSetting(
const std::string &s)
186 }
catch (std::invalid_argument&) {
192template <
typename Type>
193typename std::enable_if<not std::is_same<Type, bool>::value and std::is_integral<Type>::value and std::is_signed<Type>::value, Type>::type
StringToSetting(
const std::string &s)
195 return Type(std::stoll(s));
198template <
typename Type>
199typename std::enable_if<not std::is_same<Type, bool>::value and std::is_integral<Type>::value and std::is_unsigned<Type>::value, Type>::type
StringToSetting(
const std::string &s)
201 return Type(std::stoull(s));
204template <
typename Type>
205typename std::enable_if<std::is_floating_point<Type>::value, Type>::type
StringToSetting(
const std::string &s)
207 return Type(std::stod(s));
210template <
typename Type>
211typename std::enable_if<std::is_same<typename std::decay<Type>::type, std::string>::value, Type>::type
StringToSetting(
const std::string &s)
231template <
typename Type>
234 return std::to_string(s);
239template <
typename Type>
245template <
typename Type>
#define SOAPY_SDR_API
Definition Config.h:41
#define SOAPY_SDR_FALSE
String definition for boolean false used in settings.
Definition Types.h:23
#define SOAPY_SDR_TRUE
String definition for boolean true used in settings.
Definition Types.h:20
ArgInfo(void)
Default constructor.
std::string units
The units of the argument: dB, Hz, etc (optional)
Definition Types.hpp:121
Range range
Definition Types.hpp:131
std::vector< std::string > options
Definition Types.hpp:137
std::string description
A brief description about the argument (optional)
Definition Types.hpp:118
std::vector< std::string > optionNames
Definition Types.hpp:143
std::string value
Definition Types.hpp:112
std::string name
The displayable name of the argument (optional, use key if empty)
Definition Types.hpp:115
std::string key
The key used to identify the argument (required)
Definition Types.hpp:105
Type
The data type of the argument (required)
Definition Types.hpp:124
@ BOOL
Definition Types.hpp:124
double maximum(void) const
Get the range maximum.
Definition Types.hpp:158
Range(const double minimum, const double maximum, const double step=0.0)
Create a min/max range.
double minimum(void) const
Get the range minimum.
Definition Types.hpp:153
double step(void) const
Get the range step size.
Definition Types.hpp:163
Range(void)
Create an empty range (0.0, 0.0)
std::enable_if< std::is_same< Type, bool >::value, Type >::type StringToSetting(const std::string &s)
Definition Types.hpp:175
std::string SettingToString(const bool &s)
Definition Types.hpp:216
Definition ConverterPrimitives.hpp:15
SOAPY_SDR_API Kwargs KwargsFromString(const std::string &markup)
std::vector< Range > RangeList
Definition Types.hpp:92
std::vector< ArgInfo > ArgInfoList
Definition Types.hpp:149
Type StringToSetting(const std::string &s)
Definition Types.hpp:240
SOAPY_SDR_API std::string KwargsToString(const Kwargs &args)
std::map< std::string, std::string > Kwargs
Typedef for a dictionary of key-value string arguments.
Definition Types.hpp:24
std::vector< Kwargs > KwargsList
Typedef for a list of key-word dictionaries.
Definition Types.hpp:39
std::string SettingToString(const Type &s)
Definition Types.hpp:246