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

#include <SWGChannelsDetail.h>

+ Inheritance diagram for SWGSDRangel::SWGChannelsDetail:
+ Collaboration diagram for SWGSDRangel::SWGChannelsDetail:

Public Member Functions

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

Private Attributes

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

Detailed Description

Definition at line 33 of file SWGChannelsDetail.h.

Constructor & Destructor Documentation

◆ SWGChannelsDetail() [1/2]

SWGSDRangel::SWGChannelsDetail::SWGChannelsDetail ( )

Definition at line 30 of file SWGChannelsDetail.cpp.

References channelcount, channels, m_channelcount_isSet, and m_channels_isSet.

30  {
31  channelcount = 0;
32  m_channelcount_isSet = false;
33  channels = nullptr;
34  m_channels_isSet = false;
35 }
QList< SWGChannel * > * channels

◆ SWGChannelsDetail() [2/2]

SWGSDRangel::SWGChannelsDetail::SWGChannelsDetail ( QString *  json)

Definition at line 25 of file SWGChannelsDetail.cpp.

References fromJson(), and init().

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

◆ ~SWGChannelsDetail()

SWGSDRangel::SWGChannelsDetail::~SWGChannelsDetail ( )
virtual

Definition at line 37 of file SWGChannelsDetail.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGChannelsDetail::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 79 of file SWGChannelsDetail.cpp.

References asJsonObject().

Referenced by WebAPIRequestMapper::devicesetChannelsReportService().

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

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 90 of file SWGChannelsDetail.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", "SWGChannel");
97  }
98 
99  return obj;
100 }
QList< SWGChannel * > * channels
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::SWGChannelsDetail::cleanup ( )

Definition at line 50 of file SWGChannelsDetail.cpp.

References channels.

Referenced by ~SWGChannelsDetail().

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

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 62 of file SWGChannelsDetail.cpp.

References fromJsonObject().

Referenced by SWGChannelsDetail().

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::SWGChannelsDetail::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 71 of file SWGChannelsDetail.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", "SWGChannel");
76 }
QList< SWGChannel * > * channels
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::SWGChannelsDetail::getChannelcount ( )

Definition at line 103 of file SWGChannelsDetail.cpp.

References channelcount.

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

103  {
104  return channelcount;
105 }
+ Here is the caller graph for this function:

◆ getChannels()

QList< SWGChannel * > * SWGSDRangel::SWGChannelsDetail::getChannels ( )

Definition at line 113 of file SWGChannelsDetail.cpp.

References channels.

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

113  {
114  return channels;
115 }
QList< SWGChannel * > * channels
+ Here is the caller graph for this function:

◆ init()

void SWGSDRangel::SWGChannelsDetail::init ( )

Definition at line 42 of file SWGChannelsDetail.cpp.

References channelcount, channels, m_channelcount_isSet, and m_channels_isSet.

Referenced by WebAPIAdapterGUI::getChannelsDetail(), WebAPIAdapterSrv::getChannelsDetail(), and SWGChannelsDetail().

42  {
43  channelcount = 0;
44  m_channelcount_isSet = false;
45  channels = new QList<SWGChannel*>();
46  m_channels_isSet = false;
47 }
QList< SWGChannel * > * channels
+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGChannelsDetail::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 124 of file SWGChannelsDetail.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 }
QList< SWGChannel * > * channels

◆ setChannelcount()

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

Definition at line 107 of file SWGChannelsDetail.cpp.

References channelcount, and m_channelcount_isSet.

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

107  {
108  this->channelcount = channelcount;
109  this->m_channelcount_isSet = true;
110 }
+ Here is the caller graph for this function:

◆ setChannels()

void SWGSDRangel::SWGChannelsDetail::setChannels ( QList< SWGChannel *> *  channels)

Definition at line 117 of file SWGChannelsDetail.cpp.

References channels, and m_channels_isSet.

117  {
118  this->channels = channels;
119  this->m_channels_isSet = true;
120 }
QList< SWGChannel * > * channels

Member Data Documentation

◆ channelcount

qint32 SWGSDRangel::SWGChannelsDetail::channelcount
private

◆ channels

QList<SWGChannel*>* SWGSDRangel::SWGChannelsDetail::channels
private

◆ m_channelcount_isSet

bool SWGSDRangel::SWGChannelsDetail::m_channelcount_isSet
private

Definition at line 57 of file SWGChannelsDetail.h.

Referenced by asJsonObject(), init(), isSet(), setChannelcount(), and SWGChannelsDetail().

◆ m_channels_isSet

bool SWGSDRangel::SWGChannelsDetail::m_channels_isSet
private

Definition at line 60 of file SWGChannelsDetail.h.

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


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