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

#include <SWGCommand.h>

+ Inheritance diagram for SWGSDRangel::SWGCommand:
+ Collaboration diagram for SWGSDRangel::SWGCommand:

Public Member Functions

 SWGCommand ()
 
 SWGCommand (QString *json)
 
virtual ~SWGCommand ()
 
void init ()
 
void cleanup ()
 
virtual QString asJson () override
 
virtual QJsonObject * asJsonObject () override
 
virtual void fromJsonObject (QJsonObject &json) override
 
virtual SWGCommandfromJson (QString &jsonString) override
 
QString * getGroup ()
 
void setGroup (QString *group)
 
QString * getDescription ()
 
void setDescription (QString *description)
 
QString * getCommand ()
 
void setCommand (QString *command)
 
QString * getArgString ()
 
void setArgString (QString *arg_string)
 
qint32 getKey ()
 
void setKey (qint32 key)
 
qint32 getKeyModifiers ()
 
void setKeyModifiers (qint32 key_modifiers)
 
qint32 getAssociateKey ()
 
void setAssociateKey (qint32 associate_key)
 
qint32 getRelease ()
 
void setRelease (qint32 release)
 
virtual bool isSet () override
 
- Public Member Functions inherited from SWGSDRangel::SWGObject
virtual ~SWGObject ()
 

Private Attributes

QString * group
 
bool m_group_isSet
 
QString * description
 
bool m_description_isSet
 
QString * command
 
bool m_command_isSet
 
QString * arg_string
 
bool m_arg_string_isSet
 
qint32 key
 
bool m_key_isSet
 
qint32 key_modifiers
 
bool m_key_modifiers_isSet
 
qint32 associate_key
 
bool m_associate_key_isSet
 
qint32 release
 
bool m_release_isSet
 

Detailed Description

Definition at line 32 of file SWGCommand.h.

Constructor & Destructor Documentation

◆ SWGCommand() [1/2]

SWGSDRangel::SWGCommand::SWGCommand ( )

Definition at line 30 of file SWGCommand.cpp.

References arg_string, associate_key, command, description, group, key, key_modifiers, m_arg_string_isSet, m_associate_key_isSet, m_command_isSet, m_description_isSet, m_group_isSet, m_key_isSet, m_key_modifiers_isSet, m_release_isSet, and release.

30  {
31  group = nullptr;
32  m_group_isSet = false;
33  description = nullptr;
34  m_description_isSet = false;
35  command = nullptr;
36  m_command_isSet = false;
37  arg_string = nullptr;
38  m_arg_string_isSet = false;
39  key = 0;
40  m_key_isSet = false;
41  key_modifiers = 0;
42  m_key_modifiers_isSet = false;
43  associate_key = 0;
44  m_associate_key_isSet = false;
45  release = 0;
46  m_release_isSet = false;
47 }

◆ SWGCommand() [2/2]

SWGSDRangel::SWGCommand::SWGCommand ( QString *  json)

Definition at line 25 of file SWGCommand.cpp.

References fromJson(), and init().

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

◆ ~SWGCommand()

SWGSDRangel::SWGCommand::~SWGCommand ( )
virtual

Definition at line 49 of file SWGCommand.cpp.

References cleanup().

49  {
50  this->cleanup();
51 }
+ Here is the call graph for this function:

Member Function Documentation

◆ asJson()

QString SWGSDRangel::SWGCommand::asJson ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 123 of file SWGCommand.cpp.

References asJsonObject().

124 {
125  QJsonObject* obj = this->asJsonObject();
126 
127  QJsonDocument doc(*obj);
128  QByteArray bytes = doc.toJson();
129  delete obj;
130  return QString(bytes);
131 }
virtual QJsonObject * asJsonObject() override
Definition: SWGCommand.cpp:134
+ Here is the call graph for this function:

◆ asJsonObject()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 134 of file SWGCommand.cpp.

References arg_string, associate_key, command, description, group, key, key_modifiers, m_associate_key_isSet, m_key_isSet, m_key_modifiers_isSet, m_release_isSet, release, and SWGSDRangel::toJsonValue().

