MNE-CPP  beta 1.0
rawcommand.h
Go to the documentation of this file.
1 //=============================================================================================================
36 #ifndef RAWCOMMAND_H
37 #define RAWCOMMAND_H
38 
39 //*************************************************************************************************************
40 //=============================================================================================================
41 // INCLUDES
42 //=============================================================================================================
43 
44 #include "rtcommand_global.h"
45 
47 
48 
49 //*************************************************************************************************************
50 //=============================================================================================================
51 // Qt INCLUDES
52 //=============================================================================================================
53 
54 #include <QObject>
55 #include <QList>
56 #include <QVariant>
57 
58 
59 //*************************************************************************************************************
60 //=============================================================================================================
61 // DEFINE NAMESPACE RTCOMMANDLIB
62 //=============================================================================================================
63 
64 namespace RTCOMMANDLIB
65 {
66 
67 //=============================================================================================================
73 class RTCOMMANDSHARED_EXPORT RawCommand : public QObject, public ICommand
74 {
75 Q_OBJECT
76 public:
77 
78  //=========================================================================================================
84  explicit RawCommand(QObject *parent = 0);
85 
86  //=========================================================================================================
94  explicit RawCommand(const QString &p_sCommand, bool p_bIsJson = true, QObject *parent = 0);
95 
96 
97  //=========================================================================================================
103  explicit RawCommand(const RawCommand &p_rawCommand);
104 
105  //=========================================================================================================
111  inline QString command() const;
112 
113  //=========================================================================================================
119  inline quint32 count() const;
120 
121  virtual void execute();
122 
123  //=========================================================================================================
129  inline bool isJson() const;
130 
131  //=========================================================================================================
137  inline QList<QString>& pValues();
138 
139  //=========================================================================================================
145  RawCommand& operator= (const RawCommand &rhs);
146 
147 signals:
148  //=========================================================================================================
154  void executed(QList<QString> p_qListParameters);
155 
156 private:
157  QString m_sCommand;
158  bool m_bIsJson;
159 
160  QList<QString> m_qListRawParameters;
162 };
163 
164 //*************************************************************************************************************
165 //=============================================================================================================
166 // DEFINE MEMBER METHODS
167 //=============================================================================================================
168 
169 QString RawCommand::command() const
170 {
171  return m_sCommand;
172 }
173 
174 
175 //*************************************************************************************************************
176 
177 quint32 RawCommand::count() const
178 {
179  return m_qListRawParameters.size();
180 }
181 
182 
183 //*************************************************************************************************************
184 
185 bool RawCommand::isJson() const
186 {
187  return m_bIsJson;
188 }
189 
190 
191 //*************************************************************************************************************
192 
193 QList<QString>& RawCommand::pValues()
194 {
195  return m_qListRawParameters;
196 }
197 
198 } // NAMESPACE
199 
200 #endif // RAWCOMMAND_H
QString command() const
Definition: rawcommand.h:169
quint32 count() const
Definition: rawcommand.h:177
bool isJson() const
Definition: rawcommand.h:185
#define RTCOMMANDSHARED_EXPORT
Contains declarations of the command design pattern: ICommand interface.
QList< QString > & pValues()
Definition: rawcommand.h:193
RtCommand library export/import macros.
The ICommand interface provides the base class of every command of the command design pattern...