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

#include <SWGSuccessResponse.h>

+ Inheritance diagram for SWGSDRangel::SWGSuccessResponse:
+ Collaboration diagram for SWGSDRangel::SWGSuccessResponse:

Public Member Functions

 SWGSuccessResponse ()
 
 SWGSuccessResponse (QString *json)
 
virtual ~SWGSuccessResponse ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGSuccessResponsefromJson (QString &jsonString) override
 
QString * getMessage ()
 
void setMessage (QString *message)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

QString * message
 
bool m_message_isSet
 

Detailed Description

Definition at line 32 of file SWGSuccessResponse.h.

Constructor & Destructor Documentation

◆ SWGSuccessResponse() [1/2]

SWGSDRangel::SWGSuccessResponse::SWGSuccessResponse ( )

Definition at line 30 of file SWGSuccessResponse.cpp.

References m_message_isSet, and message.

30  {
31  message = nullptr;
32  m_message_isSet = false;
33 }

◆ SWGSuccessResponse() [2/2]

SWGSDRangel::SWGSuccessResponse::SWGSuccessResponse ( QString *  json)

Definition at line 25 of file SWGSuccessResponse.cpp.

References fromJson(), and init().

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

◆ ~SWGSuccessResponse()

SWGSDRangel::SWGSuccessResponse::~SWGSuccessResponse ( )
virtual

Definition at line 35 of file SWGSuccessResponse.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGSuccessResponse::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 68 of file SWGSuccessResponse.cpp.

References asJsonObject().

Referenced by WebAPIRequestMapper::devicesetChannelIndexService(), WebAPIRequestMapper::devicesetChannelService(), WebAPIRequestMapper::devicesetFocusService(), WebAPIRequestMapper::instanceAMBEDevicesService(), WebAPIRequestMapper::instanceAudioInputCleanupService(), WebAPIRequestMapper::instanceAudioOutputCleanupService(), WebAPIRequestMapper::instanceDeviceSetService(), and WebAPIRequestMapper::instanceSummaryService().

69 {
70  QJsonObject* obj = this->asJsonObject();
71 
72  QJsonDocument doc(*obj);
73  QByteArray bytes = doc.toJson();
74  delete obj;
75  return QString(bytes);
76 }
virtual QJsonObject * asJsonObject() override
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 79 of file SWGSuccessResponse.cpp.

References message, and SWGSDRangel::toJsonValue().

Referenced by asJson().

79  {
80  QJsonObject* obj = new QJsonObject();
81  if(message != nullptr && *message != QString("")){
82  toJsonValue(QString("message"), message, obj, QString("QString"));
83  }
84 
85  return obj;
86 }
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::SWGSuccessResponse::cleanup ( )

Definition at line 46 of file SWGSuccessResponse.cpp.

References message.

Referenced by ~SWGSuccessResponse().

46  {
47  if(message != nullptr) {
48  delete message;
49  }
50 }
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 53 of file SWGSuccessResponse.cpp.

References fromJsonObject().

Referenced by SWGSuccessResponse().

53  {
54  QByteArray array (json.toStdString().c_str());
55  QJsonDocument doc = QJsonDocument::fromJson(array);
56  QJsonObject jsonObject = doc.object();
57  this->fromJsonObject(jsonObject);
58  return this;
59 }
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::SWGSuccessResponse::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 62 of file SWGSuccessResponse.cpp.

References message, and SWGSDRangel::setValue().

Referenced by fromJson().

62  {
63  ::SWGSDRangel::setValue(&message, pJson["message"], "QString", "QString");
64 
65 }
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:

◆ getMessage()

QString * SWGSDRangel::SWGSuccessResponse::getMessage ( )

◆ init()

void SWGSDRangel::SWGSuccessResponse::init ( )

◆ isSet()

bool SWGSDRangel::SWGSuccessResponse::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 100 of file SWGSuccessResponse.cpp.

References message.

100  {
101  bool isObjectUpdated = false;
102  do{
103  if(message != nullptr && *message != QString("")){ isObjectUpdated = true; break;}
104  }while(false);
105  return isObjectUpdated;
106 }

◆ setMessage()

void SWGSDRangel::SWGSuccessResponse::setMessage ( QString *  message)

Definition at line 93 of file SWGSuccessResponse.cpp.

References m_message_isSet, and message.

93  {
94  this->message = message;
95  this->m_message_isSet = true;
96 }

Member Data Documentation

◆ m_message_isSet

bool SWGSDRangel::SWGSuccessResponse::m_message_isSet
private

Definition at line 53 of file SWGSuccessResponse.h.

Referenced by init(), setMessage(), and SWGSuccessResponse().

◆ message

QString* SWGSDRangel::SWGSuccessResponse::message
private

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