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

#include <SWGSoapySDRGainSetting.h>

+ Inheritance diagram for SWGSDRangel::SWGSoapySDRGainSetting:
+ Collaboration diagram for SWGSDRangel::SWGSoapySDRGainSetting:

Public Member Functions

 SWGSoapySDRGainSetting ()
 
 SWGSoapySDRGainSetting (QString *json)
 
virtual ~SWGSoapySDRGainSetting ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGSoapySDRGainSettingfromJson (QString &jsonString) override
 
QString * getName ()
 
void setName (QString *name)
 
SWGRangeFloatgetRange ()
 
void setRange (SWGRangeFloat *range)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

QString * name
 
bool m_name_isSet
 
SWGRangeFloatrange
 
bool m_range_isSet
 

Detailed Description

Definition at line 33 of file SWGSoapySDRGainSetting.h.

Constructor & Destructor Documentation

◆ SWGSoapySDRGainSetting() [1/2]

SWGSDRangel::SWGSoapySDRGainSetting::SWGSoapySDRGainSetting ( )

◆ SWGSoapySDRGainSetting() [2/2]

SWGSDRangel::SWGSoapySDRGainSetting::SWGSoapySDRGainSetting ( QString *  json)

Definition at line 25 of file SWGSoapySDRGainSetting.cpp.

References fromJson(), and init().

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

◆ ~SWGSoapySDRGainSetting()

SWGSDRangel::SWGSoapySDRGainSetting::~SWGSoapySDRGainSetting ( )
virtual

Definition at line 37 of file SWGSoapySDRGainSetting.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGSoapySDRGainSetting::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 77 of file SWGSoapySDRGainSetting.cpp.

References asJsonObject().

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

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 88 of file SWGSoapySDRGainSetting.cpp.

References SWGSDRangel::SWGRangeFloat::isSet(), name, range, and SWGSDRangel::toJsonValue().

Referenced by asJson().

88  {
89  QJsonObject* obj = new QJsonObject();
90  if(name != nullptr && *name != QString("")){
91  toJsonValue(QString("name"), name, obj, QString("QString"));
92  }
93  if((range != nullptr) && (range->isSet())){
94  toJsonValue(QString("range"), range, obj, QString("SWGRangeFloat"));
95  }
96 
97  return obj;
98 }
void toJsonValue(QString name, void *value, QJsonObject *output, QString type)
Definition: SWGHelpers.cpp:383
virtual bool isSet() override
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cleanup()

void SWGSDRangel::SWGSoapySDRGainSetting::cleanup ( )

Definition at line 50 of file SWGSoapySDRGainSetting.cpp.

References name, and range.

Referenced by ~SWGSoapySDRGainSetting().

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

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 60 of file SWGSoapySDRGainSetting.cpp.

References fromJsonObject().

Referenced by SWGSoapySDRGainSetting().

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 69 of file SWGSoapySDRGainSetting.cpp.

References name, range, and SWGSDRangel::setValue().

Referenced by fromJson().

69  {
70  ::SWGSDRangel::setValue(&name, pJson["name"], "QString", "QString");
71 
72  ::SWGSDRangel::setValue(&range, pJson["range"], "SWGRangeFloat", "SWGRangeFloat");
73 
74 }
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:

◆ getName()

QString * SWGSDRangel::SWGSoapySDRGainSetting::getName ( )

Definition at line 101 of file SWGSoapySDRGainSetting.cpp.

References name.

101  {
102  return name;
103 }

◆ getRange()

SWGRangeFloat * SWGSDRangel::SWGSoapySDRGainSetting::getRange ( )

Definition at line 111 of file SWGSoapySDRGainSetting.cpp.

References range.

111  {
112  return range;
113 }

◆ init()

void SWGSDRangel::SWGSoapySDRGainSetting::init ( )

Definition at line 42 of file SWGSoapySDRGainSetting.cpp.

References m_name_isSet, m_range_isSet, name, and range.

Referenced by SWGSoapySDRGainSetting().

42  {
43  name = new QString("");
44  m_name_isSet = false;
45  range = new SWGRangeFloat();
46  m_range_isSet = false;
47 }
+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGSoapySDRGainSetting::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 122 of file SWGSoapySDRGainSetting.cpp.

References SWGSDRangel::SWGRangeFloat::isSet(), name, and range.

122  {
123  bool isObjectUpdated = false;
124  do{
125  if(name != nullptr && *name != QString("")){ isObjectUpdated = true; break;}
126  if(range != nullptr && range->isSet()){ isObjectUpdated = true; break;}
127  }while(false);
128  return isObjectUpdated;
129 }
virtual bool isSet() override
+ Here is the call graph for this function:

◆ setName()

void SWGSDRangel::SWGSoapySDRGainSetting::setName ( QString *  name)

Definition at line 105 of file SWGSoapySDRGainSetting.cpp.

References m_name_isSet, and name.

105  {
106  this->name = name;
107  this->m_name_isSet = true;
108 }

◆ setRange()

void SWGSDRangel::SWGSoapySDRGainSetting::setRange ( SWGRangeFloat range)

Definition at line 115 of file SWGSoapySDRGainSetting.cpp.

References m_range_isSet, and range.

115  {
116  this->range = range;
117  this->m_range_isSet = true;
118 }

Member Data Documentation

◆ m_name_isSet

bool SWGSDRangel::SWGSoapySDRGainSetting::m_name_isSet
private

Definition at line 57 of file SWGSoapySDRGainSetting.h.

Referenced by init(), setName(), and SWGSoapySDRGainSetting().

◆ m_range_isSet

bool SWGSDRangel::SWGSoapySDRGainSetting::m_range_isSet
private

Definition at line 60 of file SWGSoapySDRGainSetting.h.

Referenced by init(), setRange(), and SWGSoapySDRGainSetting().

◆ name

QString* SWGSDRangel::SWGSoapySDRGainSetting::name
private

◆ range

SWGRangeFloat* SWGSDRangel::SWGSoapySDRGainSetting::range
private

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