SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
Public Member Functions | Private Attributes | List of all members
SWGSDRangel::SWGArgInfo Class Reference

#include <SWGArgInfo.h>

+ Inheritance diagram for SWGSDRangel::SWGArgInfo:
+ Collaboration diagram for SWGSDRangel::SWGArgInfo:

Public Member Functions

 SWGArgInfo ()
 
 SWGArgInfo (QString *json)
 
virtual ~SWGArgInfo ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGArgInfofromJson (QString &jsonString) override
 
QString * getKey ()
 
void setKey (QString *key)
 
QString * getValueType ()
 
void setValueType (QString *value_type)
 
QString * getValueString ()
 
void setValueString (QString *value_string)
 
QString * getName ()
 
void setName (QString *name)
 
QString * getDescription ()
 
void setDescription (QString *description)
 
QString * getUnits ()
 
void setUnits (QString *units)
 
SWGRangeFloatgetRange ()
 
void setRange (SWGRangeFloat *range)
 
QList< QString * > * getValueOptions ()
 
void setValueOptions (QList< QString *> *value_options)
 
QList< QString * > * getOptionNames ()
 
void setOptionNames (QList< QString *> *option_names)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

QString * key
 
bool m_key_isSet
 
QString * value_type
 
bool m_value_type_isSet
 
QString * value_string
 
bool m_value_string_isSet
 
QString * name
 
bool m_name_isSet
 
QString * description
 
bool m_description_isSet
 
QString * units
 
bool m_units_isSet
 
SWGRangeFloatrange
 
bool m_range_isSet
 
QList< QString * > * value_options
 
bool m_value_options_isSet
 
QList< QString * > * option_names
 
bool m_option_names_isSet
 

Detailed Description

Definition at line 34 of file SWGArgInfo.h.

Constructor & Destructor Documentation

◆ SWGArgInfo() [1/2]

SWGSDRangel::SWGArgInfo::SWGArgInfo ( )

Definition at line 30 of file SWGArgInfo.cpp.

References description, key, m_description_isSet, m_key_isSet, m_name_isSet, m_option_names_isSet, m_range_isSet, m_units_isSet, m_value_options_isSet, m_value_string_isSet, m_value_type_isSet, name, option_names, range, units, value_options, value_string, and value_type.

30  {
31  key = nullptr;
32  m_key_isSet = false;
33  value_type = nullptr;
34  m_value_type_isSet = false;
35  value_string = nullptr;
36  m_value_string_isSet = false;
37  name = nullptr;
38  m_name_isSet = false;
39  description = nullptr;
40  m_description_isSet = false;
41  units = nullptr;
42  m_units_isSet = false;
43  range = nullptr;
44  m_range_isSet = false;
45  value_options = nullptr;
46  m_value_options_isSet = false;
47  option_names = nullptr;
48  m_option_names_isSet = false;
49 }
QList< QString * > * value_options
Definition: SWGArgInfo.h:99
SWGRangeFloat * range
Definition: SWGArgInfo.h:96
QList< QString * > * option_names
Definition: SWGArgInfo.h:102

◆ SWGArgInfo() [2/2]

SWGSDRangel::SWGArgInfo::SWGArgInfo ( QString *  json)

Definition at line 25 of file SWGArgInfo.cpp.

References fromJson(), and init().

25  {
26  init();
27  this->fromJson(*json);
28 }
virtual SWGArgInfo * fromJson(QString &jsonString) override
Definition: SWGArgInfo.cpp:117
+ Here is the call graph for this function:

◆ ~SWGArgInfo()

SWGSDRangel::SWGArgInfo::~SWGArgInfo ( )
virtual

Definition at line 51 of file SWGArgInfo.cpp.

References cleanup().

51  {
52  this->cleanup();
53 }
+ Here is the call graph for this function:

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGArgInfo::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 148 of file SWGArgInfo.cpp.

References asJsonObject().

149 {
150  QJsonObject* obj = this->asJsonObject();
151 
152  QJsonDocument doc(*obj);
153  QByteArray bytes = doc.toJson();
154  delete obj;
155  return QString(bytes);
156 }
virtual QJsonObject * asJsonObject() override
Definition: SWGArgInfo.cpp:159
+ Here is the call graph for this function:

◆ asJsonObject()

QJsonObject * SWGSDRangel::SWGArgInfo::asJsonObject ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 159 of file SWGArgInfo.cpp.

References description, SWGSDRangel::SWGRangeFloat::isSet(), key, name, option_names, range, SWGSDRangel::toJsonArray(), SWGSDRangel::toJsonValue(), units, value_options, value_string, and value_type.

