v2.0.0
Loading...
Searching...
No Matches
raw_command.h
Go to the documentation of this file.
1//=============================================================================================================
33
34#ifndef RAWCOMMAND_H
35#define RAWCOMMAND_H
36
37//=============================================================================================================
38// INCLUDES
39//=============================================================================================================
40
41#include "../com_global.h"
42
44
45//=============================================================================================================
46// QT INCLUDES
47//=============================================================================================================
48
49#include <QObject>
50#include <QList>
51#include <QVariant>
52
53//=============================================================================================================
54// DEFINE NAMESPACE COMLIB
55//=============================================================================================================
56
57namespace COMLIB
58{
59
60//=============================================================================================================
70class COMSHARED_EXPORT RawCommand : public QObject, public UTILSLIB::ICommand
71{
72Q_OBJECT
73
74public:
75
76 //=========================================================================================================
82 explicit RawCommand(QObject *parent = 0);
83
84 //=========================================================================================================
92 explicit RawCommand(const QString &p_sCommand, bool p_bIsJson = true, QObject *parent = 0);
93
94 //=========================================================================================================
100 explicit RawCommand(const RawCommand &p_rawCommand);
101
102 //=========================================================================================================
108 inline QString command() const;
109
110 //=========================================================================================================
116 inline quint32 count() const;
117
118 virtual void execute();
119
120 //=========================================================================================================
126 inline bool isJson() const;
127
128 //=========================================================================================================
134 inline QList<QString>& pValues();
135
136 //=========================================================================================================
142 RawCommand& operator= (const RawCommand &rhs);
143
144signals:
145 //=========================================================================================================
151 void executed(QList<QString> p_qListParameters);
152
153private:
154 QString m_sCommand;
155 bool m_bIsJson;
156
157 QList<QString> m_qListRawParameters;
158};
159
160//=============================================================================================================
161// DEFINE MEMBER METHODS
162//=============================================================================================================
163
164QString RawCommand::command() const
165{
166 return m_sCommand;
167}
168
169//=============================================================================================================
170
171quint32 RawCommand::count() const
172{
173 return m_qListRawParameters.size();
174}
175
176//=============================================================================================================
177
179{
180 return m_bIsJson;
181}
182
183//=============================================================================================================
184
185QList<QString>& RawCommand::pValues()
186{
187 return m_qListRawParameters;
188}
189} // NAMESPACE
190
191#endif // RAWCOMMAND_H
Export macros, build-info entry points and namespace anchor for the COMLIB communication library.
#define COMSHARED_EXPORT
Definition com_global.h:53
Minimal ICommand interface for the GoF command pattern, used by the MNE Scan plugin runtime.
Real-time client/server communication primitives for talking to mne_rt_server.
void executed(QList< QString > p_qListParameters)
bool isJson() const
RawCommand(QObject *parent=0)
QString command() const
QList< QString > & pValues()
virtual void execute()
quint32 count() const
The ICommand interface provides the base class of every command of the command design pattern.