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

#include <SWGArgValue.h>

+ Inheritance diagram for SWGSDRangel::SWGArgValue:
+ Collaboration diagram for SWGSDRangel::SWGArgValue:

Public Member Functions

 SWGArgValue ()
 
 SWGArgValue (QString *json)
 
virtual ~SWGArgValue ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGArgValuefromJson (QString &jsonString) override
 
QString * getKey ()
 
void setKey (QString *key)
 
QString * getValueType ()
 
void setValueType (QString *value_type)
 
QString * getValueString ()
 
void setValueString (QString *value_string)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

QString * key
 
bool m_key_isSet
 
QString * value_type
 
bool m_value_type_isSet
 
QString * value_string
 
bool m_value_string_isSet
 

Detailed Description

Definition at line 32 of file SWGArgValue.h.

Constructor & Destructor Documentation

◆ SWGArgValue() [1/2]

SWGSDRangel::SWGArgValue::SWGArgValue ( )

Definition at line 30 of file SWGArgValue.cpp.

References key, m_key_isSet, m_value_string_isSet, m_value_type_isSet, value_string, and value_type.

30  {
31  key = nullptr;
32  m_key_isSet = false;
33  value_type = nullptr;
34  m_value_type_isSet = false;
35  value_string = nullptr;
36  m_value_string_isSet = false;
37 }

◆ SWGArgValue() [2/2]

SWGSDRangel::SWGArgValue::SWGArgValue ( QString *  json)

Definition at line 25 of file SWGArgValue.cpp.

References fromJson(), and init().

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

◆ ~SWGArgValue()

SWGSDRangel::SWGArgValue::~SWGArgValue ( )
virtual

Definition at line 39 of file SWGArgValue.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGArgValue::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 86 of file SWGArgValue.cpp.

References asJsonObject().

87 {
88  QJsonObject* obj = this->asJsonObject();
89 
90  QJsonDocument doc(*obj);
91  QByteArray bytes = doc.toJson();
92  delete obj;
93  return QString(bytes);
94 }
virtual QJsonObject * asJsonObject() override
Definition: SWGArgValue.cpp:97
+ Here is the call graph for this function:

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 97 of file SWGArgValue.cpp.

References key, SWGSDRangel::toJsonValue(), value_string, and value_type.

Referenced by asJson().

97  {
98  QJsonObject* obj = new QJsonObject();
99  if(key != nullptr && *key != QString("")){
100  toJsonValue(QString("key"), key, obj, QString("QString"));
101  }
102  if(value_type != nullptr && *value_type != QString("")){
103  toJsonValue(QString("valueType"), value_type, obj, QString("QString"));
104  }
105  if(value_string != nullptr && *value_string != QString("")){
106  toJsonValue(QString("valueString"), value_string, obj, QString("QString"));
107  }
108 
109  return obj;
110 }
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::SWGArgValue::cleanup ( )

Definition at line 54 of file SWGArgValue.cpp.

References key, value_string, and value_type.

Referenced by ~SWGArgValue().

54  {
55  if(key != nullptr) {
56  delete key;
57  }
58  if(value_type != nullptr) {
59  delete value_type;
60  }
61  if(value_string != nullptr) {
62  delete value_string;
63  }
64 }
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 67 of file SWGArgValue.cpp.

References fromJsonObject().

Referenced by SWGArgValue().

67  {
68  QByteArray array (json.toStdString().c_str());
69  QJsonDocument doc = QJsonDocument::fromJson(array);
70  QJsonObject jsonObject = doc.object();
71  this->fromJsonObject(jsonObject);
72  return this;
73 }
virtual void fromJsonObject(QJsonObject &json) override
Definition: SWGArgValue.cpp:76
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fromJsonObject()

void SWGSDRangel::SWGArgValue::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 76 of file SWGArgValue.cpp.

References key, SWGSDRangel::setValue(), value_string, and value_type.

Referenced by fromJson().

76  {
77  ::SWGSDRangel::setValue(&key, pJson["key"], "QString", "QString");
78 
79  ::SWGSDRangel::setValue(&value_type, pJson["valueType"], "QString", "QString");
80 
81  ::SWGSDRangel::setValue(&value_string, pJson["valueString"], "QString", "QString");
82 
83 }
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:

