SoapySDR  0.7.1-g5838bc91
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 
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 
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 
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 }
Definition: Types.hpp:42
std::vector< Kwargs > KwargsList
Typedef for a list of key-word dictionaries.
Definition: Types.hpp:37
std::vector< ArgInfo > ArgInfoList
Definition: Types.hpp:127
double step(void) const
Get the range step size.
Definition: Types.hpp:141
Range range
Definition: Types.hpp:109
std::map< std::string, std::string > Kwargs
Typedef for a dictionary of key-value string arguments.
Definition: Types.hpp:22
double maximum(void) const
Get the range maximum.
Definition: Types.hpp:136
double minimum(void) const
Get the range minimum.
Definition: Types.hpp:131
std::vector< Range > RangeList
Definition: Types.hpp:70
Definition: Types.hpp:75
Definition: ConverterPrimitives.hpp:14
std::string description
A brief description about the argument (optional)
Definition: Types.hpp:96
SOAPY_SDR_API Kwargs KwargsFromString(const std::string &markup)
SOAPY_SDR_API std::string KwargsToString(const Kwargs &args)
#define SOAPY_SDR_API
Definition: Config.h:41
std::vector< std::string > options
Definition: Types.hpp:115
std::string key
The key used to identify the argument (required)
Definition: Types.hpp:83
std::vector< std::string > optionNames
Definition: Types.hpp:121
std::string name
The displayable name of the argument (optional, use key if empty)
Definition: Types.hpp:93
std::string units
The units of the argument: dB, Hz, etc (optional)
Definition: Types.hpp:99
Type
The data type of the argument (required)
Definition: Types.hpp:102
std::string value
Definition: Types.hpp:90