Referenced by asJson().

159  {
160  QJsonObject* obj = new QJsonObject();
161  if(key != nullptr && *key != QString("")){
162  toJsonValue(QString("key"), key, obj, QString("QString"));
163  }
164  if(value_type != nullptr && *value_type != QString("")){
165  toJsonValue(QString("valueType"), value_type, obj, QString("QString"));
166  }
167  if(value_string != nullptr && *value_string != QString("")){
168  toJsonValue(QString("valueString"), value_string, obj, QString("QString"));
169  }
170  if(name != nullptr && *name != QString("")){
171  toJsonValue(QString("name"), name, obj, QString("QString"));
172  }
173  if(description != nullptr && *description != QString("")){
174  toJsonValue(QString("description"), description, obj, QString("QString"));
175  }
176  if(units != nullptr && *units != QString("")){
177  toJsonValue(QString("units"), units, obj, QString("QString"));
178  }
179  if((range != nullptr) && (range->isSet())){
180  toJsonValue(QString("range"), range, obj, QString("SWGRangeFloat"));
181  }
182  if(value_options->size() > 0){
183  toJsonArray((QList<void*>*)value_options, obj, "valueOptions", "QString");
184  }
185  if(option_names->size() > 0){
186  toJsonArray((QList<void*>*)option_names, obj, "optionNames", "QString");
187  }
188 
189  return obj;
190 }
QList< QString * > * value_options
Definition: SWGArgInfo.h:99
void toJsonValue(QString name, void *value, QJsonObject *output, QString type)
Definition: SWGHelpers.cpp:383
SWGRangeFloat * range
Definition: SWGArgInfo.h:96
void toJsonArray(QList< void *> *value, QJsonObject *output, QString innerName, QString innerType)
Definition: SWGHelpers.cpp:445
QList< QString * > * option_names
Definition: SWGArgInfo.h:102
virtual bool isSet() override
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cleanup()

void SWGSDRangel::SWGArgInfo::cleanup ( )

Definition at line 78 of file SWGArgInfo.cpp.

References description, key, name, option_names, range, units, value_options, value_string, and value_type.

Referenced by ~SWGArgInfo().

78  {
79  if(key != nullptr) {
80  delete key;
81  }
82  if(value_type != nullptr) {
83  delete value_type;
84  }
85  if(value_string != nullptr) {
86  delete value_string;
87  }
88  if(name != nullptr) {
89  delete name;
90  }
91  if(description != nullptr) {
92  delete description;
93  }
94  if(units != nullptr) {
95  delete units;
96  }
97  if(range != nullptr) {
98  delete range;
99  }
100  if(value_options != nullptr) {
101  auto arr = value_options;
102  for(auto o: *arr) {
103  delete o;
104  }
105  delete value_options;
106  }
107  if(option_names != nullptr) {
108  auto arr = option_names;
109  for(auto o: *arr) {
110  delete o;
111  }
112  delete option_names;
113  }
114 }
QList< QString * > * value_options
Definition: SWGArgInfo.h:99
SWGRangeFloat * range
Definition: SWGArgInfo.h:96
QList< QString * > * option_names
Definition: SWGArgInfo.h:102
+ Here is the caller graph for this function:

◆ fromJson()

SWGArgInfo * SWGSDRangel::SWGArgInfo::fromJson ( QString &  jsonString)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 117 of file SWGArgInfo.cpp.

References fromJsonObject().

Referenced by SWGArgInfo().

117  {
118  QByteArray array (json.toStdString().c_str());
119  QJsonDocument doc = QJsonDocument::fromJson(array);
120  QJsonObject jsonObject = doc.object();
121  this->fromJsonObject(jsonObject);
122  return this;
123 }
virtual void fromJsonObject(QJsonObject &json) override
Definition: SWGArgInfo.cpp:126
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fromJsonObject()

void SWGSDRangel::SWGArgInfo::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 126 of file SWGArgInfo.cpp.

References description, key, name, option_names, range, SWGSDRangel::setValue(), units, value_options, value_string, and value_type.

Referenced by fromJson().

