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

#include <SWGSampleRate.h>

+ Inheritance diagram for SWGSDRangel::SWGSampleRate:
+ Collaboration diagram for SWGSDRangel::SWGSampleRate:

Public Member Functions

 SWGSampleRate ()
 
 SWGSampleRate (QString *json)
 
virtual ~SWGSampleRate ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGSampleRatefromJson (QString &jsonString) override
 
qint32 getRate ()
 
void setRate (qint32 rate)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

qint32 rate
 
bool m_rate_isSet
 

Detailed Description

Definition at line 31 of file SWGSampleRate.h.

Constructor & Destructor Documentation

◆ SWGSampleRate() [1/2]

SWGSDRangel::SWGSampleRate::SWGSampleRate ( )

Definition at line 30 of file SWGSampleRate.cpp.

References m_rate_isSet, and rate.

30  {
31  rate = 0;
32  m_rate_isSet = false;
33 }

◆ SWGSampleRate() [2/2]

SWGSDRangel::SWGSampleRate::SWGSampleRate ( QString *  json)

Definition at line 25 of file SWGSampleRate.cpp.

References fromJson(), and init().

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

◆ ~SWGSampleRate()

SWGSDRangel::SWGSampleRate::~SWGSampleRate ( )
virtual

Definition at line 35 of file SWGSampleRate.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGSampleRate::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 66 of file SWGSampleRate.cpp.

References asJsonObject().

67 {
68  QJsonObject* obj = this->asJsonObject();
69 
70  QJsonDocument doc(*obj);
71  QByteArray bytes = doc.toJson();
72  delete obj;
73  return QString(bytes);
74 }
virtual QJsonObject * asJsonObject() override
+ Here is the call graph for this function:

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 77 of file SWGSampleRate.cpp.

References m_rate_isSet, and rate.

Referenced by asJson().

77  {
78  QJsonObject* obj = new QJsonObject();
79  if(m_rate_isSet){
80  obj->insert("rate", QJsonValue(rate));
81  }
82 
83  return obj;
84 }
+ Here is the caller graph for this function:

◆ cleanup()

void SWGSDRangel::SWGSampleRate::cleanup ( )

Definition at line 46 of file SWGSampleRate.cpp.

Referenced by ~SWGSampleRate().

46  {
47 
48 }
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 51 of file SWGSampleRate.cpp.

References fromJsonObject().

Referenced by SWGSampleRate().

51  {
52  QByteArray array (json.toStdString().c_str());
53  QJsonDocument doc = QJsonDocument::fromJson(array);
54  QJsonObject jsonObject = doc.object();
55  this->fromJsonObject(jsonObject);
56  return this;
57 }
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::SWGSampleRate::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 60 of file SWGSampleRate.cpp.

References rate, and SWGSDRangel::setValue().

Referenced by fromJson().

60  {
61  ::SWGSDRangel::setValue(&rate, pJson["rate"], "qint32", "");
62 
63 }
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:

◆ getRate()

qint32 SWGSDRangel::SWGSampleRate::getRate ( )

Definition at line 87 of file SWGSampleRate.cpp.

References rate.

87  {
88  return rate;
89 }

◆ init()

void SWGSDRangel::SWGSampleRate::init ( )

Definition at line 40 of file SWGSampleRate.cpp.

References m_rate_isSet, and rate.

Referenced by SWGSampleRate().

40  {
41  rate = 0;
42  m_rate_isSet = false;
43 }
+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGSampleRate::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 98 of file SWGSampleRate.cpp.

References m_rate_isSet.

98  {
99  bool isObjectUpdated = false;
100  do{
101  if(m_rate_isSet){ isObjectUpdated = true; break;}
102  }while(false);
103  return isObjectUpdated;
104 }

◆ setRate()

void SWGSDRangel::SWGSampleRate::setRate ( qint32  rate)

Definition at line 91 of file SWGSampleRate.cpp.

References m_rate_isSet, and rate.

91  {
92  this->rate = rate;
93  this->m_rate_isSet = true;
94 }

Member Data Documentation

◆ m_rate_isSet

bool SWGSDRangel::SWGSampleRate::m_rate_isSet
private

Definition at line 52 of file SWGSampleRate.h.

Referenced by asJsonObject(), init(), isSet(), setRate(), and SWGSampleRate().

◆ rate

qint32 SWGSDRangel::SWGSampleRate::rate
private

Definition at line 51 of file SWGSampleRate.h.

Referenced by asJsonObject(), fromJsonObject(), getRate(), init(), setRate(), and SWGSampleRate().


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