Referenced by asJson().

134  {
135  QJsonObject* obj = new QJsonObject();
136  if(group != nullptr && *group != QString("")){
137  toJsonValue(QString("group"), group, obj, QString("QString"));
138  }
139  if(description != nullptr && *description != QString("")){
140  toJsonValue(QString("description"), description, obj, QString("QString"));
141  }
142  if(command != nullptr && *command != QString("")){
143  toJsonValue(QString("command"), command, obj, QString("QString"));
144  }
145  if(arg_string != nullptr && *arg_string != QString("")){
146  toJsonValue(QString("argString"), arg_string, obj, QString("QString"));
147  }
148  if(m_key_isSet){
149  obj->insert("key", QJsonValue(key));
150  }
152  obj->insert("keyModifiers", QJsonValue(key_modifiers));
153  }
155  obj->insert("associateKey", QJsonValue(associate_key));
156  }
157  if(m_release_isSet){
158  obj->insert("release", QJsonValue(release));
159  }
160 
161  return obj;
162 }
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::SWGCommand::cleanup ( )

Definition at line 74 of file SWGCommand.cpp.

References arg_string, command, description, and group.

Referenced by ~SWGCommand().

74  {
75  if(group != nullptr) {
76  delete group;
77  }
78  if(description != nullptr) {
79  delete description;
80  }
81  if(command != nullptr) {
82  delete command;
83  }
84  if(arg_string != nullptr) {
85  delete arg_string;
86  }
87 
88 
89 
90 
91 }
+ Here is the caller graph for this function:

◆ fromJson()

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

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 94 of file SWGCommand.cpp.

References fromJsonObject().

Referenced by SWGCommand().

94  {
95  QByteArray array (json.toStdString().c_str());
96  QJsonDocument doc = QJsonDocument::fromJson(array);
97  QJsonObject jsonObject = doc.object();
98  this->fromJsonObject(jsonObject);
99  return this;
100 }
virtual void fromJsonObject(QJsonObject &json) override
Definition: SWGCommand.cpp:103
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fromJsonObject()

void SWGSDRangel::SWGCommand::fromJsonObject ( QJsonObject &  json)
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 103 of file SWGCommand.cpp.

References arg_string, associate_key, command, description, group, key, key_modifiers, release, and SWGSDRangel::setValue().

Referenced by fromJson().

103  {
104  ::SWGSDRangel::setValue(&group, pJson["group"], "QString", "QString");
105 
106  ::SWGSDRangel::setValue(&description, pJson["description"], "QString", "QString");
107 
108  ::SWGSDRangel::setValue(&command, pJson["command"], "QString", "QString");
109 
110  ::SWGSDRangel::setValue(&arg_string, pJson["argString"], "QString", "QString");
111 
112  ::SWGSDRangel::setValue(&key, pJson["key"], "qint32", "");
113 
114  ::SWGSDRangel::setValue(&key_modifiers, pJson["keyModifiers"], "qint32", "");
115 
116  ::SWGSDRangel::setValue(&associate_key, pJson["associateKey"], "qint32", "");
117 
118  ::SWGSDRangel::setValue(&release, pJson["release"], "qint32", "");
119 
120 }
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:

◆ getArgString()

QString * SWGSDRangel::SWGCommand::getArgString ( )

Definition at line 195 of file SWGCommand.cpp.

References arg_string.

195  {
196  return arg_string;
197 }

◆ getAssociateKey()

qint32 SWGSDRangel::SWGCommand::getAssociateKey ( )

Definition at line 225 of file SWGCommand.cpp.

References associate_key.

225  {
226  return associate_key;
227 }

◆ getCommand()

QString * SWGSDRangel::SWGCommand::getCommand ( )

Definition at line 185 of file SWGCommand.cpp.

References command.

185  {
186  return command;
187 }

◆ getDescription()

QString * SWGSDRangel::SWGCommand::getDescription ( )

Definition at line 175 of file SWGCommand.cpp.

References description.

175  {
176  return description;
177 }

◆ getGroup()

QString * SWGSDRangel::SWGCommand::getGroup ( )

Definition at line 165 of file SWGCommand.cpp.

References group.

165  {
166  return group;
167 }

◆ getKey()

qint32 SWGSDRangel::SWGCommand::getKey ( )

Definition at line 205 of file SWGCommand.cpp.

References key.

205  {
206  return key;
207 }

◆ getKeyModifiers()

qint32 SWGSDRangel::SWGCommand::getKeyModifiers ( )

Definition at line 215 of file SWGCommand.cpp.

References key_modifiers.

215  {
216  return key_modifiers;
217 }

◆ getRelease()

qint32 SWGSDRangel::SWGCommand::getRelease ( )

Definition at line 235 of file SWGCommand.cpp.

References release.

235  {
236  return release;
237 }

◆ init()

void SWGSDRangel::SWGCommand::init ( )

Definition at line 54 of file SWGCommand.cpp.

References arg_string, associate_key, command, description, group, key, key_modifiers, m_arg_string_isSet, m_associate_key_isSet, m_command_isSet, m_description_isSet, m_group_isSet, m_key_isSet, m_key_modifiers_isSet, m_release_isSet, and release.

Referenced by SWGCommand().

54  {
55  group = new QString("");
56  m_group_isSet = false;
57  description = new QString("");
58  m_description_isSet = false;
59  command = new QString("");
60  m_command_isSet = false;
61  arg_string = new QString("");
62  m_arg_string_isSet = false;
63  key = 0;
64  m_key_isSet = false;
65  key_modifiers = 0;
66  m_key_modifiers_isSet = false;
67  associate_key = 0;
68  m_associate_key_isSet = false;
69  release = 0;
70  m_release_isSet = false;
71 }
+ Here is the caller graph for this function:

◆ isSet()

bool SWGSDRangel::SWGCommand::isSet ( )
overridevirtual

Reimplemented from SWGSDRangel::SWGObject.

Definition at line 246 of file SWGCommand.cpp.

References arg_string, command, description, group, m_associate_key_isSet, m_key_isSet, m_key_modifiers_isSet, and m_release_isSet.

246  {
247  bool isObjectUpdated = false;
248  do{
249  if(group != nullptr && *group != QString("")){ isObjectUpdated = true; break;}
250  if(description != nullptr && *description != QString("")){ isObjectUpdated = true; break;}
251  if(command != nullptr && *command != QString("")){ isObjectUpdated = true; break;}
252  if(arg_string != nullptr && *arg_string != QString("")){ isObjectUpdated = true; break;}
253  if(m_key_isSet){ isObjectUpdated = true; break;}
254  if(m_key_modifiers_isSet){ isObjectUpdated = true; break;}
255  if(m_associate_key_isSet){ isObjectUpdated = true; break;}
256  if(m_release_isSet){ isObjectUpdated = true; break;}
257  }while(false);
258  return isObjectUpdated;
259 }

◆ setArgString()

void SWGSDRangel::SWGCommand::setArgString ( QString *  arg_string)

Definition at line 199 of file SWGCommand.cpp.

References arg_string, and m_arg_string_isSet.

199  {
200  this->arg_string = arg_string;
201  this->m_arg_string_isSet = true;
202 }

◆ setAssociateKey()

void SWGSDRangel::SWGCommand::setAssociateKey ( qint32  associate_key)

Definition at line 229 of file SWGCommand.cpp.

References associate_key, and m_associate_key_isSet.

229  {
231  this->m_associate_key_isSet = true;
232 }

◆ setCommand()

void SWGSDRangel::SWGCommand::setCommand ( QString *  command)

Definition at line 189 of file SWGCommand.cpp.

References command, and m_command_isSet.

189  {
190  this->command = command;
191  this->m_command_isSet = true;
192 }

◆ setDescription()

void SWGSDRangel::SWGCommand::setDescription ( QString *  description)

Definition at line 179 of file SWGCommand.cpp.

References description, and m_description_isSet.

