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{
72 Q_OBJECT
73
74public:
75 //=========================================================================================================
81 explicit RawCommand(QObject* parent = 0);
82
83 //=========================================================================================================
91 explicit RawCommand(const QString& p_sCommand, bool p_bIsJson = true, QObject* parent = 0);
92
93 //=========================================================================================================
99 explicit RawCommand(const RawCommand& p_rawCommand);
100
101 //=========================================================================================================
107 inline QString command() const;
108
109 //=========================================================================================================
115 inline quint32 count() const;
116
117 virtual void execute();
118
119 //=========================================================================================================
125 inline bool isJson() const;
126
127 //=========================================================================================================
133 inline QList<QString>& pValues();
134
135 //=========================================================================================================
143 RawCommand& operator=(const RawCommand& rhs);
144
145signals:
146 //=========================================================================================================
152 void executed(QList<QString> p_qListParameters);
153
154private:
155 QString m_sCommand;
156 bool m_bIsJson;
157
158 QList<QString> m_qListRawParameters;
159};
160
161//=============================================================================================================
162// DEFINE MEMBER METHODS
163//=============================================================================================================
164
165QString RawCommand::command() const
166{
167 return m_sCommand;
168}
169
170//=============================================================================================================
171
172quint32 RawCommand::count() const
173{
174 return m_qListRawParameters.size();
175}
176
177//=============================================================================================================
178
180{
181 return m_bIsJson;
182}
183
184//=============================================================================================================
185
186QList<QString>& RawCommand::pValues()
187{
188 return m_qListRawParameters;
189}
190} // NAMESPACE
191
192#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)
RawCommand & operator=(const RawCommand &rhs)
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.