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

#include <SWGDeviceSetList.h>

+ Inheritance diagram for SWGSDRangel::SWGDeviceSetList:
+ Collaboration diagram for SWGSDRangel::SWGDeviceSetList:

Public Member Functions

 SWGDeviceSetList ()
 
 SWGDeviceSetList (QString *json)
 
virtual ~SWGDeviceSetList ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGDeviceSetListfromJson (QString &jsonString) override
 
qint32 getDevicesetcount ()
 
void setDevicesetcount (qint32 devicesetcount)
 
qint32 getDevicesetfocus ()
 
void setDevicesetfocus (qint32 devicesetfocus)
 
QList< SWGDeviceSet * > * getDeviceSets ()
 
void setDeviceSets (QList< SWGDeviceSet *> *device_sets)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

qint32 devicesetcount
 
bool m_devicesetcount_isSet
 
qint32 devicesetfocus
 
bool m_devicesetfocus_isSet
 
QList< SWGDeviceSet * > * device_sets
 
bool m_device_sets_isSet
 

Detailed Description

Definition at line 33 of file SWGDeviceSetList.h.

Constructor & Destructor Documentation

◆ SWGDeviceSetList() [1/2]

SWGSDRangel::SWGDeviceSetList::SWGDeviceSetList ( )

◆ SWGDeviceSetList() [2/2]

SWGSDRangel::SWGDeviceSetList::SWGDeviceSetList ( QString *  json)

Definition at line 25 of file SWGDeviceSetList.cpp.

References fromJson(), and init().

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

◆ ~SWGDeviceSetList()

SWGSDRangel::SWGDeviceSetList::~SWGDeviceSetList ( )
virtual

Definition at line 39 of file SWGDeviceSetList.cpp.

References cleanup().

39  {
40  this->cleanup();
41 }
+ Here is the call graph for this function:

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGDeviceSetList::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 86 of file SWGDeviceSetList.cpp.

References asJsonObject().

Referenced by WebAPIRequestMapper::instanceDeviceSetsService().

87 {
88  QJsonObject* obj = this->asJsonObject();
89 
90  QJsonDocument doc(*obj);
91  QByteArray bytes = doc.toJson();
92  delete obj;
93  return QString(bytes);
94 }
virtual QJsonObject * asJsonObject() override
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 97 of file SWGDeviceSetList.cpp.

References device_sets, devicesetcount, devicesetfocus, m_devicesetcount_isSet, m_devicesetfocus_isSet, and SWGSDRangel::toJsonArray().

Referenced by asJson().

97  {
98  QJsonObject* obj = new QJsonObject();
100  obj->insert("devicesetcount", QJsonValue(devicesetcount));
101  }
103  obj->insert("devicesetfocus", QJsonValue(devicesetfocus));
104  }
105  if(device_sets->size() > 0){
106  toJsonArray((QList<void*>*)device_sets, obj, "deviceSets", "SWGDeviceSet");
107  }
108 
109  return obj;
110 }
QList< SWGDeviceSet * > * device_sets
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::SWGDeviceSetList::cleanup ( )

Definition at line 54 of file SWGDeviceSetList.cpp.

References device_sets.

Referenced by ~SWGDeviceSetList().

54  {
55 
56 
57  if(device_sets != nullptr) {
58  auto arr = device_sets;
59  for(auto o: *arr) {
60  delete o;
61  }
62  delete device_sets;
63  }
64 }
QList< SWGDeviceSet * > * device_sets
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 67 of file SWGDeviceSetList.cpp.

References fromJsonObject().

Referenced by SWGDeviceSetList().

67  {
68  QByteArray array (json.toStdString().c_str());
69  QJsonDocument doc = QJsonDocument::fromJson(array);
70  QJsonObject jsonObject = doc.object();
71  this->fromJsonObject(jsonObject);
72  return this;
73 }
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::SWGDeviceSetList::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 76 of file SWGDeviceSetList.cpp.

References device_sets, devicesetcount, devicesetfocus, and SWGSDRangel::setValue().

Referenced by fromJson().

76  {
77  ::SWGSDRangel::setValue(&devicesetcount, pJson["devicesetcount"], "qint32", "");
78 
79  ::SWGSDRangel::setValue(&devicesetfocus, pJson["devicesetfocus"], "qint32", "");
80 
81 
82  ::SWGSDRangel::setValue(&device_sets, pJson["deviceSets"], "QList", "SWGDeviceSet");
83 }
QList< SWGDeviceSet * > * device_sets
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:

◆ getDevicesetcount()

qint32 SWGSDRangel::SWGDeviceSetList::getDevicesetcount ( )

Definition at line 113 of file SWGDeviceSetList.cpp.

References devicesetcount.

113  {
114  return devicesetcount;
115 }

◆ getDevicesetfocus()

qint32 SWGSDRangel::SWGDeviceSetList::getDevicesetfocus ( )

Definition at line 123 of file SWGDeviceSetList.cpp.

References devicesetfocus.

123  {
124  return devicesetfocus;
125 }

◆ getDeviceSets()

QList< SWGDeviceSet * > * SWGSDRangel::SWGDeviceSetList::getDeviceSets ( )

Definition at line 133 of file SWGDeviceSetList.cpp.

References device_sets.

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

133  {
134  return device_sets;
135 }
QList< SWGDeviceSet * > * device_sets
+ Here is the caller graph for this function:

◆ init()

void SWGSDRangel::SWGDeviceSetList::init ( )

◆ isSet()

bool SWGSDRangel::SWGDeviceSetList::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 144 of file SWGDeviceSetList.cpp.

References device_sets, m_devicesetcount_isSet, and m_devicesetfocus_isSet.

Referenced by SWGSDRangel::SWGInstanceSummaryResponse::asJsonObject(), and SWGSDRangel::SWGInstanceSummaryResponse::isSet().

144  {
145  bool isObjectUpdated = false;
146  do{
147  if(m_devicesetcount_isSet){ isObjectUpdated = true; break;}
148  if(m_devicesetfocus_isSet){ isObjectUpdated = true; break;}
149  if(device_sets->size() > 0){ isObjectUpdated = true; break;}
150  }while(false);
151  return isObjectUpdated;
152 }
QList< SWGDeviceSet * > * device_sets
+ Here is the caller graph for this function:

◆ setDevicesetcount()

void SWGSDRangel::SWGDeviceSetList::setDevicesetcount ( qint32  devicesetcount)

Definition at line 117 of file SWGDeviceSetList.cpp.

References devicesetcount, and m_devicesetcount_isSet.

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

117  {
119  this->m_devicesetcount_isSet = true;
120 }
+ Here is the caller graph for this function:

◆ setDevicesetfocus()

void SWGSDRangel::SWGDeviceSetList::setDevicesetfocus ( qint32  devicesetfocus)

Definition at line 127 of file SWGDeviceSetList.cpp.

References devicesetfocus, and m_devicesetfocus_isSet.

Referenced by WebAPIAdapterGUI::getDeviceSetList().

127  {
129  this->m_devicesetfocus_isSet = true;
130 }
+ Here is the caller graph for this function:

◆ setDeviceSets()

void SWGSDRangel::SWGDeviceSetList::setDeviceSets ( QList< SWGDeviceSet *> *  device_sets)

Definition at line 137 of file SWGDeviceSetList.cpp.

References device_sets, and m_device_sets_isSet.

137  {
138  this->device_sets = device_sets;
139  this->m_device_sets_isSet = true;
140 }
QList< SWGDeviceSet * > * device_sets

Member Data Documentation

◆ device_sets

QList<SWGDeviceSet*>* SWGSDRangel::SWGDeviceSetList::device_sets
private

◆ devicesetcount

qint32 SWGSDRangel::SWGDeviceSetList::devicesetcount
private

◆ devicesetfocus

qint32 SWGSDRangel::SWGDeviceSetList::devicesetfocus
private

◆ m_device_sets_isSet

bool SWGSDRangel::SWGDeviceSetList::m_device_sets_isSet
private

Definition at line 66 of file SWGDeviceSetList.h.

Referenced by init(), setDeviceSets(), and SWGDeviceSetList().

◆ m_devicesetcount_isSet

bool SWGSDRangel::SWGDeviceSetList::m_devicesetcount_isSet
private

Definition at line 60 of file SWGDeviceSetList.h.

Referenced by asJsonObject(), init(), isSet(), setDevicesetcount(), and SWGDeviceSetList().

◆ m_devicesetfocus_isSet

bool SWGSDRangel::SWGDeviceSetList::m_devicesetfocus_isSet
private

Definition at line 63 of file SWGDeviceSetList.h.

Referenced by asJsonObject(), init(), isSet(), setDevicesetfocus(), and SWGDeviceSetList().


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