126  {
127  ::SWGSDRangel::setValue(&key, pJson["key"], "QString", "QString");
128 
129  ::SWGSDRangel::setValue(&value_type, pJson["valueType"], "QString", "QString");
130 
131  ::SWGSDRangel::setValue(&value_string, pJson["valueString"], "QString", "QString");
132 
133  ::SWGSDRangel::setValue(&name, pJson["name"], "QString", "QString");
134 
135  ::SWGSDRangel::setValue(&description, pJson["description"], "QString", "QString");
136 
137  ::SWGSDRangel::setValue(&units, pJson["units"], "QString", "QString");
138 
139  ::SWGSDRangel::setValue(&range, pJson["range"], "SWGRangeFloat", "SWGRangeFloat");
140 
141 
142  ::SWGSDRangel::setValue(&value_options, pJson["valueOptions"], "QList", "QString");
143 
144  ::SWGSDRangel::setValue(&option_names, pJson["optionNames"], "QList", "QString");
145 }
QList< QString * > * value_options
Definition: SWGArgInfo.h:99
SWGRangeFloat * range
Definition: SWGArgInfo.h:96
void setValue(void *value, QJsonValue obj, QString type, QString complexType)
Definition: SWGHelpers.cpp:25
QList< QString * > * option_names
Definition: SWGArgInfo.h:102
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDescription()

QString * SWGSDRangel::SWGArgInfo::getDescription ( )

Definition at line 233 of file SWGArgInfo.cpp.

References description.

233  {
234  return description;
235 }

◆ getKey()

QString * SWGSDRangel::SWGArgInfo::getKey ( )

Definition at line 193 of file SWGArgInfo.cpp.

References key.

193  {
194  return key;
195 }

◆ getName()

QString * SWGSDRangel::SWGArgInfo::getName ( )

Definition at line 223 of file SWGArgInfo.cpp.

References name.

223  {
224  return name;
225 }

◆ getOptionNames()

QList< QString * > * SWGSDRangel::SWGArgInfo::getOptionNames ( )

Definition at line 273 of file SWGArgInfo.cpp.

References option_names.

Referenced by SoapySDROutput::webapiFormatArgInfo(), and SoapySDRInput::webapiFormatArgInfo().

273  {
274  return option_names;
275 }
QList< QString * > * option_names
Definition: SWGArgInfo.h:102
+ Here is the caller graph for this function:

◆ getRange()

SWGRangeFloat * SWGSDRangel::SWGArgInfo::getRange ( )

Definition at line 253 of file SWGArgInfo.cpp.

References range.

Referenced by SoapySDROutput::webapiFormatArgInfo(), and SoapySDRInput::webapiFormatArgInfo().

253  {
254  return range;
255 }
SWGRangeFloat * range
Definition: SWGArgInfo.h:96
+ Here is the caller graph for this function:

◆ getUnits()

QString * SWGSDRangel::SWGArgInfo::getUnits ( )

Definition at line 243 of file SWGArgInfo.cpp.

References units.

243  {
244  return units;
245 }

◆ getValueOptions()

QList< QString * > * SWGSDRangel::SWGArgInfo::getValueOptions ( )

Definition at line 263 of file SWGArgInfo.cpp.

References value_options.

Referenced by SoapySDROutput::webapiFormatArgInfo(), and SoapySDRInput::webapiFormatArgInfo().

263  {
264  return value_options;
265 }
QList< QString * > * value_options
Definition: SWGArgInfo.h:99
+ Here is the caller graph for this function:

◆ getValueString()

QString * SWGSDRangel::SWGArgInfo::getValueString ( )

Definition at line 213 of file SWGArgInfo.cpp.

References value_string.

213  {
214  return value_string;
215 }

◆ getValueType()

QString * SWGSDRangel::SWGArgInfo::getValueType ( )

Definition at line 203 of file SWGArgInfo.cpp.

References value_type.

203  {
204  return value_type;
205 }

◆ init()

void SWGSDRangel::SWGArgInfo::init ( )

Definition at line 56 of file SWGArgInfo.cpp.

References description, key, m_description_isSet, m_key_isSet, m_name_isSet, m_option_names_isSet, m_range_isSet, m_units_isSet, m_value_options_isSet, m_value_string_isSet, m_value_type_isSet, name, option_names, range, units, value_options, value_string, and value_type.

Referenced by SWGArgInfo().

56  {
57  key = new QString("");
58  m_key_isSet = false;
59  value_type = new QString("");
60  m_value_type_isSet = false;
61  value_string = new QString("");
62  m_value_string_isSet = false;
63  name = new QString("");
64  m_name_isSet = false;
65  description = new QString("");
66  m_description_isSet = false;
67  units = new QString("");
68  m_units_isSet = false;
69  range = new SWGRangeFloat();
70  m_range_isSet = false;
71  value_options = new QList<QString*>();
72  m_value_options_isSet = false;
73  option_names = new QList<QString*>();
74  m_option_names_isSet = false;
75 }
QList< QString * > * value_options
Definition: SWGArgInfo.h:99
SWGRangeFloat * range
Definition: SWGArgInfo.h:96
QList< QString * > * option_names
Definition: SWGArgInfo.h:102
+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGArgInfo::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 284 of file SWGArgInfo.cpp.

