v2.0.0
Loading...
Searching...
No Matches
COMMUNICATIONLIB::CommandParser Class Reference

#include <commandparser.h>

Signals

void response (QString p_sResponse, Command p_command)

Public Member Functions

 CommandParser (QObject *parent=0)
bool exists (const QString &p_sCommand)
bool parse (const QString &p_sInput, QStringList &p_qListCommandsParsed)
RawCommandgetRawCommand ()
Public Member Functions inherited from UTILSLIB::Subject
virtual ~Subject ()
void attach (IObserver *pObserver)
void detach (IObserver *pObserver)
void notify ()
t_Observersobservers ()
int observerNumDebug ()

Additional Inherited Members

Public Types inherited from UTILSLIB::Subject
typedef QSharedPointer< SubjectSPtr
typedef QSharedPointer< const SubjectConstSPtr
typedef QSet< IObserver * > t_Observers
Static Public Attributes inherited from UTILSLIB::Subject
static bool notifyEnabled = true
Protected Member Functions inherited from UTILSLIB::Subject
 Subject ()

Detailed Description

Definition at line 65 of file commandparser.h.

Inheritance diagram for COMMUNICATIONLIB::CommandParser:
Inheritance graph

Constructor & Destructor Documentation

◆ CommandParser()

CommandParser::CommandParser ( QObject * parent = 0)
explicit

Default constructor

Parameters
[in]parentParent QObject (optional).

Definition at line 63 of file commandparser.cpp.

Member Function Documentation

◆ exists()

bool CommandParser::exists ( const QString & p_sCommand)

Checks if a command exists

Parameters
[in]p_sCommandCommand to check.
Returns
true if command exists, false otherwise.

Definition at line 70 of file commandparser.cpp.

◆ getRawCommand()

RawCommand & COMMUNICATIONLIB::CommandParser::getRawCommand ( )
inline

Returns the stored RawCommand

Returns
the stored RawCommand.

Definition at line 124 of file commandparser.h.

◆ parse()

bool CommandParser::parse ( const QString & p_sInput,
QStringList & p_qListCommandsParsed )

Parses a CLI command or JSON command (list) and notifies all attached observers (command managers)

Parameters
[in]p_sInputInput to parse.
[out]p_qListCommandsParsedList of parsed commands.

Definition at line 84 of file commandparser.cpp.

◆ response

void COMMUNICATIONLIB::CommandParser::response ( QString p_sResponse,
Command p_command )
signal

Response channel which is used by attached observers (command managers) to send data back to subject

Parameters
[in]p_sResponseObserver response/data.
[in]p_commandCommand which send the response

The documentation for this class was generated from the following files: