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

#include <SWGChannelConfig.h>

+ Inheritance diagram for SWGSDRangel::SWGChannelConfig:
+ Collaboration diagram for SWGSDRangel::SWGChannelConfig:

Public Member Functions

 SWGChannelConfig ()
 
 SWGChannelConfig (QString *json)
 
virtual ~SWGChannelConfig ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGChannelConfigfromJson (QString &jsonString) override
 
QString * getChannelIdUri ()
 
void setChannelIdUri (QString *channel_id_uri)
 
QString * getChannelId ()
 
void setChannelId (QString *channel_id)
 
SWGChannelSettingsgetConfig ()
 
void setConfig (SWGChannelSettings *config)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

QString * channel_id_uri
 
bool m_channel_id_uri_isSet
 
QString * channel_id
 
bool m_channel_id_isSet
 
SWGChannelSettingsconfig
 
bool m_config_isSet
 

Detailed Description

Definition at line 33 of file SWGChannelConfig.h.

Constructor & Destructor Documentation

◆ SWGChannelConfig() [1/2]

SWGSDRangel::SWGChannelConfig::SWGChannelConfig ( )

◆ SWGChannelConfig() [2/2]

SWGSDRangel::SWGChannelConfig::SWGChannelConfig ( QString *  json)

Definition at line 25 of file SWGChannelConfig.cpp.

References fromJson(), and init().

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

◆ ~SWGChannelConfig()

SWGSDRangel::SWGChannelConfig::~SWGChannelConfig ( )
virtual

Definition at line 39 of file SWGChannelConfig.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGChannelConfig::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 86 of file SWGChannelConfig.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
+ Here is the call graph for this function:

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 97 of file SWGChannelConfig.cpp.

References channel_id, channel_id_uri, and SWGSDRangel::toJsonValue().

Referenced by asJson().

97  {
98  QJsonObject* obj = new QJsonObject();
99  if(channel_id_uri != nullptr && *channel_id_uri != QString("")){
100  toJsonValue(QString("channelIdURI"), channel_id_uri, obj, QString("QString"));
101  }
102  if(channel_id != nullptr && *channel_id != QString("")){
103  toJsonValue(QString("channelId"), channel_id, obj, QString("QString"));
104  }
105  if((config != nullptr) && (config->isSet())){
106  toJsonValue(QString("config"), config, obj, QString("SWGChannelSettings"));
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::SWGChannelConfig::cleanup ( )

Definition at line 54 of file SWGChannelConfig.cpp.

References channel_id, channel_id_uri, and config.

Referenced by ~SWGChannelConfig().

54  {
55  if(channel_id_uri != nullptr) {
56  delete channel_id_uri;
57  }
58  if(channel_id != nullptr) {
59  delete channel_id;
60  }
61  if(config != nullptr) {
62  delete config;
63  }
64 }
SWGChannelSettings * config
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 67 of file SWGChannelConfig.cpp.

References fromJsonObject().

Referenced by SWGChannelConfig().

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
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fromJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 76 of file SWGChannelConfig.cpp.

References channel_id, channel_id_uri, and SWGSDRangel::setValue().

Referenced by fromJson().

76  {
77  ::SWGSDRangel::setValue(&channel_id_uri, pJson["channelIdURI"], "QString", "QString");
78 
79  ::SWGSDRangel::setValue(&channel_id, pJson["channelId"], "QString", "QString");
80 
81  ::SWGSDRangel::setValue(&config, pJson["config"], "SWGChannelSettings", "SWGChannelSettings");
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:

◆ getChannelId()

QString * SWGSDRangel::SWGChannelConfig::getChannelId ( )

Definition at line 123 of file SWGChannelConfig.cpp.

References channel_id.

123  {
124  return channel_id;
125 }

◆ getChannelIdUri()

QString * SWGSDRangel::SWGChannelConfig::getChannelIdUri ( )

Definition at line 113 of file SWGChannelConfig.cpp.

References channel_id_uri.

113  {
114  return channel_id_uri;
115 }

◆ getConfig()

SWGChannelSettings * SWGSDRangel::SWGChannelConfig::getConfig ( )

Definition at line 133 of file SWGChannelConfig.cpp.

References config.

133  {
134  return config;
135 }
SWGChannelSettings * config

◆ init()

void SWGSDRangel::SWGChannelConfig::init ( )

Definition at line 44 of file SWGChannelConfig.cpp.

References channel_id, channel_id_uri, m_channel_id_isSet, m_channel_id_uri_isSet, and m_config_isSet.

Referenced by SWGChannelConfig().

44  {
45  channel_id_uri = new QString("");
46  m_channel_id_uri_isSet = false;
47  channel_id = new QString("");
48  m_channel_id_isSet = false;
49  config = new SWGChannelSettings();
50  m_config_isSet = false;
51 }
+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGChannelConfig::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 144 of file SWGChannelConfig.cpp.

References channel_id, and channel_id_uri.

144  {
145  bool isObjectUpdated = false;
146  do{
147  if(channel_id_uri != nullptr && *channel_id_uri != QString("")){ isObjectUpdated = true; break;}
148  if(channel_id != nullptr && *channel_id != QString("")){ isObjectUpdated = true; break;}
149  if(config != nullptr && config->isSet()){ isObjectUpdated = true; break;}
150  }while(false);
151  return isObjectUpdated;
152 }

◆ setChannelId()

void SWGSDRangel::SWGChannelConfig::setChannelId ( QString *  channel_id)

Definition at line 127 of file SWGChannelConfig.cpp.

References channel_id, and m_channel_id_isSet.

127  {
128  this->channel_id = channel_id;
129  this->m_channel_id_isSet = true;
130 }

◆ setChannelIdUri()

void SWGSDRangel::SWGChannelConfig::setChannelIdUri ( QString *  channel_id_uri)

Definition at line 117 of file SWGChannelConfig.cpp.

References channel_id_uri, and m_channel_id_uri_isSet.

117  {
119  this->m_channel_id_uri_isSet = true;
120 }

◆ setConfig()

void SWGSDRangel::SWGChannelConfig::setConfig ( SWGChannelSettings config)

Definition at line 137 of file SWGChannelConfig.cpp.

References config, and m_config_isSet.

137  {
138  this->config = config;
139  this->m_config_isSet = true;
140 }
SWGChannelSettings * config

Member Data Documentation

◆ channel_id

QString* SWGSDRangel::SWGChannelConfig::channel_id
private

◆ channel_id_uri

QString* SWGSDRangel::SWGChannelConfig::channel_id_uri
private

◆ config

SWGChannelSettings* SWGSDRangel::SWGChannelConfig::config
private

Definition at line 65 of file SWGChannelConfig.h.

Referenced by cleanup(), getConfig(), and setConfig().

◆ m_channel_id_isSet

bool SWGSDRangel::SWGChannelConfig::m_channel_id_isSet
private

Definition at line 63 of file SWGChannelConfig.h.

Referenced by init(), setChannelId(), and SWGChannelConfig().

◆ m_channel_id_uri_isSet

bool SWGSDRangel::SWGChannelConfig::m_channel_id_uri_isSet
private

Definition at line 60 of file SWGChannelConfig.h.

Referenced by init(), setChannelIdUri(), and SWGChannelConfig().

◆ m_config_isSet

bool SWGSDRangel::SWGChannelConfig::m_config_isSet
private

Definition at line 66 of file SWGChannelConfig.h.

Referenced by init(), setConfig(), and SWGChannelConfig().


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