179  {
180  this->description = description;
181  this->m_description_isSet = true;
182 }

◆ setGroup()

void SWGSDRangel::SWGCommand::setGroup ( QString *  group)

Definition at line 169 of file SWGCommand.cpp.

References group, and m_group_isSet.

169  {
170  this->group = group;
171  this->m_group_isSet = true;
172 }

◆ setKey()

void SWGSDRangel::SWGCommand::setKey ( qint32  key)

Definition at line 209 of file SWGCommand.cpp.

References key, and m_key_isSet.

209  {
210  this->key = key;
211  this->m_key_isSet = true;
212 }

◆ setKeyModifiers()

void SWGSDRangel::SWGCommand::setKeyModifiers ( qint32  key_modifiers)

Definition at line 219 of file SWGCommand.cpp.

References key_modifiers, and m_key_modifiers_isSet.

219  {
221  this->m_key_modifiers_isSet = true;
222 }

◆ setRelease()

void SWGSDRangel::SWGCommand::setRelease ( qint32  release)

Definition at line 239 of file SWGCommand.cpp.

References m_release_isSet, and release.

239  {
240  this->release = release;
241  this->m_release_isSet = true;
242 }

Member Data Documentation

◆ arg_string

QString* SWGSDRangel::SWGCommand::arg_string
private

◆ associate_key

qint32 SWGSDRangel::SWGCommand::associate_key
private

◆ command

QString* SWGSDRangel::SWGCommand::command
private

◆ description

QString* SWGSDRangel::SWGCommand::description
private

◆ group

QString* SWGSDRangel::SWGCommand::group
private

◆ key

qint32 SWGSDRangel::SWGCommand::key
private

Definition at line 85 of file SWGCommand.h.

Referenced by asJsonObject(), fromJsonObject(), getKey(), init(), setKey(), and SWGCommand().

◆ key_modifiers

qint32 SWGSDRangel::SWGCommand::key_modifiers
private

◆ m_arg_string_isSet

bool SWGSDRangel::SWGCommand::m_arg_string_isSet
private

Definition at line 83 of file SWGCommand.h.

Referenced by init(), setArgString(), and SWGCommand().

◆ m_associate_key_isSet

bool SWGSDRangel::SWGCommand::m_associate_key_isSet
private

Definition at line 92 of file SWGCommand.h.

Referenced by asJsonObject(), init(), isSet(), setAssociateKey(), and SWGCommand().

◆ m_command_isSet

bool SWGSDRangel::SWGCommand::m_command_isSet
private

Definition at line 80 of file SWGCommand.h.

Referenced by init(), setCommand(), and SWGCommand().

◆ m_description_isSet

bool SWGSDRangel::SWGCommand::m_description_isSet
private

Definition at line 77 of file SWGCommand.h.

Referenced by init(), setDescription(), and SWGCommand().

◆ m_group_isSet

bool SWGSDRangel::SWGCommand::m_group_isSet
private

Definition at line 74 of file SWGCommand.h.

Referenced by init(), setGroup(), and SWGCommand().

◆ m_key_isSet

bool SWGSDRangel::SWGCommand::m_key_isSet
private

Definition at line 86 of file SWGCommand.h.

Referenced by asJsonObject(), init(), isSet(), setKey(), and SWGCommand().

◆ m_key_modifiers_isSet

bool SWGSDRangel::SWGCommand::m_key_modifiers_isSet
private

Definition at line 89 of file SWGCommand.h.

Referenced by asJsonObject(), init(), isSet(), setKeyModifiers(), and SWGCommand().

◆ m_release_isSet

bool SWGSDRangel::SWGCommand::m_release_isSet
private

Definition at line 95 of file SWGCommand.h.

Referenced by asJsonObject(), init(), isSet(), setRelease(), and SWGCommand().

◆ release

qint32 SWGSDRangel::SWGCommand::release
private

Definition at line 94 of file SWGCommand.h.

Referenced by asJsonObject(), fromJsonObject(), getRelease(), init(), setRelease(), and SWGCommand().


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