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

#include <SWGFrequencyBand.h>

+ Inheritance diagram for SWGSDRangel::SWGFrequencyBand:
+ Collaboration diagram for SWGSDRangel::SWGFrequencyBand:

Public Member Functions

 SWGFrequencyBand ()
 
 SWGFrequencyBand (QString *json)
 
virtual ~SWGFrequencyBand ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGFrequencyBandfromJson (QString &jsonString) override
 
QString * getName ()
 
void setName (QString *name)
 
qint32 getLowerBound ()
 
void setLowerBound (qint32 lower_bound)
 
qint32 getHigherBound ()
 
void setHigherBound (qint32 higher_bound)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

QString * name
 
bool m_name_isSet
 
qint32 lower_bound
 
bool m_lower_bound_isSet
 
qint32 higher_bound
 
bool m_higher_bound_isSet
 

Detailed Description

Definition at line 32 of file SWGFrequencyBand.h.

Constructor & Destructor Documentation

◆ SWGFrequencyBand() [1/2]

SWGSDRangel::SWGFrequencyBand::SWGFrequencyBand ( )

◆ SWGFrequencyBand() [2/2]

SWGSDRangel::SWGFrequencyBand::SWGFrequencyBand ( QString *  json)

Definition at line 25 of file SWGFrequencyBand.cpp.

References fromJson(), and init().

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

◆ ~SWGFrequencyBand()

SWGSDRangel::SWGFrequencyBand::~SWGFrequencyBand ( )
virtual

Definition at line 39 of file SWGFrequencyBand.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGFrequencyBand::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 82 of file SWGFrequencyBand.cpp.

References asJsonObject().

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

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 93 of file SWGFrequencyBand.cpp.

References higher_bound, lower_bound, m_higher_bound_isSet, m_lower_bound_isSet, name, and SWGSDRangel::toJsonValue().

Referenced by asJson().

93  {
94  QJsonObject* obj = new QJsonObject();
95  if(name != nullptr && *name != QString("")){
96  toJsonValue(QString("name"), name, obj, QString("QString"));
97  }
99  obj->insert("lowerBound", QJsonValue(lower_bound));
100  }
102  obj->insert("higherBound", QJsonValue(higher_bound));
103  }
104 
105  return obj;
106 }
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::SWGFrequencyBand::cleanup ( )

Definition at line 54 of file SWGFrequencyBand.cpp.

References name.

Referenced by ~SWGFrequencyBand().

54  {
55  if(name != nullptr) {
56  delete name;
57  }
58 
59 
60 }
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 63 of file SWGFrequencyBand.cpp.

References fromJsonObject().

Referenced by SWGFrequencyBand().

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 72 of file SWGFrequencyBand.cpp.

References higher_bound, lower_bound, name, and SWGSDRangel::setValue().

Referenced by fromJson().

72  {
73  ::SWGSDRangel::setValue(&name, pJson["name"], "QString", "QString");
74 
75  ::SWGSDRangel::setValue(&lower_bound, pJson["lowerBound"], "qint32", "");
76 
77  ::SWGSDRangel::setValue(&higher_bound, pJson["higherBound"], "qint32", "");
78 
79 }
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:

◆ getHigherBound()

qint32 SWGSDRangel::SWGFrequencyBand::getHigherBound ( )

Definition at line 129 of file SWGFrequencyBand.cpp.

References higher_bound.

129  {
130  return higher_bound;
131 }

◆ getLowerBound()

qint32 SWGSDRangel::SWGFrequencyBand::getLowerBound ( )

Definition at line 119 of file SWGFrequencyBand.cpp.

References lower_bound.

119  {
120  return lower_bound;
121 }

◆ getName()

QString * SWGSDRangel::SWGFrequencyBand::getName ( )

Definition at line 109 of file SWGFrequencyBand.cpp.

References name.

109  {
110  return name;
111 }

◆ init()

void SWGSDRangel::SWGFrequencyBand::init ( )

Definition at line 44 of file SWGFrequencyBand.cpp.

References higher_bound, lower_bound, m_higher_bound_isSet, m_lower_bound_isSet, m_name_isSet, and name.

Referenced by SWGFrequencyBand().

+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGFrequencyBand::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 140 of file SWGFrequencyBand.cpp.

References m_higher_bound_isSet, m_lower_bound_isSet, and name.

140  {
141  bool isObjectUpdated = false;
142  do{
143  if(name != nullptr && *name != QString("")){ isObjectUpdated = true; break;}
144  if(m_lower_bound_isSet){ isObjectUpdated = true; break;}
145  if(m_higher_bound_isSet){ isObjectUpdated = true; break;}
146  }while(false);
147  return isObjectUpdated;
148 }

◆ setHigherBound()

void SWGSDRangel::SWGFrequencyBand::setHigherBound ( qint32  higher_bound)

Definition at line 133 of file SWGFrequencyBand.cpp.

References higher_bound, and m_higher_bound_isSet.

133  {
134  this->higher_bound = higher_bound;
135  this->m_higher_bound_isSet = true;
136 }

◆ setLowerBound()

void SWGSDRangel::SWGFrequencyBand::setLowerBound ( qint32  lower_bound)

Definition at line 123 of file SWGFrequencyBand.cpp.

References lower_bound, and m_lower_bound_isSet.

123  {
124  this->lower_bound = lower_bound;
125  this->m_lower_bound_isSet = true;
126 }

◆ setName()

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

Definition at line 113 of file SWGFrequencyBand.cpp.

References m_name_isSet, and name.

113  {
114  this->name = name;
115  this->m_name_isSet = true;
116 }

Member Data Documentation

◆ higher_bound

qint32 SWGSDRangel::SWGFrequencyBand::higher_bound
private

◆ lower_bound

qint32 SWGSDRangel::SWGFrequencyBand::lower_bound
private

◆ m_higher_bound_isSet

bool SWGSDRangel::SWGFrequencyBand::m_higher_bound_isSet
private

Definition at line 65 of file SWGFrequencyBand.h.

Referenced by asJsonObject(), init(), isSet(), setHigherBound(), and SWGFrequencyBand().

◆ m_lower_bound_isSet

bool SWGSDRangel::SWGFrequencyBand::m_lower_bound_isSet
private

Definition at line 62 of file SWGFrequencyBand.h.

Referenced by asJsonObject(), init(), isSet(), setLowerBound(), and SWGFrequencyBand().

◆ m_name_isSet

bool SWGSDRangel::SWGFrequencyBand::m_name_isSet
private

Definition at line 59 of file SWGFrequencyBand.h.

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

◆ name

QString* SWGSDRangel::SWGFrequencyBand::name
private

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