44 #include "../communication_global.h"
56 #include <QJsonObject>
57 #include <QSharedPointer>
60 #include <QStringList>
66 namespace COMMUNICATIONLIB
69 static QVariant defaultVariant;
82 typedef QSharedPointer<Command> SPtr;
83 typedef QSharedPointer<const Command> ConstSPtr;
92 explicit Command(
bool p_bIsJson =
true, QObject *parent = 0);
103 explicit Command(
const QString &p_sCommand,
const QJsonObject &p_qCommandContent,
bool p_bIsJson =
true, QObject *parent = 0);
114 explicit Command(
const QString &p_sCommand,
const QString &p_sDescription,
bool p_bIsJson =
true, QObject *parent = 0);
127 explicit Command(
const QString &p_sCommand,
const QString &p_sDescription,
128 const QStringList &p_qListParamNames,
const QList<QVariant> &p_qListParamValues,
bool p_bIsJson =
true, QObject *parent = 0);
140 explicit Command(
const QString &p_sCommand,
const QString &p_sDescription,
141 const QStringList &p_qListParamNames,
const QList<QVariant> &p_qListParamValues,
const QStringList &p_vecParameterDescriptions,
bool p_bIsJson =
true, QObject *parent = 0);
163 inline QString command()
const;
171 inline quint32 count()
const;
179 inline QString description()
const;
187 virtual void execute();
195 inline bool& isJson();
203 inline QList<QString> pDescriptions()
const;
211 inline QList<QString> pNames()
const;
219 inline QList<QVariant>& pValues();
227 void reply(
const QString &p_sReply);
241 QJsonObject toJsonObject()
const;
249 QStringList toStringList()
const;
257 QString toStringReadySend()
const;
275 QVariant& operator[] (
const QString &key);
285 QVariant& operator[] (qint32 idx);
295 const QVariant operator[] (
const QString &key)
const;
304 void executed(
Command p_command);
308 QString m_sDescription;
309 QStringList m_qListParamNames;
310 QList<QVariant> m_qListParamValues;
311 QStringList m_qListParamDescriptions;
328 return m_qListParamValues.size();
335 return m_sDescription;
349 return m_qListParamDescriptions;
356 return m_qListParamNames;
363 return m_qListParamValues;