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

#include <SWGAirspyReport.h>

+ Inheritance diagram for SWGSDRangel::SWGAirspyReport:
+ Collaboration diagram for SWGSDRangel::SWGAirspyReport:

Public Member Functions

 SWGAirspyReport ()
 
 SWGAirspyReport (QString *json)
 
virtual ~SWGAirspyReport ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGAirspyReportfromJson (QString &jsonString) override
 
QList< SWGSampleRate * > * getSampleRates ()
 
void setSampleRates (QList< SWGSampleRate *> *sample_rates)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

QList< SWGSampleRate * > * sample_rates
 
bool m_sample_rates_isSet
 

Detailed Description

Definition at line 33 of file SWGAirspyReport.h.

Constructor & Destructor Documentation

◆ SWGAirspyReport() [1/2]

SWGSDRangel::SWGAirspyReport::SWGAirspyReport ( )

Definition at line 30 of file SWGAirspyReport.cpp.

References m_sample_rates_isSet, and sample_rates.

30  {
31  sample_rates = nullptr;
32  m_sample_rates_isSet = false;
33 }
QList< SWGSampleRate * > * sample_rates

◆ SWGAirspyReport() [2/2]

SWGSDRangel::SWGAirspyReport::SWGAirspyReport ( QString *  json)

Definition at line 25 of file SWGAirspyReport.cpp.

References fromJson(), and init().

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

◆ ~SWGAirspyReport()

SWGSDRangel::SWGAirspyReport::~SWGAirspyReport ( )
virtual

Definition at line 35 of file SWGAirspyReport.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGAirspyReport::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 72 of file SWGAirspyReport.cpp.

References asJsonObject().

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

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 83 of file SWGAirspyReport.cpp.

References sample_rates, and SWGSDRangel::toJsonArray().

Referenced by asJson().

83  {
84  QJsonObject* obj = new QJsonObject();
85  if(sample_rates->size() > 0){
86  toJsonArray((QList<void*>*)sample_rates, obj, "sampleRates", "SWGSampleRate");
87  }
88 
89  return obj;
90 }
void toJsonArray(QList< void *> *value, QJsonObject *output, QString innerName, QString innerType)
Definition: SWGHelpers.cpp:445
QList< SWGSampleRate * > * sample_rates
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cleanup()

void SWGSDRangel::SWGAirspyReport::cleanup ( )

Definition at line 46 of file SWGAirspyReport.cpp.

References sample_rates.

Referenced by ~SWGAirspyReport().

46  {
47  if(sample_rates != nullptr) {
48  auto arr = sample_rates;
49  for(auto o: *arr) {
50  delete o;
51  }
52  delete sample_rates;
53  }
54 }
QList< SWGSampleRate * > * sample_rates
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 57 of file SWGAirspyReport.cpp.

References fromJsonObject().

Referenced by SWGAirspyReport().

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 66 of file SWGAirspyReport.cpp.

References sample_rates, and SWGSDRangel::setValue().

Referenced by fromJson().

66  {
67 
68  ::SWGSDRangel::setValue(&sample_rates, pJson["sampleRates"], "QList", "SWGSampleRate");
69 }
void setValue(void *value, QJsonValue obj, QString type, QString complexType)
Definition: SWGHelpers.cpp:25
QList< SWGSampleRate * > * sample_rates
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSampleRates()

QList< SWGSampleRate * > * SWGSDRangel::SWGAirspyReport::getSampleRates ( )

Definition at line 93 of file SWGAirspyReport.cpp.

References sample_rates.

Referenced by AirspyInput::webapiFormatDeviceReport().

93  {
94  return sample_rates;
95 }
QList< SWGSampleRate * > * sample_rates
+ Here is the caller graph for this function:

◆ init()

void SWGSDRangel::SWGAirspyReport::init ( )

Definition at line 40 of file SWGAirspyReport.cpp.

References m_sample_rates_isSet, and sample_rates.

Referenced by SWGAirspyReport(), and AirspyInput::webapiReportGet().

40  {
41  sample_rates = new QList<SWGSampleRate*>();
42  m_sample_rates_isSet = false;
43 }
QList< SWGSampleRate * > * sample_rates
+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGAirspyReport::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 104 of file SWGAirspyReport.cpp.

References sample_rates.

Referenced by SWGSDRangel::SWGDeviceReport::asJsonObject(), and SWGSDRangel::SWGDeviceReport::isSet().

104  {
105  bool isObjectUpdated = false;
106  do{
107  if(sample_rates->size() > 0){ isObjectUpdated = true; break;}
108  }while(false);
109  return isObjectUpdated;
110 }
QList< SWGSampleRate * > * sample_rates
+ Here is the caller graph for this function:

◆ setSampleRates()

void SWGSDRangel::SWGAirspyReport::setSampleRates ( QList< SWGSampleRate *> *  sample_rates)

Definition at line 97 of file SWGAirspyReport.cpp.

References m_sample_rates_isSet, and sample_rates.

Referenced by AirspyInput::webapiFormatDeviceReport().

97  {
98  this->sample_rates = sample_rates;
99  this->m_sample_rates_isSet = true;
100 }
QList< SWGSampleRate * > * sample_rates
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_sample_rates_isSet

bool SWGSDRangel::SWGAirspyReport::m_sample_rates_isSet
private

Definition at line 54 of file SWGAirspyReport.h.

Referenced by init(), setSampleRates(), and SWGAirspyReport().

◆ sample_rates

QList<SWGSampleRate*>* SWGSDRangel::SWGAirspyReport::sample_rates
private

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