References description, SWGSDRangel::SWGRangeFloat::isSet(), key, name, option_names, range, units, value_options, value_string, and value_type.

284  {
285  bool isObjectUpdated = false;
286  do{
287  if(key != nullptr && *key != QString("")){ isObjectUpdated = true; break;}
288  if(value_type != nullptr && *value_type != QString("")){ isObjectUpdated = true; break;}
289  if(value_string != nullptr && *value_string != QString("")){ isObjectUpdated = true; break;}
290  if(name != nullptr && *name != QString("")){ isObjectUpdated = true; break;}
291  if(description != nullptr && *description != QString("")){ isObjectUpdated = true; break;}
292  if(units != nullptr && *units != QString("")){ isObjectUpdated = true; break;}
293  if(range != nullptr && range->isSet()){ isObjectUpdated = true; break;}
294  if(value_options->size() > 0){ isObjectUpdated = true; break;}
295  if(option_names->size() > 0){ isObjectUpdated = true; break;}
296  }while(false);
297  return isObjectUpdated;
298 }
QList< QString * > * value_options
Definition: SWGArgInfo.h:99
SWGRangeFloat * range
Definition: SWGArgInfo.h:96
QList< QString * > * option_names
Definition: SWGArgInfo.h:102
virtual bool isSet() override
+ Here is the call graph for this function:

◆ setDescription()

void SWGSDRangel::SWGArgInfo::setDescription ( QString *  description)

Definition at line 237 of file SWGArgInfo.cpp.

References description, and m_description_isSet.

Referenced by SoapySDROutput::webapiFormatArgInfo(), and SoapySDRInput::webapiFormatArgInfo().

237  {
238  this->description = description;
239  this->m_description_isSet = true;
240 }
+ Here is the caller graph for this function:

◆ setKey()

void SWGSDRangel::SWGArgInfo::setKey ( QString *  key)

Definition at line 197 of file SWGArgInfo.cpp.

References key, and m_key_isSet.

Referenced by SoapySDROutput::webapiFormatArgInfo(), and SoapySDRInput::webapiFormatArgInfo().

197  {
198  this->key = key;
199  this->m_key_isSet = true;
200 }
+ Here is the caller graph for this function:

◆ setName()

void SWGSDRangel::SWGArgInfo::setName ( QString *  name)

Definition at line 227 of file SWGArgInfo.cpp.

References m_name_isSet, and name.

Referenced by SoapySDROutput::webapiFormatArgInfo(), and SoapySDRInput::webapiFormatArgInfo().

227  {
228  this->name = name;
229  this->m_name_isSet = true;
230 }
+ Here is the caller graph for this function:

◆ setOptionNames()

void SWGSDRangel::SWGArgInfo::setOptionNames ( QList< QString *> *  option_names)

Definition at line 277 of file SWGArgInfo.cpp.

References m_option_names_isSet, and option_names.

Referenced by SoapySDROutput::webapiFormatArgInfo(), and SoapySDRInput::webapiFormatArgInfo().

277  {
278  this->option_names = option_names;
279  this->m_option_names_isSet = true;
280 }
QList< QString * > * option_names
Definition: SWGArgInfo.h:102
+ Here is the caller graph for this function:

◆ setRange()

void SWGSDRangel::SWGArgInfo::setRange ( SWGRangeFloat range)

Definition at line 257 of file SWGArgInfo.cpp.

References m_range_isSet, and range.

Referenced by SoapySDROutput::webapiFormatArgInfo(), and SoapySDRInput::webapiFormatArgInfo().

257  {
258  this->range = range;
259  this->m_range_isSet = true;
260 }
SWGRangeFloat * range
Definition: SWGArgInfo.h:96
+ Here is the caller graph for this function:

◆ setUnits()

void SWGSDRangel::SWGArgInfo::setUnits ( QString *  units)

Definition at line 247 of file SWGArgInfo.cpp.

References m_units_isSet, and units.

Referenced by SoapySDROutput::webapiFormatArgInfo(), and SoapySDRInput::webapiFormatArgInfo().

247  {
248  this->units = units;
249  this->m_units_isSet = true;
250 }
+ Here is the caller graph for this function:

◆ setValueOptions()

void SWGSDRangel::SWGArgInfo::setValueOptions ( QList< QString *> *  value_options)

