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

#include <SWGChannelListItem.h>

+ Inheritance diagram for SWGSDRangel::SWGChannelListItem:
+ Collaboration diagram for SWGSDRangel::SWGChannelListItem:

Public Member Functions

 SWGChannelListItem ()
 
 SWGChannelListItem (QString *json)
 
virtual ~SWGChannelListItem ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGChannelListItemfromJson (QString &jsonString) override
 
QString * getName ()
 
void setName (QString *name)
 
QString * getIdUri ()
 
void setIdUri (QString *id_uri)
 
QString * getId ()
 
void setId (QString *id)
 
qint32 getDirection ()
 
void setDirection (qint32 direction)
 
QString * getVersion ()
 
void setVersion (QString *version)
 
qint32 getIndex ()
 
void setIndex (qint32 index)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

QString * name
 
bool m_name_isSet
 
QString * id_uri
 
bool m_id_uri_isSet
 
QString * id
 
bool m_id_isSet
 
qint32 direction
 
bool m_direction_isSet
 
QString * version
 
bool m_version_isSet
 
qint32 index
 
bool m_index_isSet
 

Detailed Description

Definition at line 32 of file SWGChannelListItem.h.

Constructor & Destructor Documentation

◆ SWGChannelListItem() [1/2]

SWGSDRangel::SWGChannelListItem::SWGChannelListItem ( )

Definition at line 30 of file SWGChannelListItem.cpp.

References direction, id_uri, index, m_direction_isSet, m_id_isSet, m_id_uri_isSet, m_index_isSet, m_name_isSet, m_version_isSet, name, and version.

◆ SWGChannelListItem() [2/2]

SWGSDRangel::SWGChannelListItem::SWGChannelListItem ( QString *  json)

Definition at line 25 of file SWGChannelListItem.cpp.

References fromJson(), and init().

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

◆ ~SWGChannelListItem()

SWGSDRangel::SWGChannelListItem::~SWGChannelListItem ( )
virtual

Definition at line 45 of file SWGChannelListItem.cpp.

References cleanup().

45  {
46  this->cleanup();
47 }
+ Here is the call graph for this function:

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGChannelListItem::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 109 of file SWGChannelListItem.cpp.

References asJsonObject().

110 {
111  QJsonObject* obj = this->asJsonObject();
112 
113  QJsonDocument doc(*obj);
114  QByteArray bytes = doc.toJson();
115  delete obj;
116  return QString(bytes);
117 }
virtual QJsonObject * asJsonObject() override
+ Here is the call graph for this function:

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 120 of file SWGChannelListItem.cpp.

References direction, id_uri, index, m_direction_isSet, m_index_isSet, name, SWGSDRangel::toJsonValue(), and version.

Referenced by asJson().

120  {
121  QJsonObject* obj = new QJsonObject();
122  if(name != nullptr && *name != QString("")){
123  toJsonValue(QString("name"), name, obj, QString("QString"));
124  }
125  if(id_uri != nullptr && *id_uri != QString("")){
126  toJsonValue(QString("idURI"), id_uri, obj, QString("QString"));
127  }
128  if(id != nullptr && *id != QString("")){
129  toJsonValue(QString("id"), id, obj, QString("QString"));
130  }
131  if(m_direction_isSet){
132  obj->insert("direction", QJsonValue(direction));
133  }
134  if(version != nullptr && *version != QString("")){
135  toJsonValue(QString("version"), version, obj, QString("QString"));
136  }
137  if(m_index_isSet){
138  obj->insert("index", QJsonValue(index));
139  }
140 
141  return obj;
142 }
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::SWGChannelListItem::cleanup ( )

Definition at line 66 of file SWGChannelListItem.cpp.

References id, id_uri, name, and version.

Referenced by ~SWGChannelListItem().

66  {
67  if(name != nullptr) {
68  delete name;
69  }
70  if(id_uri != nullptr) {
71  delete id_uri;
72  }
73  if(id != nullptr) {
74  delete id;
75  }
76 
77  if(version != nullptr) {
78  delete version;
79  }
80 
81 }
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 84 of file SWGChannelListItem.cpp.

References fromJsonObject().

Referenced by SWGChannelListItem().

84  {
85  QByteArray array (json.toStdString().c_str());
86  QJsonDocument doc = QJsonDocument::fromJson(array);
87  QJsonObject jsonObject = doc.object();
88  this->fromJsonObject(jsonObject);
89  return this;
90 }
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::SWGChannelListItem::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 93 of file SWGChannelListItem.cpp.

References direction, id_uri, index, name, SWGSDRangel::setValue(), and version.

Referenced by fromJson().

93  {
94  ::SWGSDRangel::setValue(&name, pJson["name"], "QString", "QString");
95 
96  ::SWGSDRangel::setValue(&id_uri, pJson["idURI"], "QString", "QString");
97 
98  ::SWGSDRangel::setValue(&id, pJson["id"], "QString", "QString");
99 
100  ::SWGSDRangel::setValue(&direction, pJson["direction"], "qint32", "");
101 
102  ::SWGSDRangel::setValue(&version, pJson["version"], "QString", "QString");
103 
104  ::SWGSDRangel::setValue(&index, pJson["index"], "qint32", "");
105 
106 }
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:

◆ getDirection()

qint32 SWGSDRangel::SWGChannelListItem::getDirection ( )

Definition at line 175 of file SWGChannelListItem.cpp.

References direction.

175  {
176  return direction;
177 }

◆ getId()

QString * SWGSDRangel::SWGChannelListItem::getId ( )

Definition at line 165 of file SWGChannelListItem.cpp.

References id.

165  {
166  return id;
167 }

