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

#include <SWGInstanceChannelsResponse.h>

+ Inheritance diagram for SWGSDRangel::SWGInstanceChannelsResponse:
+ Collaboration diagram for SWGSDRangel::SWGInstanceChannelsResponse:

Public Member Functions

 SWGInstanceChannelsResponse ()
 
 SWGInstanceChannelsResponse (QString *json)
 
virtual ~SWGInstanceChannelsResponse ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGInstanceChannelsResponsefromJson (QString &jsonString) override
 
qint32 getChannelcount ()
 
void setChannelcount (qint32 channelcount)
 
QList< SWGChannelListItem * > * getChannels ()
 
void setChannels (QList< SWGChannelListItem *> *channels)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

qint32 channelcount
 
bool m_channelcount_isSet
 
QList< SWGChannelListItem * > * channels
 
bool m_channels_isSet
 

Detailed Description

Definition at line 33 of file SWGInstanceChannelsResponse.h.

Constructor & Destructor Documentation

◆ SWGInstanceChannelsResponse() [1/2]

SWGSDRangel::SWGInstanceChannelsResponse::SWGInstanceChannelsResponse ( )

◆ SWGInstanceChannelsResponse() [2/2]

SWGSDRangel::SWGInstanceChannelsResponse::SWGInstanceChannelsResponse ( QString *  json)

Definition at line 25 of file SWGInstanceChannelsResponse.cpp.

References fromJson(), and init().

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

◆ ~SWGInstanceChannelsResponse()

SWGSDRangel::SWGInstanceChannelsResponse::~SWGInstanceChannelsResponse ( )
virtual

Definition at line 37 of file SWGInstanceChannelsResponse.cpp.

References cleanup().

+ Here is the call graph for this function:

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGInstanceChannelsResponse::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 79 of file SWGInstanceChannelsResponse.cpp.

References asJsonObject().

Referenced by WebAPIRequestMapper::instanceChannelsService().

80 {
81  QJsonObject* obj = this->asJsonObject();
82 
83  QJsonDocument doc(*obj);
84  QByteArray bytes = doc.toJson();
85  delete obj;
86  return QString(bytes);
87 }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 90 of file SWGInstanceChannelsResponse.cpp.

References channelcount, channels, m_channelcount_isSet, and SWGSDRangel::toJsonArray().

Referenced by asJson().

90  {
91  QJsonObject* obj = new QJsonObject();
93  obj->insert("channelcount", QJsonValue(channelcount));
94  }
95  if(channels->size() > 0){
96  toJsonArray((QList<void*>*)channels, obj, "channels", "SWGChannelListItem");
97  }
98 
99  return obj;
100 }
void toJsonArray(QList< void *> *value, QJsonObject *output, QString innerName, QString innerType)
Definition: SWGHelpers.cpp:445
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cleanup()

void SWGSDRangel::SWGInstanceChannelsResponse::cleanup ( )

Definition at line 50 of file SWGInstanceChannelsResponse.cpp.

References channels.

Referenced by ~SWGInstanceChannelsResponse().

50  {
51 
52  if(channels != nullptr) {
53  auto arr = channels;
54  for(auto o: *arr) {
55  delete o;
56  }
57  delete channels;
58  }
59 }
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 62 of file SWGInstanceChannelsResponse.cpp.

References fromJsonObject().

Referenced by SWGInstanceChannelsResponse().

62  {
63  QByteArray array (json.toStdString().c_str());
64  QJsonDocument doc = QJsonDocument::fromJson(array);
65  QJsonObject jsonObject = doc.object();
66  this->fromJsonObject(jsonObject);
67  return this;
68 }
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::SWGInstanceChannelsResponse::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 71 of file SWGInstanceChannelsResponse.cpp.

References channelcount, channels, and SWGSDRangel::setValue().

Referenced by fromJson().

71  {
72  ::SWGSDRangel::setValue(&channelcount, pJson["channelcount"], "qint32", "");
73 
74 
75  ::SWGSDRangel::setValue(&channels, pJson["channels"], "QList", "SWGChannelListItem");
76 }
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:

◆ getChannelcount()

qint32 SWGSDRangel::SWGInstanceChannelsResponse::getChannelcount ( )

Definition at line 103 of file SWGInstanceChannelsResponse.cpp.

References channelcount.

◆ getChannels()

QList< SWGChannelListItem * > * SWGSDRangel::SWGInstanceChannelsResponse::getChannels ( )

Definition at line 113 of file SWGInstanceChannelsResponse.cpp.

References channels.

Referenced by WebAPIAdapterGUI::instanceChannels(), and WebAPIAdapterSrv::instanceChannels().

113  {
114  return channels;
115 }
+ Here is the caller graph for this function:

◆ init()

void SWGSDRangel::SWGInstanceChannelsResponse::init ( )

◆ isSet()

bool SWGSDRangel::SWGInstanceChannelsResponse::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 124 of file SWGInstanceChannelsResponse.cpp.

References channels, and m_channelcount_isSet.

124  {
125  bool isObjectUpdated = false;
126  do{
127  if(m_channelcount_isSet){ isObjectUpdated = true; break;}
128  if(channels->size() > 0){ isObjectUpdated = true; break;}
129  }while(false);
130  return isObjectUpdated;
131 }

◆ setChannelcount()

void SWGSDRangel::SWGInstanceChannelsResponse::setChannelcount ( qint32  channelcount)

◆ setChannels()

void SWGSDRangel::SWGInstanceChannelsResponse::setChannels ( QList< SWGChannelListItem *> *  channels)

Definition at line 117 of file SWGInstanceChannelsResponse.cpp.

References channels, and m_channels_isSet.

117  {
118  this->channels = channels;
119  this->m_channels_isSet = true;
120 }

Member Data Documentation

◆ channelcount

qint32 SWGSDRangel::SWGInstanceChannelsResponse::channelcount
private

◆ channels

QList<SWGChannelListItem*>* SWGSDRangel::SWGInstanceChannelsResponse::channels
private

◆ m_channelcount_isSet

bool SWGSDRangel::SWGInstanceChannelsResponse::m_channelcount_isSet
private

◆ m_channels_isSet

bool SWGSDRangel::SWGInstanceChannelsResponse::m_channels_isSet
private

Definition at line 60 of file SWGInstanceChannelsResponse.h.

Referenced by init(), setChannels(), and SWGInstanceChannelsResponse().


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