v2.0.0
Loading...
Searching...
No Matches
command_parser.h
Go to the documentation of this file.
1//=============================================================================================================
35
36#ifndef COMMANDPARSER_H
37#define COMMANDPARSER_H
38
39//=============================================================================================================
40// INCLUDES
41//=============================================================================================================
42
43#include "../com_global.h"
44#include "raw_command.h"
45#include "command.h"
46
48
49//=============================================================================================================
50// QT INCLUDES
51//=============================================================================================================
52
53#include <QObject>
54#include <QVector>
55#include <QMultiMap>
56
57//=============================================================================================================
58// DEFINE NAMESPACE COMLIB
59//=============================================================================================================
60
61namespace COMLIB
62{
63
64//=============================================================================================================
74class COMSHARED_EXPORT CommandParser : public QObject, public UTILSLIB::Subject
75{
76 Q_OBJECT
77
78public:
79
80 //=========================================================================================================
86 explicit CommandParser(QObject *parent = 0);
87
88 //=========================================================================================================
96 bool exists(const QString& p_sCommand);
97
98 //=========================================================================================================
105 bool parse(const QString &p_sInput, QStringList &p_qListCommandsParsed);
106
107 //=========================================================================================================
113 inline RawCommand& getRawCommand();
114
115signals:
116 //=========================================================================================================
123 void response(QString p_sResponse, Command p_command);
124
125private:
126 RawCommand m_rawCommand;
127};
128
129//=============================================================================================================
130// INLINE DEFINITIONS
131//=============================================================================================================
132
134{
135 return m_rawCommand;
136}
137} // NAMESPACE
138
139#endif // COMMANDPARSER_H
Export macros, build-info entry points and namespace anchor for the COMLIB communication library.
#define COMSHARED_EXPORT
Definition com_global.h:53
Untyped intermediate produced by COMLIB::CommandParser before type information is bound to parameters...
Typed, parameter-bearing command object that round-trips between mne-cpp clients and mne_rt_server.
Classical GoF observer pattern (Subject + IObserver) used by MNE-CPP's non-QObject model classes.
Real-time client/server communication primitives for talking to mne_rt_server.
Named, parameterised command exchanged with mne_rt_server; supports both JSON and CLI serialisation.
Definition command.h:87
RawCommand & getRawCommand()
bool exists(const QString &p_sCommand)
void response(QString p_sResponse, Command p_command)
CommandParser(QObject *parent=0)
bool parse(const QString &p_sInput, QStringList &p_qListCommandsParsed)
Tokenised but unresolved command: a keyword plus a list of raw string arguments awaiting type binding...
Definition raw_command.h:71
The Subject class provides the base class of every subject of the observer design pattern.