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

#include <SWGDeviceState.h>

+ Inheritance diagram for SWGSDRangel::SWGDeviceState:
+ Collaboration diagram for SWGSDRangel::SWGDeviceState:

Public Member Functions

 SWGDeviceState ()
 
 SWGDeviceState (QString *json)
 
virtual ~SWGDeviceState ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGDeviceStatefromJson (QString &jsonString) override
 
QString * getState ()
 
void setState (QString *state)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

QString * state
 
bool m_state_isSet
 

Detailed Description

Definition at line 32 of file SWGDeviceState.h.

Constructor & Destructor Documentation

◆ SWGDeviceState() [1/2]

SWGSDRangel::SWGDeviceState::SWGDeviceState ( )

Definition at line 30 of file SWGDeviceState.cpp.

References m_state_isSet, and state.

30  {
31  state = nullptr;
32  m_state_isSet = false;
33 }

◆ SWGDeviceState() [2/2]

SWGSDRangel::SWGDeviceState::SWGDeviceState ( QString *  json)

Definition at line 25 of file SWGDeviceState.cpp.

References fromJson(), and init().

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

◆ ~SWGDeviceState()

SWGSDRangel::SWGDeviceState::~SWGDeviceState ( )
virtual

Definition at line 35 of file SWGDeviceState.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGDeviceState::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 68 of file SWGDeviceState.cpp.

References asJsonObject().

Referenced by WebAPIRequestMapper::devicesetDeviceRunService().

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::SWGDeviceState::asJsonObject ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 79 of file SWGDeviceState.cpp.

References state, and SWGSDRangel::toJsonValue().

Referenced by asJson().

79  {
80  QJsonObject* obj = new QJsonObject();
81  if(state != nullptr && *state != QString("")){
82  toJsonValue(QString("state"), state, 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::SWGDeviceState::cleanup ( )

Definition at line 46 of file SWGDeviceState.cpp.

References state.

Referenced by ~SWGDeviceState().

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

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 53 of file SWGDeviceState.cpp.

References fromJsonObject().

Referenced by SWGDeviceState().

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 62 of file SWGDeviceState.cpp.

References SWGSDRangel::setValue(), and state.

Referenced by fromJson().

62  {
63  ::SWGSDRangel::setValue(&state, pJson["state"], "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:

◆ getState()

QString * SWGSDRangel::SWGDeviceState::getState ( )

Definition at line 89 of file SWGDeviceState.cpp.

References state.

Referenced by PlutoSDROutput::webapiRun(), PlutoSDRInput::webapiRun(), Bladerf1Output::webapiRun(), HackRFOutput::webapiRun(), FCDProPlusInput::webapiRun(), TestSourceInput::webapiRun(), AirspyInput::webapiRun(), Bladerf1Input::webapiRun(), PerseusInput::webapiRun(), RTLSDRInput::webapiRun(), AirspyHFInput::webapiRun(), TestMI::webapiRun(), FCDProInput::webapiRun(), LocalOutput::webapiRun(), BladeRF2Output::webapiRun(), HackRFInput::webapiRun(), KiwiSDRInput::webapiRun(), LocalInput::webapiRun(), RemoteOutput::webapiRun(), SDRPlayInput::webapiRun(), SoapySDROutput::webapiRun(), BladeRF2Input::webapiRun(), FileSinkOutput::webapiRun(), SoapySDRInput::webapiRun(), XTRXOutput::webapiRun(), LimeSDROutput::webapiRun(), XTRXInput::webapiRun(), LimeSDRInput::webapiRun(), RemoteInput::webapiRun(), FileInput::webapiRun(), PlutoSDROutput::webapiRunGet(), PlutoSDRInput::webapiRunGet(), Bladerf1Output::webapiRunGet(), HackRFOutput::webapiRunGet(), FCDProPlusInput::webapiRunGet(), TestSourceInput::webapiRunGet(), AirspyInput::webapiRunGet(), Bladerf1Input::webapiRunGet(), PerseusInput::webapiRunGet(), RTLSDRInput::webapiRunGet(), AirspyHFInput::webapiRunGet(), TestMI::webapiRunGet(), FCDProInput::webapiRunGet(), LocalOutput::webapiRunGet(), BladeRF2Output::webapiRunGet(), HackRFInput::webapiRunGet(), KiwiSDRInput::webapiRunGet(), LocalInput::webapiRunGet(), RemoteOutput::webapiRunGet(), SDRPlayInput::webapiRunGet(), SoapySDROutput::webapiRunGet(), BladeRF2Input::webapiRunGet(), FileSinkOutput::webapiRunGet(), SoapySDRInput::webapiRunGet(), XTRXOutput::webapiRunGet(), LimeSDROutput::webapiRunGet(), XTRXInput::webapiRunGet(), LimeSDRInput::webapiRunGet(), RemoteInput::webapiRunGet(), and FileInput::webapiRunGet().

89  {
90  return state;
91 }
+ Here is the caller graph for this function:

◆ init()

void SWGSDRangel::SWGDeviceState::init ( )

◆ isSet()

bool SWGSDRangel::SWGDeviceState::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 100 of file SWGDeviceState.cpp.

References state.

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

◆ setState()

void SWGSDRangel::SWGDeviceState::setState ( QString *  state)

Definition at line 93 of file SWGDeviceState.cpp.

References m_state_isSet, and state.

93  {
94  this->state = state;
95  this->m_state_isSet = true;
96 }

Member Data Documentation

◆ m_state_isSet

bool SWGSDRangel::SWGDeviceState::m_state_isSet
private

Definition at line 53 of file SWGDeviceState.h.

Referenced by init(), setState(), and SWGDeviceState().

◆ state

QString* SWGSDRangel::SWGDeviceState::state
private

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