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

#include <SWGPerseusReport.h>

+ Inheritance diagram for SWGSDRangel::SWGPerseusReport:
+ Collaboration diagram for SWGSDRangel::SWGPerseusReport:

Public Member Functions

 SWGPerseusReport ()
 
 SWGPerseusReport (QString *json)
 
virtual ~SWGPerseusReport ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGPerseusReportfromJson (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 SWGPerseusReport.h.

Constructor & Destructor Documentation

◆ SWGPerseusReport() [1/2]

SWGSDRangel::SWGPerseusReport::SWGPerseusReport ( )

Definition at line 30 of file SWGPerseusReport.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

◆ SWGPerseusReport() [2/2]

SWGSDRangel::SWGPerseusReport::SWGPerseusReport ( QString *  json)

Definition at line 25 of file SWGPerseusReport.cpp.

References fromJson(), and init().

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

◆ ~SWGPerseusReport()

SWGSDRangel::SWGPerseusReport::~SWGPerseusReport ( )
virtual

Definition at line 35 of file SWGPerseusReport.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGPerseusReport::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 72 of file SWGPerseusReport.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::SWGPerseusReport::asJsonObject ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 83 of file SWGPerseusReport.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 }
QList< SWGSampleRate * > * sample_rates
void toJsonArray(QList< void *> *value, QJsonObject *output, QString innerName, QString innerType)
Definition: SWGHelpers.cpp:445
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cleanup()

void SWGSDRangel::SWGPerseusReport::cleanup ( )

Definition at line 46 of file SWGPerseusReport.cpp.

References sample_rates.

Referenced by ~SWGPerseusReport().

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()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 57 of file SWGPerseusReport.cpp.

References fromJsonObject().

Referenced by SWGPerseusReport().

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::SWGPerseusReport::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 66 of file SWGPerseusReport.cpp.

References sample_rates, and SWGSDRangel::setValue().

Referenced by fromJson().

66  {
67 
68  ::SWGSDRangel::setValue(&sample_rates, pJson["sampleRates"], "QList", "SWGSampleRate");
69 }
QList< SWGSampleRate * > * sample_rates
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:

◆ getSampleRates()

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

Definition at line 93 of file SWGPerseusReport.cpp.

References sample_rates.

Referenced by PerseusInput::webapiFormatDeviceReport().

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

◆ init()

void SWGSDRangel::SWGPerseusReport::init ( )

Definition at line 40 of file SWGPerseusReport.cpp.

References m_sample_rates_isSet, and sample_rates.

Referenced by SWGPerseusReport(), and PerseusInput::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::SWGPerseusReport::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 104 of file SWGPerseusReport.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::SWGPerseusReport::setSampleRates ( QList< SWGSampleRate *> *  sample_rates)

Definition at line 97 of file SWGPerseusReport.cpp.

References m_sample_rates_isSet, and sample_rates.

Referenced by PerseusInput::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::SWGPerseusReport::m_sample_rates_isSet
private

Definition at line 54 of file SWGPerseusReport.h.

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

◆ sample_rates

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

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