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

#include <SWGDVSerialDevices.h>

+ Inheritance diagram for SWGSDRangel::SWGDVSerialDevices:
+ Collaboration diagram for SWGSDRangel::SWGDVSerialDevices:

Public Member Functions

 SWGDVSerialDevices ()
 
 SWGDVSerialDevices (QString *json)
 
virtual ~SWGDVSerialDevices ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGDVSerialDevicesfromJson (QString &jsonString) override
 
qint32 getNbDevices ()
 
void setNbDevices (qint32 nb_devices)
 
QList< SWGDVSerialDevice * > * getDvSerialDevices ()
 
void setDvSerialDevices (QList< SWGDVSerialDevice *> *dv_serial_devices)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

qint32 nb_devices
 
bool m_nb_devices_isSet
 
QList< SWGDVSerialDevice * > * dv_serial_devices
 
bool m_dv_serial_devices_isSet
 

Detailed Description

Definition at line 33 of file SWGDVSerialDevices.h.

Constructor & Destructor Documentation

◆ SWGDVSerialDevices() [1/2]

SWGSDRangel::SWGDVSerialDevices::SWGDVSerialDevices ( )

◆ SWGDVSerialDevices() [2/2]

SWGSDRangel::SWGDVSerialDevices::SWGDVSerialDevices ( QString *  json)

Definition at line 25 of file SWGDVSerialDevices.cpp.

References fromJson(), and init().

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

◆ ~SWGDVSerialDevices()

SWGSDRangel::SWGDVSerialDevices::~SWGDVSerialDevices ( )
virtual

Definition at line 37 of file SWGDVSerialDevices.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGDVSerialDevices::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 79 of file SWGDVSerialDevices.cpp.

References asJsonObject().

Referenced by WebAPIRequestMapper::instanceAMBESerialService().

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

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 90 of file SWGDVSerialDevices.cpp.

References dv_serial_devices, m_nb_devices_isSet, nb_devices, and SWGSDRangel::toJsonArray().

Referenced by asJson().

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

◆ cleanup()

void SWGSDRangel::SWGDVSerialDevices::cleanup ( )

Definition at line 50 of file SWGDVSerialDevices.cpp.

References dv_serial_devices.

Referenced by ~SWGDVSerialDevices().

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

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 62 of file SWGDVSerialDevices.cpp.

References fromJsonObject().

Referenced by SWGDVSerialDevices().

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::SWGDVSerialDevices::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 71 of file SWGDVSerialDevices.cpp.

References dv_serial_devices, nb_devices, and SWGSDRangel::setValue().

Referenced by fromJson().

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

◆ getDvSerialDevices()

QList< SWGDVSerialDevice * > * SWGSDRangel::SWGDVSerialDevices::getDvSerialDevices ( )

◆ getNbDevices()

qint32 SWGSDRangel::SWGDVSerialDevices::getNbDevices ( )

Definition at line 103 of file SWGDVSerialDevices.cpp.

References nb_devices.

103  {
104  return nb_devices;
105 }

◆ init()

void SWGSDRangel::SWGDVSerialDevices::init ( )

◆ isSet()

bool SWGSDRangel::SWGDVSerialDevices::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 124 of file SWGDVSerialDevices.cpp.

References dv_serial_devices, and m_nb_devices_isSet.

124  {
125  bool isObjectUpdated = false;
126  do{
127  if(m_nb_devices_isSet){ isObjectUpdated = true; break;}
128  if(dv_serial_devices->size() > 0){ isObjectUpdated = true; break;}
129  }while(false);
130  return isObjectUpdated;
131 }
QList< SWGDVSerialDevice * > * dv_serial_devices

◆ setDvSerialDevices()

void SWGSDRangel::SWGDVSerialDevices::setDvSerialDevices ( QList< SWGDVSerialDevice *> *  dv_serial_devices)

Definition at line 117 of file SWGDVSerialDevices.cpp.

References dv_serial_devices, and m_dv_serial_devices_isSet.

117  {
119  this->m_dv_serial_devices_isSet = true;
120 }
QList< SWGDVSerialDevice * > * dv_serial_devices

◆ setNbDevices()

void SWGSDRangel::SWGDVSerialDevices::setNbDevices ( qint32  nb_devices)

Member Data Documentation

◆ dv_serial_devices

QList<SWGDVSerialDevice*>* SWGSDRangel::SWGDVSerialDevices::dv_serial_devices
private

◆ m_dv_serial_devices_isSet

bool SWGSDRangel::SWGDVSerialDevices::m_dv_serial_devices_isSet
private

Definition at line 60 of file SWGDVSerialDevices.h.

Referenced by init(), setDvSerialDevices(), and SWGDVSerialDevices().

◆ m_nb_devices_isSet

bool SWGSDRangel::SWGDVSerialDevices::m_nb_devices_isSet
private

Definition at line 57 of file SWGDVSerialDevices.h.

Referenced by asJsonObject(), init(), isSet(), setNbDevices(), and SWGDVSerialDevices().

◆ nb_devices

qint32 SWGSDRangel::SWGDVSerialDevices::nb_devices
private

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