Definition at line 267 of file SWGArgInfo.cpp.

References m_value_options_isSet, and value_options.

Referenced by SoapySDROutput::webapiFormatArgInfo(), and SoapySDRInput::webapiFormatArgInfo().

267  {
269  this->m_value_options_isSet = true;
270 }
QList< QString * > * value_options
Definition: SWGArgInfo.h:99
+ Here is the caller graph for this function:

◆ setValueString()

void SWGSDRangel::SWGArgInfo::setValueString ( QString *  value_string)

Definition at line 217 of file SWGArgInfo.cpp.

References m_value_string_isSet, and value_string.

Referenced by SoapySDROutput::webapiFormatArgInfo(), and SoapySDRInput::webapiFormatArgInfo().

217  {
218  this->value_string = value_string;
219  this->m_value_string_isSet = true;
220 }
+ Here is the caller graph for this function:

◆ setValueType()

void SWGSDRangel::SWGArgInfo::setValueType ( QString *  value_type)

Definition at line 207 of file SWGArgInfo.cpp.

References m_value_type_isSet, and value_type.

Referenced by SoapySDROutput::webapiFormatArgInfo(), and SoapySDRInput::webapiFormatArgInfo().

207  {
208  this->value_type = value_type;
209  this->m_value_type_isSet = true;
210 }
+ Here is the caller graph for this function:

Member Data Documentation

◆ description

QString* SWGSDRangel::SWGArgInfo::description
private

◆ key

QString* SWGSDRangel::SWGArgInfo::key
private

Definition at line 78 of file SWGArgInfo.h.

Referenced by asJsonObject(), cleanup(), fromJsonObject(), getKey(), init(), isSet(), setKey(), and SWGArgInfo().

◆ m_description_isSet

bool SWGSDRangel::SWGArgInfo::m_description_isSet
private

Definition at line 91 of file SWGArgInfo.h.

Referenced by init(), setDescription(), and SWGArgInfo().

◆ m_key_isSet

bool SWGSDRangel::SWGArgInfo::m_key_isSet
private

Definition at line 79 of file SWGArgInfo.h.

Referenced by init(), setKey(), and SWGArgInfo().

◆ m_name_isSet

bool SWGSDRangel::SWGArgInfo::m_name_isSet
private

Definition at line 88 of file SWGArgInfo.h.

Referenced by init(), setName(), and SWGArgInfo().

◆ m_option_names_isSet

bool SWGSDRangel::SWGArgInfo::m_option_names_isSet
private

Definition at line 103 of file SWGArgInfo.h.

Referenced by init(), setOptionNames(), and SWGArgInfo().

◆ m_range_isSet

bool SWGSDRangel::SWGArgInfo::m_range_isSet
private

Definition at line 97 of file SWGArgInfo.h.

Referenced by init(), setRange(), and SWGArgInfo().

◆ m_units_isSet

bool SWGSDRangel::SWGArgInfo::m_units_isSet
private

Definition at line 94 of file SWGArgInfo.h.

Referenced by init(), setUnits(), and SWGArgInfo().

◆ m_value_options_isSet

bool SWGSDRangel::SWGArgInfo::m_value_options_isSet
private

Definition at line 100 of file SWGArgInfo.h.

Referenced by init(), setValueOptions(), and SWGArgInfo().

◆ m_value_string_isSet

bool SWGSDRangel::SWGArgInfo::m_value_string_isSet
private

Definition at line 85 of file SWGArgInfo.h.

Referenced by init(), setValueString(), and SWGArgInfo().

◆ m_value_type_isSet

bool SWGSDRangel::SWGArgInfo::m_value_type_isSet
private

Definition at line 82 of file SWGArgInfo.h.

Referenced by init(), setValueType(), and SWGArgInfo().

◆ name

QString* SWGSDRangel::SWGArgInfo::name
private

Definition at line 87 of file SWGArgInfo.h.

Referenced by asJsonObject(), cleanup(), fromJsonObject(), getName(), init(), isSet(), setName(), and SWGArgInfo().

◆ option_names

QList<QString*>* SWGSDRangel::SWGArgInfo::option_names
private

◆ range

SWGRangeFloat* SWGSDRangel::SWGArgInfo::range
private

◆ units

QString* SWGSDRangel::SWGArgInfo::units
private

◆ value_options

QList<QString*>* SWGSDRangel::SWGArgInfo::value_options
private

◆ value_string

QString* SWGSDRangel::SWGArgInfo::value_string
private

◆ value_type

QString* SWGSDRangel::SWGArgInfo::value_type
private

The documentation for this class was generated from the following files: