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

#include <SWGFrequency.h>

+ Inheritance diagram for SWGSDRangel::SWGFrequency:
+ Collaboration diagram for SWGSDRangel::SWGFrequency:

Public Member Functions

 SWGFrequency ()
 
 SWGFrequency (QString *json)
 
virtual ~SWGFrequency ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGFrequencyfromJson (QString &jsonString) override
 
qint32 getFrequency ()
 
void setFrequency (qint32 frequency)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

qint32 frequency
 
bool m_frequency_isSet
 

Detailed Description

Definition at line 31 of file SWGFrequency.h.

Constructor & Destructor Documentation

◆ SWGFrequency() [1/2]

SWGSDRangel::SWGFrequency::SWGFrequency ( )

Definition at line 30 of file SWGFrequency.cpp.

References frequency, and m_frequency_isSet.

30  {
31  frequency = 0;
32  m_frequency_isSet = false;
33 }

◆ SWGFrequency() [2/2]

SWGSDRangel::SWGFrequency::SWGFrequency ( QString *  json)

Definition at line 25 of file SWGFrequency.cpp.

References fromJson(), and init().

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

◆ ~SWGFrequency()

SWGSDRangel::SWGFrequency::~SWGFrequency ( )
virtual

Definition at line 35 of file SWGFrequency.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGFrequency::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 77 of file SWGFrequency.cpp.

References frequency, and m_frequency_isSet.

Referenced by asJson().

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

◆ cleanup()

void SWGSDRangel::SWGFrequency::cleanup ( )

Definition at line 46 of file SWGFrequency.cpp.

Referenced by ~SWGFrequency().

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

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 51 of file SWGFrequency.cpp.

References fromJsonObject().

Referenced by SWGFrequency().

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 60 of file SWGFrequency.cpp.

References frequency, and SWGSDRangel::setValue().

Referenced by fromJson().

60  {
61  ::SWGSDRangel::setValue(&frequency, pJson["frequency"], "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:

◆ getFrequency()

qint32 SWGSDRangel::SWGFrequency::getFrequency ( )

Definition at line 87 of file SWGFrequency.cpp.

References frequency.

87  {
88  return frequency;
89 }

◆ init()

void SWGSDRangel::SWGFrequency::init ( )

Definition at line 40 of file SWGFrequency.cpp.

References frequency, and m_frequency_isSet.

Referenced by SWGFrequency().

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

◆ isSet()

bool SWGSDRangel::SWGFrequency::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 98 of file SWGFrequency.cpp.

References m_frequency_isSet.

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

◆ setFrequency()

void SWGSDRangel::SWGFrequency::setFrequency ( qint32  frequency)

Definition at line 91 of file SWGFrequency.cpp.

References frequency, and m_frequency_isSet.

91  {
92  this->frequency = frequency;
93  this->m_frequency_isSet = true;
94 }

Member Data Documentation

◆ frequency

qint32 SWGSDRangel::SWGFrequency::frequency
private

◆ m_frequency_isSet

bool SWGSDRangel::SWGFrequency::m_frequency_isSet
private

Definition at line 52 of file SWGFrequency.h.

Referenced by asJsonObject(), init(), isSet(), setFrequency(), and SWGFrequency().


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