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

#include <SWGPresetIdentifier.h>

+ Inheritance diagram for SWGSDRangel::SWGPresetIdentifier:
+ Collaboration diagram for SWGSDRangel::SWGPresetIdentifier:

Public Member Functions

 SWGPresetIdentifier ()
 
 SWGPresetIdentifier (QString *json)
 
virtual ~SWGPresetIdentifier ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGPresetIdentifierfromJson (QString &jsonString) override
 
QString * getGroupName ()
 
void setGroupName (QString *group_name)
 
qint64 getCenterFrequency ()
 
void setCenterFrequency (qint64 center_frequency)
 
QString * getType ()
 
void setType (QString *type)
 
QString * getName ()
 
void setName (QString *name)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

QString * group_name
 
bool m_group_name_isSet
 
qint64 center_frequency
 
bool m_center_frequency_isSet
 
QString * type
 
bool m_type_isSet
 
QString * name
 
bool m_name_isSet
 

Detailed Description

Definition at line 32 of file SWGPresetIdentifier.h.

Constructor & Destructor Documentation

◆ SWGPresetIdentifier() [1/2]

SWGSDRangel::SWGPresetIdentifier::SWGPresetIdentifier ( )

◆ SWGPresetIdentifier() [2/2]

SWGSDRangel::SWGPresetIdentifier::SWGPresetIdentifier ( QString *  json)

Definition at line 25 of file SWGPresetIdentifier.cpp.

References fromJson(), and init().

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

◆ ~SWGPresetIdentifier()

SWGSDRangel::SWGPresetIdentifier::~SWGPresetIdentifier ( )
virtual

Definition at line 41 of file SWGPresetIdentifier.cpp.

References cleanup().

41  {
42  this->cleanup();
43 }
+ Here is the call graph for this function:

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGPresetIdentifier::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 93 of file SWGPresetIdentifier.cpp.

References asJsonObject().

Referenced by SWGSDRangel::SWGInstanceApi::instancePresetDelete(), WebAPIRequestMapper::instancePresetFileService(), and WebAPIRequestMapper::instancePresetService().

94 {
95  QJsonObject* obj = this->asJsonObject();
96 
97  QJsonDocument doc(*obj);
98  QByteArray bytes = doc.toJson();
99  delete obj;
100  return QString(bytes);
101 }
virtual QJsonObject * asJsonObject() override
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 104 of file SWGPresetIdentifier.cpp.

References center_frequency, group_name, m_center_frequency_isSet, name, SWGSDRangel::toJsonValue(), and type.

Referenced by asJson().

104  {
105  QJsonObject* obj = new QJsonObject();
106  if(group_name != nullptr && *group_name != QString("")){
107  toJsonValue(QString("groupName"), group_name, obj, QString("QString"));
108  }
110  obj->insert("centerFrequency", QJsonValue(center_frequency));
111  }
112  if(type != nullptr && *type != QString("")){
113  toJsonValue(QString("type"), type, obj, QString("QString"));
114  }
115  if(name != nullptr && *name != QString("")){
116  toJsonValue(QString("name"), name, obj, QString("QString"));
117  }
118 
119  return obj;
120 }
void toJsonValue(QString name, void *value, QJsonObject *output, QString type)
Definition: SWGHelpers.cpp:383
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cleanup()

void SWGSDRangel::SWGPresetIdentifier::cleanup ( )

Definition at line 58 of file SWGPresetIdentifier.cpp.

References group_name, name, and type.

Referenced by ~SWGPresetIdentifier().

58  {
59  if(group_name != nullptr) {
60  delete group_name;
61  }
62 
63  if(type != nullptr) {
64  delete type;
65  }
66  if(name != nullptr) {
67  delete name;
68  }
69 }
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 72 of file SWGPresetIdentifier.cpp.

References fromJsonObject().

Referenced by WebAPIRequestMapper::instancePresetService(), and SWGPresetIdentifier().

72  {
73  QByteArray array (json.toStdString().c_str());
74  QJsonDocument doc = QJsonDocument::fromJson(array);
75  QJsonObject jsonObject = doc.object();
76  this->fromJsonObject(jsonObject);
77  return this;
78 }
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::SWGPresetIdentifier::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 81 of file SWGPresetIdentifier.cpp.

References center_frequency, group_name, name, SWGSDRangel::setValue(), and type.

Referenced by fromJson().

81  {
82  ::SWGSDRangel::setValue(&group_name, pJson["groupName"], "QString", "QString");
83 
84  ::SWGSDRangel::setValue(&center_frequency, pJson["centerFrequency"], "qint64", "");
85 
86  ::SWGSDRangel::setValue(&type, pJson["type"], "QString", "QString");
87 
88  ::SWGSDRangel::setValue(&name, pJson["name"], "QString", "QString");
89 
90 }
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:

