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

#include <SWGAMBEDevices.h>

+ Inheritance diagram for SWGSDRangel::SWGAMBEDevices:
+ Collaboration diagram for SWGSDRangel::SWGAMBEDevices:

Public Member Functions

 SWGAMBEDevices ()
 
 SWGAMBEDevices (QString *json)
 
virtual ~SWGAMBEDevices ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGAMBEDevicesfromJson (QString &jsonString) override
 
qint32 getNbDevices ()
 
void setNbDevices (qint32 nb_devices)
 
QList< SWGAMBEDevice * > * getAmbeDevices ()
 
void setAmbeDevices (QList< SWGAMBEDevice *> *ambe_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< SWGAMBEDevice * > * ambe_devices
 
bool m_ambe_devices_isSet
 

Detailed Description

Definition at line 33 of file SWGAMBEDevices.h.

Constructor & Destructor Documentation

◆ SWGAMBEDevices() [1/2]

SWGSDRangel::SWGAMBEDevices::SWGAMBEDevices ( )

Definition at line 30 of file SWGAMBEDevices.cpp.

References ambe_devices, m_ambe_devices_isSet, m_nb_devices_isSet, and nb_devices.

30  {
31  nb_devices = 0;
32  m_nb_devices_isSet = false;
33  ambe_devices = nullptr;
34  m_ambe_devices_isSet = false;
35 }
QList< SWGAMBEDevice * > * ambe_devices

◆ SWGAMBEDevices() [2/2]

SWGSDRangel::SWGAMBEDevices::SWGAMBEDevices ( QString *  json)

Definition at line 25 of file SWGAMBEDevices.cpp.

References fromJson(), and init().

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

◆ ~SWGAMBEDevices()

SWGSDRangel::SWGAMBEDevices::~SWGAMBEDevices ( )
virtual

Definition at line 37 of file SWGAMBEDevices.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGAMBEDevices::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 79 of file SWGAMBEDevices.cpp.

References asJsonObject().

Referenced by SWGSDRangel::SWGInstanceApi::instanceAMBEDevicesPatch(), SWGSDRangel::SWGInstanceApi::instanceAMBEDevicesPut(), and WebAPIRequestMapper::instanceAMBEDevicesService().

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::SWGAMBEDevices::asJsonObject ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 90 of file SWGAMBEDevices.cpp.

References ambe_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(ambe_devices->size() > 0){
96  toJsonArray((QList<void*>*)ambe_devices, obj, "ambeDevices", "SWGAMBEDevice");
97  }
98 
99  return obj;
100 }
QList< SWGAMBEDevice * > * ambe_devices
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::SWGAMBEDevices::cleanup ( )

Definition at line 50 of file SWGAMBEDevices.cpp.

References ambe_devices.

Referenced by ~SWGAMBEDevices().

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

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 62 of file SWGAMBEDevices.cpp.

References fromJsonObject().

Referenced by SWGAMBEDevices().

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 71 of file SWGAMBEDevices.cpp.

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

Referenced by fromJson().

71  {
72  ::SWGSDRangel::setValue(&nb_devices, pJson["nbDevices"], "qint32", "");
73 
74 
75  ::SWGSDRangel::setValue(&ambe_devices, pJson["ambeDevices"], "QList", "SWGAMBEDevice");
76 }
QList< SWGAMBEDevice * > * ambe_devices
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:

◆ getAmbeDevices()

QList< SWGAMBEDevice * > * SWGSDRangel::SWGAMBEDevices::getAmbeDevices ( )

◆ getNbDevices()

qint32 SWGSDRangel::SWGAMBEDevices::getNbDevices ( )

Definition at line 103 of file SWGAMBEDevices.cpp.

References nb_devices.

103  {
104  return nb_devices;
105 }

◆ init()

void SWGSDRangel::SWGAMBEDevices::init ( )

Definition at line 42 of file SWGAMBEDevices.cpp.

References ambe_devices, m_ambe_devices_isSet, m_nb_devices_isSet, and nb_devices.

Referenced by WebAPIAdapterGUI::instanceAMBEDevicesGet(), WebAPIAdapterSrv::instanceAMBEDevicesGet(), SWGAMBEDevices(), and WebAPIRequestMapper::validateAMBEDevices().

42  {
43  nb_devices = 0;
44  m_nb_devices_isSet = false;
45  ambe_devices = new QList<SWGAMBEDevice*>();
46  m_ambe_devices_isSet = false;
47 }
QList< SWGAMBEDevice * > * ambe_devices
+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGAMBEDevices::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 124 of file SWGAMBEDevices.cpp.

References ambe_devices, and m_nb_devices_isSet.

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

◆ setAmbeDevices()

void SWGSDRangel::SWGAMBEDevices::setAmbeDevices ( QList< SWGAMBEDevice *> *  ambe_devices)

Definition at line 117 of file SWGAMBEDevices.cpp.

References ambe_devices, and m_ambe_devices_isSet.

117  {
118  this->ambe_devices = ambe_devices;
119  this->m_ambe_devices_isSet = true;
120 }
QList< SWGAMBEDevice * > * ambe_devices

◆ setNbDevices()

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

Definition at line 107 of file SWGAMBEDevices.cpp.

References m_nb_devices_isSet, and nb_devices.

Referenced by WebAPIAdapterGUI::instanceAMBEDevicesGet(), WebAPIAdapterSrv::instanceAMBEDevicesGet(), and WebAPIRequestMapper::validateAMBEDevices().

107  {
108  this->nb_devices = nb_devices;
109  this->m_nb_devices_isSet = true;
110 }
+ Here is the caller graph for this function:

Member Data Documentation

◆ ambe_devices

QList<SWGAMBEDevice*>* SWGSDRangel::SWGAMBEDevices::ambe_devices
private

◆ m_ambe_devices_isSet

bool SWGSDRangel::SWGAMBEDevices::m_ambe_devices_isSet
private

Definition at line 60 of file SWGAMBEDevices.h.

Referenced by init(), setAmbeDevices(), and SWGAMBEDevices().

◆ m_nb_devices_isSet

bool SWGSDRangel::SWGAMBEDevices::m_nb_devices_isSet
private

Definition at line 57 of file SWGAMBEDevices.h.

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

◆ nb_devices

qint32 SWGSDRangel::SWGAMBEDevices::nb_devices
private

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