◆ getKey()

QString * SWGSDRangel::SWGArgValue::getKey ( )

Definition at line 113 of file SWGArgValue.cpp.

References key.

113  {
114  return key;
115 }

◆ getValueString()

QString * SWGSDRangel::SWGArgValue::getValueString ( )

Definition at line 133 of file SWGArgValue.cpp.

References value_string.

Referenced by SoapySDROutput::webapiVariantFromArgValue(), and SoapySDRInput::webapiVariantFromArgValue().

133  {
134  return value_string;
135 }
+ Here is the caller graph for this function:

◆ getValueType()

QString * SWGSDRangel::SWGArgValue::getValueType ( )

Definition at line 123 of file SWGArgValue.cpp.

References value_type.

Referenced by SoapySDROutput::webapiVariantFromArgValue(), and SoapySDRInput::webapiVariantFromArgValue().

123  {
124  return value_type;
125 }
+ Here is the caller graph for this function:

◆ init()

void SWGSDRangel::SWGArgValue::init ( )

Definition at line 44 of file SWGArgValue.cpp.

References key, m_key_isSet, m_value_string_isSet, m_value_type_isSet, value_string, and value_type.

Referenced by SWGArgValue().

44  {
45  key = new QString("");
46  m_key_isSet = false;
47  value_type = new QString("");
48  m_value_type_isSet = false;
49  value_string = new QString("");
50  m_value_string_isSet = false;
51 }
+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGArgValue::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 144 of file SWGArgValue.cpp.

References key, value_string, and value_type.

144  {
145  bool isObjectUpdated = false;
146  do{
147  if(key != nullptr && *key != QString("")){ isObjectUpdated = true; break;}
148  if(value_type != nullptr && *value_type != QString("")){ isObjectUpdated = true; break;}
149  if(value_string != nullptr && *value_string != QString("")){ isObjectUpdated = true; break;}
150  }while(false);
151  return isObjectUpdated;
152 }

◆ setKey()

void SWGSDRangel::SWGArgValue::setKey ( QString *  key)

Definition at line 117 of file SWGArgValue.cpp.

References key, and m_key_isSet.

117  {
118  this->key = key;
119  this->m_key_isSet = true;
120 }

◆ setValueString()

void SWGSDRangel::SWGArgValue::setValueString ( QString *  value_string)

Definition at line 137 of file SWGArgValue.cpp.

References m_value_string_isSet, and value_string.

Referenced by SoapySDROutput::webapiFormatArgValue(), and SoapySDRInput::webapiFormatArgValue().

137  {
138  this->value_string = value_string;
139  this->m_value_string_isSet = true;
140 }
+ Here is the caller graph for this function:

◆ setValueType()

void SWGSDRangel::SWGArgValue::setValueType ( QString *  value_type)

Definition at line 127 of file SWGArgValue.cpp.

References m_value_type_isSet, and value_type.

Referenced by SoapySDROutput::webapiFormatArgValue(), and SoapySDRInput::webapiFormatArgValue().

127  {
128  this->value_type = value_type;
129  this->m_value_type_isSet = true;
130 }
+ Here is the caller graph for this function:

Member Data Documentation

◆ key

QString* SWGSDRangel::SWGArgValue::key
private

Definition at line 58 of file SWGArgValue.h.

Referenced by asJsonObject(), cleanup(), fromJsonObject(), getKey(), init(), isSet(), setKey(), and SWGArgValue().

◆ m_key_isSet

bool SWGSDRangel::SWGArgValue::m_key_isSet
private

Definition at line 59 of file SWGArgValue.h.

Referenced by init(), setKey(), and SWGArgValue().

◆ m_value_string_isSet

bool SWGSDRangel::SWGArgValue::m_value_string_isSet
private

Definition at line 65 of file SWGArgValue.h.

Referenced by init(), setValueString(), and SWGArgValue().

◆ m_value_type_isSet

bool SWGSDRangel::SWGArgValue::m_value_type_isSet
private

Definition at line 62 of file SWGArgValue.h.

Referenced by init(), setValueType(), and SWGArgValue().

◆ value_string

QString* SWGSDRangel::SWGArgValue::value_string
private

◆ value_type

QString* SWGSDRangel::SWGArgValue::value_type
private

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