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

#include <SWGChannel.h>

+ Inheritance diagram for SWGSDRangel::SWGChannel:
+ Collaboration diagram for SWGSDRangel::SWGChannel:

Public Member Functions

 SWGChannel ()
 
 SWGChannel (QString *json)
 
virtual ~SWGChannel ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGChannelfromJson (QString &jsonString) override
 
qint32 getIndex ()
 
void setIndex (qint32 index)
 
QString * getId ()
 
void setId (QString *id)
 
qint64 getUid ()
 
void setUid (qint64 uid)
 
QString * getTitle ()
 
void setTitle (QString *title)
 
qint32 getDeltaFrequency ()
 
void setDeltaFrequency (qint32 delta_frequency)
 
SWGChannelReportgetReport ()
 
void setReport (SWGChannelReport *report)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

qint32 index
 
bool m_index_isSet
 
QString * id
 
bool m_id_isSet
 
qint64 uid
 
bool m_uid_isSet
 
QString * title
 
bool m_title_isSet
 
qint32 delta_frequency
 
bool m_delta_frequency_isSet
 
SWGChannelReportreport
 
bool m_report_isSet
 

Detailed Description

Definition at line 33 of file SWGChannel.h.

Constructor & Destructor Documentation

◆ SWGChannel() [1/2]

SWGSDRangel::SWGChannel::SWGChannel ( )

Definition at line 30 of file SWGChannel.cpp.

References delta_frequency, index, m_delta_frequency_isSet, m_id_isSet, m_index_isSet, m_report_isSet, m_title_isSet, m_uid_isSet, report, title, and uid.

30  {
31  index = 0;
32  m_index_isSet = false;
33  id = nullptr;
34  m_id_isSet = false;
35  uid = 0L;
36  m_uid_isSet = false;
37  title = nullptr;
38  m_title_isSet = false;
39  delta_frequency = 0;
41  report = nullptr;
42  m_report_isSet = false;
43 }
SWGChannelReport * report
Definition: SWGChannel.h:83

◆ SWGChannel() [2/2]

SWGSDRangel::SWGChannel::SWGChannel ( QString *  json)

Definition at line 25 of file SWGChannel.cpp.

References fromJson(), and init().

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

◆ ~SWGChannel()

SWGSDRangel::SWGChannel::~SWGChannel ( )
virtual

Definition at line 45 of file SWGChannel.cpp.

References cleanup().

45  {
46  this->cleanup();
47 }
+ Here is the call graph for this function:

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGChannel::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 107 of file SWGChannel.cpp.

References asJsonObject().

108 {
109  QJsonObject* obj = this->asJsonObject();
110 
111  QJsonDocument doc(*obj);
112  QByteArray bytes = doc.toJson();
113  delete obj;
114  return QString(bytes);
115 }
virtual QJsonObject * asJsonObject() override
Definition: SWGChannel.cpp:118
+ Here is the call graph for this function:

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 118 of file SWGChannel.cpp.

References delta_frequency, index, SWGSDRangel::SWGChannelReport::isSet(), m_delta_frequency_isSet, m_index_isSet, m_uid_isSet, report, title, SWGSDRangel::toJsonValue(), and uid.

Referenced by asJson().

118  {
119  QJsonObject* obj = new QJsonObject();
120  if(m_index_isSet){
121  obj->insert("index", QJsonValue(index));
122  }
123  if(id != nullptr && *id != QString("")){
124  toJsonValue(QString("id"), id, obj, QString("QString"));
125  }
126  if(m_uid_isSet){
127  obj->insert("uid", QJsonValue(uid));
128  }
129  if(title != nullptr && *title != QString("")){
130  toJsonValue(QString("title"), title, obj, QString("QString"));
131  }
133  obj->insert("deltaFrequency", QJsonValue(delta_frequency));
134  }
135  if((report != nullptr) && (report->isSet())){
136  toJsonValue(QString("report"), report, obj, QString("SWGChannelReport"));
137  }
138 
139  return obj;
140 }
void toJsonValue(QString name, void *value, QJsonObject *output, QString type)
Definition: SWGHelpers.cpp:383
SWGChannelReport * report
Definition: SWGChannel.h:83
virtual bool isSet() override
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cleanup()

void SWGSDRangel::SWGChannel::cleanup ( )

Definition at line 66 of file SWGChannel.cpp.

References id, report, and title.

