1 #ifndef COMMUNICATIONMANAGER_H
2 #define COMMUNICATIONMANAGER_H
8 #include "../communication_global.h"
19 #include <QJsonDocument>
25 namespace COMMUNICATIONLIB
41 explicit CommandManager(
bool p_bIsActive =
true, QObject *parent = 0);
43 explicit CommandManager(
const QByteArray &p_qByteArrayJsonDoc,
bool p_bIsActive =
true, QObject *parent = 0);
45 explicit CommandManager(
const QJsonDocument &p_jsonDoc,
bool p_bIsActive =
true, QObject *parent = 0);
61 inline QMap<QString, Command>& commandMap();
71 inline bool hasCommand(
const QString &p_sCommand)
const;
80 void insert(
const QJsonDocument &p_jsonDocument);
89 void insert(
const QString &p_sKey,
const QString &p_sDescription);
98 void insert(
const QString &p_sKey,
const Command &p_command);
106 inline bool isActive()
const;
114 inline void setStatus(
bool status);
132 Command& operator[] (
const QString &key);
142 const Command operator[] (
const QString &key)
const;
153 QJsonDocument m_jsonDocumentOrigin;
155 QMetaObject::Connection m_conReplyChannel;
157 QMap<QString, Command> m_qMapCommands;
160 void commandMapChanged();
168 void triggered(
Command p_command);
177 void response(QString p_sReply,
Command p_command);
186 return m_qMapCommands;
193 return m_qMapCommands.contains(p_sCommand);
207 m_bIsActive = status;
211 #endif // COMMUNICATIONMANAGER_H