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

#include <SWGDVSerialDevice.h>

+ Inheritance diagram for SWGSDRangel::SWGDVSerialDevice:
+ Collaboration diagram for SWGSDRangel::SWGDVSerialDevice:

Public Member Functions

 SWGDVSerialDevice ()
 
 SWGDVSerialDevice (QString *json)
 
virtual ~SWGDVSerialDevice ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGDVSerialDevicefromJson (QString &jsonString) override
 
QString * getDeviceName ()
 
void setDeviceName (QString *device_name)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

QString * device_name
 
bool m_device_name_isSet
 

Detailed Description

Definition at line 32 of file SWGDVSerialDevice.h.

Constructor & Destructor Documentation

◆ SWGDVSerialDevice() [1/2]

SWGSDRangel::SWGDVSerialDevice::SWGDVSerialDevice ( )

Definition at line 30 of file SWGDVSerialDevice.cpp.

References device_name, and m_device_name_isSet.

30  {
31  device_name = nullptr;
32  m_device_name_isSet = false;
33 }

◆ SWGDVSerialDevice() [2/2]

SWGSDRangel::SWGDVSerialDevice::SWGDVSerialDevice ( QString *  json)

Definition at line 25 of file SWGDVSerialDevice.cpp.

References fromJson(), and init().

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

◆ ~SWGDVSerialDevice()

SWGSDRangel::SWGDVSerialDevice::~SWGDVSerialDevice ( )
virtual

Definition at line 35 of file SWGDVSerialDevice.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGDVSerialDevice::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 68 of file SWGDVSerialDevice.cpp.

References asJsonObject().

69 {
70  QJsonObject* obj = this->asJsonObject();
71 
72  QJsonDocument doc(*obj);
73  QByteArray bytes = doc.toJson();
74  delete obj;
75  return QString(bytes);
76 }
virtual QJsonObject * asJsonObject() override
+ Here is the call graph for this function:

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 79 of file SWGDVSerialDevice.cpp.

References device_name, and SWGSDRangel::toJsonValue().

Referenced by asJson().

79  {
80  QJsonObject* obj = new QJsonObject();
81  if(device_name != nullptr && *device_name != QString("")){
82  toJsonValue(QString("deviceName"), device_name, obj, QString("QString"));
83  }
84 
85  return obj;
86 }
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::SWGDVSerialDevice::cleanup ( )

Definition at line 46 of file SWGDVSerialDevice.cpp.

References device_name.

Referenced by ~SWGDVSerialDevice().

46  {
47  if(device_name != nullptr) {
48  delete device_name;
49  }
50 }
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 53 of file SWGDVSerialDevice.cpp.

References fromJsonObject().

Referenced by SWGDVSerialDevice().

53  {
54  QByteArray array (json.toStdString().c_str());
55  QJsonDocument doc = QJsonDocument::fromJson(array);
56  QJsonObject jsonObject = doc.object();
57  this->fromJsonObject(jsonObject);
58  return this;
59 }
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::SWGDVSerialDevice::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 62 of file SWGDVSerialDevice.cpp.

References device_name, and SWGSDRangel::setValue().

Referenced by fromJson().

62  {
63  ::SWGSDRangel::setValue(&device_name, pJson["deviceName"], "QString", "QString");
64 
65 }
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:

◆ getDeviceName()

QString * SWGSDRangel::SWGDVSerialDevice::getDeviceName ( )

Definition at line 89 of file SWGDVSerialDevice.cpp.

References device_name.

89  {
90  return device_name;
91 }

◆ init()

void SWGSDRangel::SWGDVSerialDevice::init ( )

Definition at line 40 of file SWGDVSerialDevice.cpp.

References device_name, and m_device_name_isSet.

Referenced by SWGDVSerialDevice().

40  {
41  device_name = new QString("");
42  m_device_name_isSet = false;
43 }
+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGDVSerialDevice::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 100 of file SWGDVSerialDevice.cpp.

References device_name.

100  {
101  bool isObjectUpdated = false;
102  do{
103  if(device_name != nullptr && *device_name != QString("")){ isObjectUpdated = true; break;}
104  }while(false);
105  return isObjectUpdated;
106 }

◆ setDeviceName()

void SWGSDRangel::SWGDVSerialDevice::setDeviceName ( QString *  device_name)

Definition at line 93 of file SWGDVSerialDevice.cpp.

References device_name, and m_device_name_isSet.

93  {
94  this->device_name = device_name;
95  this->m_device_name_isSet = true;
96 }

Member Data Documentation

◆ device_name

QString* SWGSDRangel::SWGDVSerialDevice::device_name
private

◆ m_device_name_isSet

bool SWGSDRangel::SWGDVSerialDevice::m_device_name_isSet
private

Definition at line 53 of file SWGDVSerialDevice.h.

Referenced by init(), setDeviceName(), and SWGDVSerialDevice().


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