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

#include <SWGLocationInformation.h>

+ Inheritance diagram for SWGSDRangel::SWGLocationInformation:
+ Collaboration diagram for SWGSDRangel::SWGLocationInformation:

Public Member Functions

 SWGLocationInformation ()
 
 SWGLocationInformation (QString *json)
 
virtual ~SWGLocationInformation ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGLocationInformationfromJson (QString &jsonString) override
 
float getLatitude ()
 
void setLatitude (float latitude)
 
float getLongitude ()
 
void setLongitude (float longitude)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

float latitude
 
bool m_latitude_isSet
 
float longitude
 
bool m_longitude_isSet
 

Detailed Description

Definition at line 31 of file SWGLocationInformation.h.

Constructor & Destructor Documentation

◆ SWGLocationInformation() [1/2]

SWGSDRangel::SWGLocationInformation::SWGLocationInformation ( )

◆ SWGLocationInformation() [2/2]

SWGSDRangel::SWGLocationInformation::SWGLocationInformation ( QString *  json)

Definition at line 25 of file SWGLocationInformation.cpp.

References fromJson(), and init().

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

◆ ~SWGLocationInformation()

SWGSDRangel::SWGLocationInformation::~SWGLocationInformation ( )
virtual

Definition at line 37 of file SWGLocationInformation.cpp.

References cleanup().

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

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGLocationInformation::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 73 of file SWGLocationInformation.cpp.

References asJsonObject().

Referenced by SWGSDRangel::SWGInstanceApi::instanceLocationPut(), and WebAPIRequestMapper::instanceLocationService().

74 {
75  QJsonObject* obj = this->asJsonObject();
76 
77  QJsonDocument doc(*obj);
78  QByteArray bytes = doc.toJson();
79  delete obj;
80  return QString(bytes);
81 }
virtual QJsonObject * asJsonObject() override
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 84 of file SWGLocationInformation.cpp.

References latitude, longitude, m_latitude_isSet, and m_longitude_isSet.

Referenced by asJson().

84  {
85  QJsonObject* obj = new QJsonObject();
86  if(m_latitude_isSet){
87  obj->insert("latitude", QJsonValue(latitude));
88  }
90  obj->insert("longitude", QJsonValue(longitude));
91  }
92 
93  return obj;
94 }
+ Here is the caller graph for this function:

◆ cleanup()

void SWGSDRangel::SWGLocationInformation::cleanup ( )

Definition at line 50 of file SWGLocationInformation.cpp.

Referenced by ~SWGLocationInformation().

50  {
51 
52 
53 }
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 56 of file SWGLocationInformation.cpp.

References fromJsonObject().

Referenced by WebAPIRequestMapper::instanceLocationService(), and SWGLocationInformation().

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 65 of file SWGLocationInformation.cpp.

References latitude, longitude, and SWGSDRangel::setValue().

Referenced by fromJson().

65  {
66  ::SWGSDRangel::setValue(&latitude, pJson["latitude"], "float", "");
67 
68  ::SWGSDRangel::setValue(&longitude, pJson["longitude"], "float", "");
69 
70 }
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:

◆ getLatitude()

float SWGSDRangel::SWGLocationInformation::getLatitude ( )

Definition at line 97 of file SWGLocationInformation.cpp.

References latitude.

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

97  {
98  return latitude;
99 }
+ Here is the caller graph for this function:

◆ getLongitude()

float SWGSDRangel::SWGLocationInformation::getLongitude ( )

Definition at line 107 of file SWGLocationInformation.cpp.

References longitude.

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

107  {
108  return longitude;
109 }
+ Here is the caller graph for this function:

◆ init()

void SWGSDRangel::SWGLocationInformation::init ( )

◆ isSet()

bool SWGSDRangel::SWGLocationInformation::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 118 of file SWGLocationInformation.cpp.

References m_latitude_isSet, and m_longitude_isSet.

118  {
119  bool isObjectUpdated = false;
120  do{
121  if(m_latitude_isSet){ isObjectUpdated = true; break;}
122  if(m_longitude_isSet){ isObjectUpdated = true; break;}
123  }while(false);
124  return isObjectUpdated;
125 }

◆ setLatitude()

void SWGSDRangel::SWGLocationInformation::setLatitude ( float  latitude)

◆ setLongitude()

void SWGSDRangel::SWGLocationInformation::setLongitude ( float  longitude)

Member Data Documentation

◆ latitude

float SWGSDRangel::SWGLocationInformation::latitude
private

◆ longitude

float SWGSDRangel::SWGLocationInformation::longitude
private

◆ m_latitude_isSet

bool SWGSDRangel::SWGLocationInformation::m_latitude_isSet
private

◆ m_longitude_isSet

bool SWGSDRangel::SWGLocationInformation::m_longitude_isSet
private

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