Referenced by ~SWGChannel().

66  {
67 
68  if(id != nullptr) {
69  delete id;
70  }
71 
72  if(title != nullptr) {
73  delete title;
74  }
75 
76  if(report != nullptr) {
77  delete report;
78  }
79 }
SWGChannelReport * report
Definition: SWGChannel.h:83
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 82 of file SWGChannel.cpp.

References fromJsonObject().

Referenced by SWGChannel().

82  {
83  QByteArray array (json.toStdString().c_str());
84  QJsonDocument doc = QJsonDocument::fromJson(array);
85  QJsonObject jsonObject = doc.object();
86  this->fromJsonObject(jsonObject);
87  return this;
88 }
virtual void fromJsonObject(QJsonObject &json) override
Definition: SWGChannel.cpp:91
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fromJsonObject()

void SWGSDRangel::SWGChannel::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 91 of file SWGChannel.cpp.

References delta_frequency, index, report, SWGSDRangel::setValue(), title, and uid.

Referenced by fromJson().

91  {
92  ::SWGSDRangel::setValue(&index, pJson["index"], "qint32", "");
93 
94  ::SWGSDRangel::setValue(&id, pJson["id"], "QString", "QString");
95 
96  ::SWGSDRangel::setValue(&uid, pJson["uid"], "qint64", "");
97 
98  ::SWGSDRangel::setValue(&title, pJson["title"], "QString", "QString");
99 
100  ::SWGSDRangel::setValue(&delta_frequency, pJson["deltaFrequency"], "qint32", "");
101 
102  ::SWGSDRangel::setValue(&report, pJson["report"], "SWGChannelReport", "SWGChannelReport");
103 
104 }
SWGChannelReport * report
Definition: SWGChannel.h:83
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:

◆ getDeltaFrequency()

qint32 SWGSDRangel::SWGChannel::getDeltaFrequency ( )

Definition at line 183 of file SWGChannel.cpp.

References delta_frequency.

183  {
184  return delta_frequency;
185 }

◆ getId()

QString * SWGSDRangel::SWGChannel::getId ( )

Definition at line 153 of file SWGChannel.cpp.

References id.

153  {
154  return id;
155 }

◆ getIndex()

qint32 SWGSDRangel::SWGChannel::getIndex ( )

Definition at line 143 of file SWGChannel.cpp.

References index.

143  {
144  return index;
145 }

◆ getReport()

SWGChannelReport * SWGSDRangel::SWGChannel::getReport ( )

Definition at line 193 of file SWGChannel.cpp.

References report.

193  {
194  return report;
195 }
SWGChannelReport * report
Definition: SWGChannel.h:83

◆ getTitle()

QString * SWGSDRangel::SWGChannel::getTitle ( )

Definition at line 173 of file SWGChannel.cpp.

References title.

173  {
174  return title;
175 }

◆ getUid()

qint64 SWGSDRangel::SWGChannel::getUid ( )

Definition at line 163 of file SWGChannel.cpp.

References uid.

163  {
164  return uid;
165 }

◆ init()

void SWGSDRangel::SWGChannel::init ( )

Definition at line 50 of file SWGChannel.cpp.

References delta_frequency, index, m_delta_frequency_isSet, m_id_isSet, m_index_isSet, m_report_isSet, m_title_isSet, m_uid_isSet, report, title, and uid.

Referenced by SWGChannel().

50  {
51  index = 0;
52  m_index_isSet = false;
53  id = new QString("");
54  m_id_isSet = false;
55  uid = 0L;
56  m_uid_isSet = false;
57  title = new QString("");
58  m_title_isSet = false;
59  delta_frequency = 0;
61  report = new SWGChannelReport();
62  m_report_isSet = false;
63 }
SWGChannelReport * report
Definition: SWGChannel.h:83
+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGChannel::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 204 of file SWGChannel.cpp.

References SWGSDRangel::SWGChannelReport::isSet(), m_delta_frequency_isSet, m_index_isSet, m_uid_isSet, report, and title.

204  {
205  bool isObjectUpdated = false;
206  do{
207  if(m_index_isSet){ isObjectUpdated = true; break;}
208  if(id != nullptr && *id != QString("")){ isObjectUpdated = true; break;}
209  if(m_uid_isSet){ isObjectUpdated = true; break;}
210  if(title != nullptr && *title != QString("")){ isObjectUpdated = true; break;}
211  if(m_delta_frequency_isSet){ isObjectUpdated = true; break;}
212  if(report != nullptr && report->isSet()){ isObjectUpdated = true; break;}
213  }while(false);
214  return isObjectUpdated;
215 }
SWGChannelReport * report
Definition: SWGChannel.h:83
virtual bool isSet() override
+ Here is the call graph for this function:

◆ setDeltaFrequency()

void SWGSDRangel::SWGChannel::setDeltaFrequency ( qint32  delta_frequency)

Definition at line 187 of file SWGChannel.cpp.

References delta_frequency, and m_delta_frequency_isSet.

187  {
189  this->m_delta_frequency_isSet = true;
190 }

◆ setId()

void SWGSDRangel::SWGChannel::setId ( QString *  id)

Definition at line 157 of file SWGChannel.cpp.

References id, and m_id_isSet.

157  {
158  this->id = id;
159  this->m_id_isSet = true;
160 }

◆ setIndex()

void SWGSDRangel::SWGChannel::setIndex ( qint32  index)

Definition at line 147 of file SWGChannel.cpp.

References index, and m_index_isSet.

147  {
148  this->index = index;
149  this->m_index_isSet = true;
150 }

◆ setReport()

void SWGSDRangel::SWGChannel::setReport ( SWGChannelReport report)

Definition at line 197 of file SWGChannel.cpp.

References m_report_isSet, and report.

197  {
198  this->report = report;
199  this->m_report_isSet = true;
200 }
SWGChannelReport * report
Definition: SWGChannel.h:83

◆ setTitle()

void SWGSDRangel::SWGChannel::setTitle ( QString *  title)

Definition at line 177 of file SWGChannel.cpp.

References m_title_isSet, and title.

177  {
178  this->title = title;
179  this->m_title_isSet = true;
180 }

◆ setUid()

void SWGSDRangel::SWGChannel::setUid ( qint64  uid)

Definition at line 167 of file SWGChannel.cpp.

References m_uid_isSet, and uid.

167  {
168  this->uid = uid;
169  this->m_uid_isSet = true;
170 }

Member Data Documentation

◆ delta_frequency

qint32 SWGSDRangel::SWGChannel::delta_frequency
private

◆ id

QString* SWGSDRangel::SWGChannel::id
private

Definition at line 71 of file SWGChannel.h.

Referenced by cleanup(), getId(), and setId().

◆ index

qint32 SWGSDRangel::SWGChannel::index
private

Definition at line 68 of file SWGChannel.h.

Referenced by asJsonObject(), fromJsonObject(), getIndex(), init(), setIndex(), and SWGChannel().

◆ m_delta_frequency_isSet

bool SWGSDRangel::SWGChannel::m_delta_frequency_isSet
private

Definition at line 81 of file SWGChannel.h.

Referenced by asJsonObject(), init(), isSet(), setDeltaFrequency(), and SWGChannel().

◆ m_id_isSet

bool SWGSDRangel::SWGChannel::m_id_isSet
private

Definition at line 72 of file SWGChannel.h.

Referenced by init(), setId(), and SWGChannel().

◆ m_index_isSet

bool SWGSDRangel::SWGChannel::m_index_isSet
private

Definition at line 69 of file SWGChannel.h.

Referenced by asJsonObject(), init(), isSet(), setIndex(), and SWGChannel().

◆ m_report_isSet

bool SWGSDRangel::SWGChannel::m_report_isSet
private

Definition at line 84 of file SWGChannel.h.

Referenced by init(), setReport(), and SWGChannel().

◆ m_title_isSet

bool SWGSDRangel::SWGChannel::m_title_isSet
private

Definition at line 78 of file SWGChannel.h.

Referenced by init(), setTitle(), and SWGChannel().

◆ m_uid_isSet

bool SWGSDRangel::SWGChannel::m_uid_isSet
private

Definition at line 75 of file SWGChannel.h.

Referenced by asJsonObject(), init(), isSet(), setUid(), and SWGChannel().

◆ report

SWGChannelReport* SWGSDRangel::SWGChannel::report
private

◆ title

QString* SWGSDRangel::SWGChannel::title
private

◆ uid

qint64 SWGSDRangel::SWGChannel::uid
private

Definition at line 74 of file SWGChannel.h.

Referenced by asJsonObject(), fromJsonObject(), getUid(), init(), setUid(), and SWGChannel().


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