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

#include <SWGAMBEDevice.h>

+ Inheritance diagram for SWGSDRangel::SWGAMBEDevice:
+ Collaboration diagram for SWGSDRangel::SWGAMBEDevice:

Public Member Functions

 SWGAMBEDevice ()
 
 SWGAMBEDevice (QString *json)
 
virtual ~SWGAMBEDevice ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGAMBEDevicefromJson (QString &jsonString) override
 
QString * getDeviceRef ()
 
void setDeviceRef (QString *device_ref)
 
qint32 getDelete ()
 
void setDelete (qint32 _delete)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

QString * device_ref
 
bool m_device_ref_isSet
 
qint32 _delete
 
bool m__delete_isSet
 

Detailed Description

Definition at line 32 of file SWGAMBEDevice.h.

Constructor & Destructor Documentation

◆ SWGAMBEDevice() [1/2]

SWGSDRangel::SWGAMBEDevice::SWGAMBEDevice ( )

Definition at line 30 of file SWGAMBEDevice.cpp.

References _delete, device_ref, m__delete_isSet, and m_device_ref_isSet.

30  {
31  device_ref = nullptr;
32  m_device_ref_isSet = false;
33  _delete = 0;
34  m__delete_isSet = false;
35 }

◆ SWGAMBEDevice() [2/2]

SWGSDRangel::SWGAMBEDevice::SWGAMBEDevice ( QString *  json)

Definition at line 25 of file SWGAMBEDevice.cpp.

References fromJson(), and init().

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

◆ ~SWGAMBEDevice()

SWGSDRangel::SWGAMBEDevice::~SWGAMBEDevice ( )
virtual

Definition at line 37 of file SWGAMBEDevice.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGAMBEDevice::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 75 of file SWGAMBEDevice.cpp.

References asJsonObject().

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

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 86 of file SWGAMBEDevice.cpp.

References _delete, device_ref, m__delete_isSet, and SWGSDRangel::toJsonValue().

Referenced by asJson().

86  {
87  QJsonObject* obj = new QJsonObject();
88  if(device_ref != nullptr && *device_ref != QString("")){
89  toJsonValue(QString("deviceRef"), device_ref, obj, QString("QString"));
90  }
91  if(m__delete_isSet){
92  obj->insert("delete", QJsonValue(_delete));
93  }
94 
95  return obj;
96 }
void toJsonValue(QString name, void *value, QJsonObject *output, QString type)
Definition: SWGHelpers.cpp:383
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cleanup()

void SWGSDRangel::SWGAMBEDevice::cleanup ( )

Definition at line 50 of file SWGAMBEDevice.cpp.

References device_ref.

Referenced by ~SWGAMBEDevice().

50  {
51  if(device_ref != nullptr) {
52  delete device_ref;
53  }
54 
55 }
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 58 of file SWGAMBEDevice.cpp.

References fromJsonObject().

Referenced by SWGAMBEDevice().

58  {
59  QByteArray array (json.toStdString().c_str());
60  QJsonDocument doc = QJsonDocument::fromJson(array);
61  QJsonObject jsonObject = doc.object();
62  this->fromJsonObject(jsonObject);
63  return this;
64 }
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::SWGAMBEDevice::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 67 of file SWGAMBEDevice.cpp.

References _delete, device_ref, and SWGSDRangel::setValue().

Referenced by fromJson().

67  {
68  ::SWGSDRangel::setValue(&device_ref, pJson["deviceRef"], "QString", "QString");
69 
70  ::SWGSDRangel::setValue(&_delete, pJson["delete"], "qint32", "");
71 
72 }
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:

◆ getDelete()

qint32 SWGSDRangel::SWGAMBEDevice::getDelete ( )

Definition at line 109 of file SWGAMBEDevice.cpp.

References _delete.

109  {
110  return _delete;
111 }

◆ getDeviceRef()

QString * SWGSDRangel::SWGAMBEDevice::getDeviceRef ( )

Definition at line 99 of file SWGAMBEDevice.cpp.

References device_ref.

99  {
100  return device_ref;
101 }

◆ init()

void SWGSDRangel::SWGAMBEDevice::init ( )

Definition at line 42 of file SWGAMBEDevice.cpp.

References _delete, device_ref, m__delete_isSet, and m_device_ref_isSet.

Referenced by SWGAMBEDevice().

42  {
43  device_ref = new QString("");
44  m_device_ref_isSet = false;
45  _delete = 0;
46  m__delete_isSet = false;
47 }
+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGAMBEDevice::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 120 of file SWGAMBEDevice.cpp.

References device_ref, and m__delete_isSet.

120  {
121  bool isObjectUpdated = false;
122  do{
123  if(device_ref != nullptr && *device_ref != QString("")){ isObjectUpdated = true; break;}
124  if(m__delete_isSet){ isObjectUpdated = true; break;}
125  }while(false);
126  return isObjectUpdated;
127 }

◆ setDelete()

void SWGSDRangel::SWGAMBEDevice::setDelete ( qint32  _delete)

Definition at line 113 of file SWGAMBEDevice.cpp.

References _delete, and m__delete_isSet.

113  {
114  this->_delete = _delete;
115  this->m__delete_isSet = true;
116 }

◆ setDeviceRef()

void SWGSDRangel::SWGAMBEDevice::setDeviceRef ( QString *  device_ref)

Definition at line 103 of file SWGAMBEDevice.cpp.

References device_ref, and m_device_ref_isSet.

103  {
104  this->device_ref = device_ref;
105  this->m_device_ref_isSet = true;
106 }

Member Data Documentation

◆ _delete

qint32 SWGSDRangel::SWGAMBEDevice::_delete
private

Definition at line 58 of file SWGAMBEDevice.h.

Referenced by asJsonObject(), fromJsonObject(), getDelete(), init(), setDelete(), and SWGAMBEDevice().

◆ device_ref

QString* SWGSDRangel::SWGAMBEDevice::device_ref
private

◆ m__delete_isSet

bool SWGSDRangel::SWGAMBEDevice::m__delete_isSet
private

Definition at line 59 of file SWGAMBEDevice.h.

Referenced by asJsonObject(), init(), isSet(), setDelete(), and SWGAMBEDevice().

◆ m_device_ref_isSet

bool SWGSDRangel::SWGAMBEDevice::m_device_ref_isSet
private

Definition at line 56 of file SWGAMBEDevice.h.

Referenced by init(), setDeviceRef(), and SWGAMBEDevice().


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