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::SWGInstanceDevicesResponse Class Reference

#include <SWGInstanceDevicesResponse.h>

+ Inheritance diagram for SWGSDRangel::SWGInstanceDevicesResponse:
+ Collaboration diagram for SWGSDRangel::SWGInstanceDevicesResponse:

Public Member Functions

 SWGInstanceDevicesResponse ()
 
 SWGInstanceDevicesResponse (QString *json)
 
virtual ~SWGInstanceDevicesResponse ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGInstanceDevicesResponsefromJson (QString &jsonString) override
 
qint32 getDevicecount ()
 
void setDevicecount (qint32 devicecount)
 
QList< SWGDeviceListItem * > * getDevices ()
 
void setDevices (QList< SWGDeviceListItem *> *devices)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

qint32 devicecount
 
bool m_devicecount_isSet
 
QList< SWGDeviceListItem * > * devices
 
bool m_devices_isSet
 

Detailed Description

Definition at line 33 of file SWGInstanceDevicesResponse.h.

Constructor & Destructor Documentation

◆ SWGInstanceDevicesResponse() [1/2]

SWGSDRangel::SWGInstanceDevicesResponse::SWGInstanceDevicesResponse ( )

◆ SWGInstanceDevicesResponse() [2/2]

SWGSDRangel::SWGInstanceDevicesResponse::SWGInstanceDevicesResponse ( QString *  json)

Definition at line 25 of file SWGInstanceDevicesResponse.cpp.

References fromJson(), and init().

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

◆ ~SWGInstanceDevicesResponse()

SWGSDRangel::SWGInstanceDevicesResponse::~SWGInstanceDevicesResponse ( )
virtual

Definition at line 37 of file SWGInstanceDevicesResponse.cpp.

References cleanup().

+ Here is the call graph for this function:

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGInstanceDevicesResponse::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 79 of file SWGInstanceDevicesResponse.cpp.

References asJsonObject().

Referenced by WebAPIRequestMapper::instanceDevicesService().

80 {
81  QJsonObject* obj = this->asJsonObject();
82 
83  QJsonDocument doc(*obj);
84  QByteArray bytes = doc.toJson();
85  delete obj;
86  return QString(bytes);
87 }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 90 of file SWGInstanceDevicesResponse.cpp.

References devicecount, devices, m_devicecount_isSet, and SWGSDRangel::toJsonArray().

Referenced by asJson().

90  {
91  QJsonObject* obj = new QJsonObject();
93  obj->insert("devicecount", QJsonValue(devicecount));
94  }
95  if(devices->size() > 0){
96  toJsonArray((QList<void*>*)devices, obj, "devices", "SWGDeviceListItem");
97  }
98 
99  return obj;
100 }
void toJsonArray(QList< void *> *value, QJsonObject *output, QString innerName, QString innerType)
Definition: SWGHelpers.cpp:445
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cleanup()

void SWGSDRangel::SWGInstanceDevicesResponse::cleanup ( )

Definition at line 50 of file SWGInstanceDevicesResponse.cpp.

References devices.

Referenced by ~SWGInstanceDevicesResponse().

50  {
51 
52  if(devices != nullptr) {
53  auto arr = devices;
54  for(auto o: *arr) {
55  delete o;
56  }
57  delete devices;
58  }
59 }
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 62 of file SWGInstanceDevicesResponse.cpp.

References fromJsonObject().

Referenced by SWGInstanceDevicesResponse().

62  {
63  QByteArray array (json.toStdString().c_str());
64  QJsonDocument doc = QJsonDocument::fromJson(array);
65  QJsonObject jsonObject = doc.object();
66  this->fromJsonObject(jsonObject);
67  return this;
68 }
virtual void fromJsonObject(QJsonObject &json) override
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fromJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 71 of file SWGInstanceDevicesResponse.cpp.

References devicecount, devices, and SWGSDRangel::setValue().

Referenced by fromJson().

71  {
72  ::SWGSDRangel::setValue(&devicecount, pJson["devicecount"], "qint32", "");
73 
74 
75  ::SWGSDRangel::setValue(&devices, pJson["devices"], "QList", "SWGDeviceListItem");
76 }
void setValue(void *value, QJsonValue obj, QString type, QString complexType)
Definition: SWGHelpers.cpp:25
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDevicecount()

qint32 SWGSDRangel::SWGInstanceDevicesResponse::getDevicecount ( )

Definition at line 103 of file SWGInstanceDevicesResponse.cpp.

References devicecount.

◆ getDevices()

QList< SWGDeviceListItem * > * SWGSDRangel::SWGInstanceDevicesResponse::getDevices ( )

Definition at line 113 of file SWGInstanceDevicesResponse.cpp.

References devices.

Referenced by WebAPIAdapterGUI::instanceDevices(), and WebAPIAdapterSrv::instanceDevices().

113  {
114  return devices;
115 }
+ Here is the caller graph for this function:

◆ init()

void SWGSDRangel::SWGInstanceDevicesResponse::init ( )

◆ isSet()

bool SWGSDRangel::SWGInstanceDevicesResponse::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 124 of file SWGInstanceDevicesResponse.cpp.

References devices, and m_devicecount_isSet.

124  {
125  bool isObjectUpdated = false;
126  do{
127  if(m_devicecount_isSet){ isObjectUpdated = true; break;}
128  if(devices->size() > 0){ isObjectUpdated = true; break;}
129  }while(false);
130  return isObjectUpdated;
131 }

◆ setDevicecount()

void SWGSDRangel::SWGInstanceDevicesResponse::setDevicecount ( qint32  devicecount)

Definition at line 107 of file SWGInstanceDevicesResponse.cpp.

References devicecount, and m_devicecount_isSet.

Referenced by WebAPIAdapterGUI::instanceDevices(), and WebAPIAdapterSrv::instanceDevices().

+ Here is the caller graph for this function:

◆ setDevices()

void SWGSDRangel::SWGInstanceDevicesResponse::setDevices ( QList< SWGDeviceListItem *> *  devices)

Definition at line 117 of file SWGInstanceDevicesResponse.cpp.

References devices, and m_devices_isSet.

117  {
118  this->devices = devices;
119  this->m_devices_isSet = true;
120 }

Member Data Documentation

◆ devicecount

qint32 SWGSDRangel::SWGInstanceDevicesResponse::devicecount
private

◆ devices

QList<SWGDeviceListItem*>* SWGSDRangel::SWGInstanceDevicesResponse::devices
private

◆ m_devicecount_isSet

bool SWGSDRangel::SWGInstanceDevicesResponse::m_devicecount_isSet
private

◆ m_devices_isSet

bool SWGSDRangel::SWGInstanceDevicesResponse::m_devices_isSet
private

Definition at line 60 of file SWGInstanceDevicesResponse.h.

Referenced by init(), setDevices(), and SWGInstanceDevicesResponse().


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