◆ getIdUri()

QString * SWGSDRangel::SWGChannelListItem::getIdUri ( )

Definition at line 155 of file SWGChannelListItem.cpp.

References id_uri.

155  {
156  return id_uri;
157 }

◆ getIndex()

qint32 SWGSDRangel::SWGChannelListItem::getIndex ( )

Definition at line 195 of file SWGChannelListItem.cpp.

References index.

195  {
196  return index;
197 }

◆ getName()

QString * SWGSDRangel::SWGChannelListItem::getName ( )

Definition at line 145 of file SWGChannelListItem.cpp.

References name.

145  {
146  return name;
147 }

◆ getVersion()

QString * SWGSDRangel::SWGChannelListItem::getVersion ( )

Definition at line 185 of file SWGChannelListItem.cpp.

References version.

185  {
186  return version;
187 }

◆ init()

void SWGSDRangel::SWGChannelListItem::init ( )

Definition at line 50 of file SWGChannelListItem.cpp.

References direction, id_uri, index, m_direction_isSet, m_id_isSet, m_id_uri_isSet, m_index_isSet, m_name_isSet, m_version_isSet, name, and version.

Referenced by SWGChannelListItem().

+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGChannelListItem::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 206 of file SWGChannelListItem.cpp.

References id_uri, m_direction_isSet, m_index_isSet, name, and version.

206  {
207  bool isObjectUpdated = false;
208  do{
209  if(name != nullptr && *name != QString("")){ isObjectUpdated = true; break;}
210  if(id_uri != nullptr && *id_uri != QString("")){ isObjectUpdated = true; break;}
211  if(id != nullptr && *id != QString("")){ isObjectUpdated = true; break;}
212  if(m_direction_isSet){ isObjectUpdated = true; break;}
213  if(version != nullptr && *version != QString("")){ isObjectUpdated = true; break;}
214  if(m_index_isSet){ isObjectUpdated = true; break;}
215  }while(false);
216  return isObjectUpdated;
217 }

◆ setDirection()

void SWGSDRangel::SWGChannelListItem::setDirection ( qint32  direction)

Definition at line 179 of file SWGChannelListItem.cpp.

References direction, and m_direction_isSet.

179  {
180  this->direction = direction;
181  this->m_direction_isSet = true;
182 }

◆ setId()

void SWGSDRangel::SWGChannelListItem::setId ( QString *  id)

Definition at line 169 of file SWGChannelListItem.cpp.

References id, and m_id_isSet.

169  {
170  this->id = id;
171  this->m_id_isSet = true;
172 }

◆ setIdUri()

void SWGSDRangel::SWGChannelListItem::setIdUri ( QString *  id_uri)

Definition at line 159 of file SWGChannelListItem.cpp.

References id_uri, and m_id_uri_isSet.

159  {
160  this->id_uri = id_uri;
161  this->m_id_uri_isSet = true;
162 }

◆ setIndex()

void SWGSDRangel::SWGChannelListItem::setIndex ( qint32  index)

Definition at line 199 of file SWGChannelListItem.cpp.

References index, and m_index_isSet.

199  {
200  this->index = index;
201  this->m_index_isSet = true;
202 }

◆ setName()

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

Definition at line 149 of file SWGChannelListItem.cpp.

References m_name_isSet, and name.

149  {
150  this->name = name;
151  this->m_name_isSet = true;
152 }

◆ setVersion()

void SWGSDRangel::SWGChannelListItem::setVersion ( QString *  version)

Definition at line 189 of file SWGChannelListItem.cpp.

References m_version_isSet, and version.

189  {
190  this->version = version;
191  this->m_version_isSet = true;
192 }

Member Data Documentation

◆ direction

qint32 SWGSDRangel::SWGChannelListItem::direction
private

◆ id

QString* SWGSDRangel::SWGChannelListItem::id
private

Definition at line 73 of file SWGChannelListItem.h.

Referenced by cleanup(), getId(), and setId().

◆ id_uri

QString* SWGSDRangel::SWGChannelListItem::id_uri
private

◆ index

qint32 SWGSDRangel::SWGChannelListItem::index
private

◆ m_direction_isSet

bool SWGSDRangel::SWGChannelListItem::m_direction_isSet
private

Definition at line 77 of file SWGChannelListItem.h.

Referenced by asJsonObject(), init(), isSet(), setDirection(), and SWGChannelListItem().

◆ m_id_isSet

bool SWGSDRangel::SWGChannelListItem::m_id_isSet
private

Definition at line 74 of file SWGChannelListItem.h.

Referenced by init(), setId(), and SWGChannelListItem().

◆ m_id_uri_isSet

bool SWGSDRangel::SWGChannelListItem::m_id_uri_isSet
private

Definition at line 71 of file SWGChannelListItem.h.

Referenced by init(), setIdUri(), and SWGChannelListItem().

◆ m_index_isSet

bool SWGSDRangel::SWGChannelListItem::m_index_isSet
private

Definition at line 83 of file SWGChannelListItem.h.

Referenced by asJsonObject(), init(), isSet(), setIndex(), and SWGChannelListItem().

◆ m_name_isSet

bool SWGSDRangel::SWGChannelListItem::m_name_isSet
private

Definition at line 68 of file SWGChannelListItem.h.

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

◆ m_version_isSet

bool SWGSDRangel::SWGChannelListItem::m_version_isSet
private

Definition at line 80 of file SWGChannelListItem.h.

Referenced by init(), setVersion(), and SWGChannelListItem().

◆ name

QString* SWGSDRangel::SWGChannelListItem::name
private

◆ version

QString* SWGSDRangel::SWGChannelListItem::version
private

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