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.
SWGInstanceSummaryResponse.cpp
Go to the documentation of this file.
1 
15 
16 #include "SWGHelpers.h"
17 
18 #include <QJsonDocument>
19 #include <QJsonArray>
20 #include <QObject>
21 #include <QDebug>
22 
23 namespace SWGSDRangel {
24 
26  init();
27  this->fromJson(*json);
28 }
29 
31  version = nullptr;
32  m_version_isSet = false;
33  qt_version = nullptr;
34  m_qt_version_isSet = false;
35  dsp_rx_bits = 0;
36  m_dsp_rx_bits_isSet = false;
37  dsp_tx_bits = 0;
38  m_dsp_tx_bits_isSet = false;
39  pid = 0;
40  m_pid_isSet = false;
41  appname = nullptr;
42  m_appname_isSet = false;
43  architecture = nullptr;
44  m_architecture_isSet = false;
45  os = nullptr;
46  m_os_isSet = false;
47  logging = nullptr;
48  m_logging_isSet = false;
49  devicesetlist = nullptr;
50  m_devicesetlist_isSet = false;
51 }
52 
54  this->cleanup();
55 }
56 
57 void
59  version = new QString("");
60  m_version_isSet = false;
61  qt_version = new QString("");
62  m_qt_version_isSet = false;
63  dsp_rx_bits = 0;
64  m_dsp_rx_bits_isSet = false;
65  dsp_tx_bits = 0;
66  m_dsp_tx_bits_isSet = false;
67  pid = 0;
68  m_pid_isSet = false;
69  appname = new QString("");
70  m_appname_isSet = false;
71  architecture = new QString("");
72  m_architecture_isSet = false;
73  os = new QString("");
74  m_os_isSet = false;
75  logging = new SWGLoggingInfo();
76  m_logging_isSet = false;
78  m_devicesetlist_isSet = false;
79 }
80 
81 void
83  if(version != nullptr) {
84  delete version;
85  }
86  if(qt_version != nullptr) {
87  delete qt_version;
88  }
89 
90 
91 
92  if(appname != nullptr) {
93  delete appname;
94  }
95  if(architecture != nullptr) {
96  delete architecture;
97  }
98  if(os != nullptr) {
99  delete os;
100  }
101  if(logging != nullptr) {
102  delete logging;
103  }
104  if(devicesetlist != nullptr) {
105  delete devicesetlist;
106  }
107 }
108 
111  QByteArray array (json.toStdString().c_str());
112  QJsonDocument doc = QJsonDocument::fromJson(array);
113  QJsonObject jsonObject = doc.object();
114  this->fromJsonObject(jsonObject);
115  return this;
116 }
117 
118 void
120  ::SWGSDRangel::setValue(&version, pJson["version"], "QString", "QString");
121 
122  ::SWGSDRangel::setValue(&qt_version, pJson["qtVersion"], "QString", "QString");
123 
124  ::SWGSDRangel::setValue(&dsp_rx_bits, pJson["dspRxBits"], "qint32", "");
125 
126  ::SWGSDRangel::setValue(&dsp_tx_bits, pJson["dspTxBits"], "qint32", "");
127 
128  ::SWGSDRangel::setValue(&pid, pJson["pid"], "qint32", "");
129 
130  ::SWGSDRangel::setValue(&appname, pJson["appname"], "QString", "QString");
131 
132  ::SWGSDRangel::setValue(&architecture, pJson["architecture"], "QString", "QString");
133 
134  ::SWGSDRangel::setValue(&os, pJson["os"], "QString", "QString");
135 
136  ::SWGSDRangel::setValue(&logging, pJson["logging"], "SWGLoggingInfo", "SWGLoggingInfo");
137 
138  ::SWGSDRangel::setValue(&devicesetlist, pJson["devicesetlist"], "SWGDeviceSetList", "SWGDeviceSetList");
139 
140 }
141 
142 QString
144 {
145  QJsonObject* obj = this->asJsonObject();
146 
147  QJsonDocument doc(*obj);
148  QByteArray bytes = doc.toJson();
149  delete obj;
150  return QString(bytes);
151 }
152 
153 QJsonObject*
155  QJsonObject* obj = new QJsonObject();
156  if(version != nullptr && *version != QString("")){
157  toJsonValue(QString("version"), version, obj, QString("QString"));
158  }
159  if(qt_version != nullptr && *qt_version != QString("")){
160  toJsonValue(QString("qtVersion"), qt_version, obj, QString("QString"));
161  }
163  obj->insert("dspRxBits", QJsonValue(dsp_rx_bits));
164  }
166  obj->insert("dspTxBits", QJsonValue(dsp_tx_bits));
167  }
168  if(m_pid_isSet){
169  obj->insert("pid", QJsonValue(pid));
170  }
171  if(appname != nullptr && *appname != QString("")){
172  toJsonValue(QString("appname"), appname, obj, QString("QString"));
173  }
174  if(architecture != nullptr && *architecture != QString("")){
175  toJsonValue(QString("architecture"), architecture, obj, QString("QString"));
176  }
177  if(os != nullptr && *os != QString("")){
178  toJsonValue(QString("os"), os, obj, QString("QString"));
179  }
180  if((logging != nullptr) && (logging->isSet())){
181  toJsonValue(QString("logging"), logging, obj, QString("SWGLoggingInfo"));
182  }
183  if((devicesetlist != nullptr) && (devicesetlist->isSet())){
184  toJsonValue(QString("devicesetlist"), devicesetlist, obj, QString("SWGDeviceSetList"));
185  }
186 
187  return obj;
188 }
189 
190 QString*
192  return version;
193 }
194 void
196  this->version = version;
197  this->m_version_isSet = true;
198 }
199 
200 QString*
202  return qt_version;
203 }
204 void
206  this->qt_version = qt_version;
207  this->m_qt_version_isSet = true;
208 }
209 
210 qint32
212  return dsp_rx_bits;
213 }
214 void
216  this->dsp_rx_bits = dsp_rx_bits;
217  this->m_dsp_rx_bits_isSet = true;
218 }
219 
220 qint32
222  return dsp_tx_bits;
223 }
224 void
226  this->dsp_tx_bits = dsp_tx_bits;
227  this->m_dsp_tx_bits_isSet = true;
228 }
229 
230 qint32
232  return pid;
233 }
234 void
236  this->pid = pid;
237  this->m_pid_isSet = true;
238 }
239 
240 QString*
242  return appname;
243 }
244 void
246  this->appname = appname;
247  this->m_appname_isSet = true;
248 }
249 
250 QString*
252  return architecture;
253 }
254 void
256  this->architecture = architecture;
257  this->m_architecture_isSet = true;
258 }
259 
260 QString*
262  return os;
263 }
264 void
266  this->os = os;
267  this->m_os_isSet = true;
268 }
269 
272  return logging;
273 }
274 void
276  this->logging = logging;
277  this->m_logging_isSet = true;
278 }
279 
282  return devicesetlist;
283 }
284 void
286  this->devicesetlist = devicesetlist;
287  this->m_devicesetlist_isSet = true;
288 }
289 
290 
291 bool
293  bool isObjectUpdated = false;
294  do{
295  if(version != nullptr && *version != QString("")){ isObjectUpdated = true; break;}
296  if(qt_version != nullptr && *qt_version != QString("")){ isObjectUpdated = true; break;}
297  if(m_dsp_rx_bits_isSet){ isObjectUpdated = true; break;}
298  if(m_dsp_tx_bits_isSet){ isObjectUpdated = true; break;}
299  if(m_pid_isSet){ isObjectUpdated = true; break;}
300  if(appname != nullptr && *appname != QString("")){ isObjectUpdated = true; break;}
301  if(architecture != nullptr && *architecture != QString("")){ isObjectUpdated = true; break;}
302  if(os != nullptr && *os != QString("")){ isObjectUpdated = true; break;}
303  if(logging != nullptr && logging->isSet()){ isObjectUpdated = true; break;}
304  if(devicesetlist != nullptr && devicesetlist->isSet()){ isObjectUpdated = true; break;}
305  }while(false);
306  return isObjectUpdated;
307 }
308 }
309 
virtual bool isSet() override
void toJsonValue(QString name, void *value, QJsonObject *output, QString type)
Definition: SWGHelpers.cpp:383
virtual SWGInstanceSummaryResponse * fromJson(QString &jsonString) override
virtual void fromJsonObject(QJsonObject &json) override
void setValue(void *value, QJsonValue obj, QString type, QString complexType)
Definition: SWGHelpers.cpp:25
virtual bool isSet() override
void setDevicesetlist(SWGDeviceSetList *devicesetlist)