SoapySDR: Types.hpp Source File

| SoapySDR 0.7.2-ARCH Vendor and platform neutral SDR interface library

Types.hpp
Go to the documentation of this file.
1
11 #pragma once
12 #include <SoapySDR/Config.hpp>
13 #include <SoapySDR/Types.h>
14 #include <vector>
15 #include <string>
16 #include <map>
17
18 namespace SoapySDR
19 {
20
22 typedef std::map<std::string, std::string> Kwargs;
23
28 SOAPY_SDR_API Kwargs KwargsFromString(const std::string &markup);
29
34 SOAPY_SDR_API std::string KwargsToString(const Kwargs &args);
35
37 typedef std::vector<Kwargs> KwargsList;
38
42 class SOAPY_SDR_API Range
43 {
44 public:
45
47 Range(void);
48
50 Range(const double minimum, const double maximum, const double step=0.0);
51
53 double minimum(void) const;
54
56 double maximum(void) const;
57
59 double step(void) const;
60
61 private:
62 double _min, _max, _step;
63 };
64
70 typedef std::vector<Range> RangeList;
71
75 class SOAPY_SDR_API ArgInfo
76 {
77 public:
78
80 ArgInfo(void);
81
83 std::string key;
84
90 std::string value;
91
93 std::string name;
94
96 std::string description;
97
99 std::string units;
100
102 enum Type {BOOL, INT, FLOAT, STRING} type;
103
109 Range range;
110
115 std::vector<std::string> options;
116
121 std::vector<std::string> optionNames;
122 };
123
127 typedef std::vector<ArgInfo> ArgInfoList;
128
129 }
130
131 inline double SoapySDR::Range::minimum(void) const
132 {
133 return _min;
134 }
135
136 inline double SoapySDR::Range::maximum(void) const
137 {
138 return _max;
139 }
140
141 inline double SoapySDR::Range::step(void) const
142 {
143 return _step;
144 }
SOAPY_SDR_API
#define SOAPY_SDR_API
Definition: Config.h:41
SoapySDR::ArgInfo::Type
Type
The data type of the argument (required)
Definition: Types.hpp:102
SoapySDR::Range
Definition: Types.hpp:42
Types.h
SoapySDR::Range::step
double step(void) const
Get the range step size.
Definition: Types.hpp:141
SoapySDR::Range::maximum
double maximum(void) const
Get the range maximum.
Definition: Types.hpp:136
SoapySDR::Range::minimum
double minimum(void) const
Get the range minimum.
Definition: Types.hpp:131
SoapySDR::RangeList
std::vector< Range > RangeList
Definition: Types.hpp:70
SoapySDR::ArgInfo::key
std::string key
The key used to identify the argument (required)
Definition: Types.hpp:83
SoapySDR
Definition: ConverterPrimitives.hpp:14
SoapySDR::ArgInfoList
std::vector< ArgInfo > ArgInfoList
Definition: Types.hpp:127
Config.hpp
SoapySDR::KwargsFromString
SOAPY_SDR_API Kwargs KwargsFromString(const std::string &markup)
SoapySDR::Kwargs
std::map< std::string, std::string > Kwargs
Typedef for a dictionary of key-value string arguments.
Definition: Types.hpp:22
SoapySDR::ArgInfo::options
std::vector< std::string > options
Definition: Types.hpp:115
SoapySDR::ArgInfo::description
std::string description
A brief description about the argument (optional)
Definition: Types.hpp:96
SoapySDR::KwargsList
std::vector< Kwargs > KwargsList
Typedef for a list of key-word dictionaries.
Definition: Types.hpp:37
SoapySDR::ArgInfo
Definition: Types.hpp:75
SoapySDR::KwargsToString
SOAPY_SDR_API std::string KwargsToString(const Kwargs &args)
SoapySDR::ArgInfo::optionNames
std::vector< std::string > optionNames
Definition: Types.hpp:121
SoapySDR::ArgInfo::value
std::string value
Definition: Types.hpp:90
SoapySDR::ArgInfo::range
Range range
Definition: Types.hpp:109
SoapySDR::ArgInfo::units
std::string units
The units of the argument: dB, Hz, etc (optional)
Definition: Types.hpp:99
SoapySDR::ArgInfo::name
std::string name
The displayable name of the argument (optional, use key if empty)
Definition: Types.hpp:93