◆ getCenterFrequency()

qint64 SWGSDRangel::SWGPresetIdentifier::getCenterFrequency ( )

◆ getGroupName()

QString * SWGSDRangel::SWGPresetIdentifier::getGroupName ( )

◆ getName()

QString * SWGSDRangel::SWGPresetIdentifier::getName ( )

◆ getType()

QString * SWGSDRangel::SWGPresetIdentifier::getType ( )

◆ init()

void SWGSDRangel::SWGPresetIdentifier::init ( )

Definition at line 46 of file SWGPresetIdentifier.cpp.

References center_frequency, group_name, m_center_frequency_isSet, m_group_name_isSet, m_name_isSet, m_type_isSet, name, and type.

Referenced by WebAPIAdapterSrv::instancePresetFilePost(), WebAPIAdapterSrv::instancePresetFilePut(), WebAPIAdapterGUI::instancePresetPatch(), WebAPIAdapterSrv::instancePresetPatch(), WebAPIAdapterGUI::instancePresetPost(), WebAPIAdapterSrv::instancePresetPost(), WebAPIAdapterGUI::instancePresetPut(), WebAPIAdapterSrv::instancePresetPut(), and SWGPresetIdentifier().

+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGPresetIdentifier::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 164 of file SWGPresetIdentifier.cpp.

References group_name, m_center_frequency_isSet, name, and type.

Referenced by SWGSDRangel::SWGPresetTransfer::asJsonObject(), SWGSDRangel::SWGPresetExport::asJsonObject(), SWGSDRangel::SWGPresetTransfer::isSet(), and SWGSDRangel::SWGPresetExport::isSet().

164  {
165  bool isObjectUpdated = false;
166  do{
167  if(group_name != nullptr && *group_name != QString("")){ isObjectUpdated = true; break;}
168  if(m_center_frequency_isSet){ isObjectUpdated = true; break;}
169  if(type != nullptr && *type != QString("")){ isObjectUpdated = true; break;}
170  if(name != nullptr && *name != QString("")){ isObjectUpdated = true; break;}
171  }while(false);
172  return isObjectUpdated;
173 }
+ Here is the caller graph for this function:

◆ setCenterFrequency()

void SWGSDRangel::SWGPresetIdentifier::setCenterFrequency ( qint64  center_frequency)

◆ setGroupName()

void SWGSDRangel::SWGPresetIdentifier::setGroupName ( QString *  group_name)

Definition at line 127 of file SWGPresetIdentifier.cpp.

References group_name, and m_group_name_isSet.

127  {
128  this->group_name = group_name;
129  this->m_group_name_isSet = true;
130 }

◆ setName()

void SWGSDRangel::SWGPresetIdentifier::setName ( QString *  name)

Definition at line 157 of file SWGPresetIdentifier.cpp.

References m_name_isSet, and name.

157  {
158  this->name = name;
159  this->m_name_isSet = true;
160 }

◆ setType()

void SWGSDRangel::SWGPresetIdentifier::setType ( QString *  type)

Definition at line 147 of file SWGPresetIdentifier.cpp.

References m_type_isSet, and type.

147  {
148  this->type = type;
149  this->m_type_isSet = true;
150 }

Member Data Documentation

◆ center_frequency

qint64 SWGSDRangel::SWGPresetIdentifier::center_frequency
private

◆ group_name

QString* SWGSDRangel::SWGPresetIdentifier::group_name
private

◆ m_center_frequency_isSet

bool SWGSDRangel::SWGPresetIdentifier::m_center_frequency_isSet
private

◆ m_group_name_isSet

bool SWGSDRangel::SWGPresetIdentifier::m_group_name_isSet
private

Definition at line 62 of file SWGPresetIdentifier.h.

Referenced by init(), setGroupName(), and SWGPresetIdentifier().

◆ m_name_isSet

bool SWGSDRangel::SWGPresetIdentifier::m_name_isSet
private

Definition at line 71 of file SWGPresetIdentifier.h.

Referenced by init(), setName(), and SWGPresetIdentifier().

◆ m_type_isSet

bool SWGSDRangel::SWGPresetIdentifier::m_type_isSet
private

Definition at line 68 of file SWGPresetIdentifier.h.

Referenced by init(), setType(), and SWGPresetIdentifier().

◆ name

QString* SWGSDRangel::SWGPresetIdentifier::name
private

◆ type

QString* SWGSDRangel::SWGPresetIdentifier::type
private

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