Command.
More...
#include <command.h>
|
| Command (bool p_bIsJson=true, QObject *parent=0) |
|
| Command (const QString &p_sCommand, const QJsonObject &p_qCommandContent, bool p_bIsJson=true, QObject *parent=0) |
|
| Command (const QString &p_sCommand, const QString &p_sDescription, bool p_bIsJson=true, QObject *parent=0) |
|
| Command (const QString &p_sCommand, const QString &p_sDescription, const QStringList &p_qListParamNames, const QList< QVariant > &p_qListParamValues, bool p_bIsJson=true, QObject *parent=0) |
|
| Command (const QString &p_sCommand, const QString &p_sDescription, const QStringList &p_qListParamNames, const QList< QVariant > &p_qListParamValues, const QStringList &p_vecParameterDescriptions, bool p_bIsJson=true, QObject *parent=0) |
|
| Command (const Command &p_Command) |
|
virtual | ~Command () |
|
QString | command () const |
|
quint32 | count () const |
|
QString | description () const |
|
virtual void | execute () |
|
bool & | isJson () |
|
QList< QString > | pDescriptions () const |
|
QList< QString > | pNames () const |
|
QList< QVariant > & | pValues () |
|
void | reply (const QString &p_sReply) |
|
void | send () |
|
QJsonObject | toJsonObject () const |
|
QStringList | toStringList () const |
|
QString | toStringReadySend () const |
|
Command & | operator= (const Command &rhs) |
|
QVariant & | operator[] (const QString &key) |
|
QVariant & | operator[] (qint32 idx) |
|
const QVariant | operator[] (const QString &key) const |
|
virtual | ~ICommand () |
|
|
QString | m_sCommand |
|
QString | m_sDescription |
|
QStringList | m_qListParamNames |
|
QList< QVariant > | m_qListParamValues |
|
QStringList | m_qListParamDescriptions |
|
bool | m_bIsJson |
|
Command.
Command, which includes beside command name also command parameters
Definition at line 77 of file command.h.
◆ Command() [1/6]
Command::Command |
( |
bool |
p_bIsJson = true , |
|
|
QObject * |
parent = 0 |
|
) |
| |
|
explicit |
Constructs a Command
- Parameters
-
[in] | p_bIsJson | If is received/should be send as JSON (optional, default true). |
[in] | parent | Parent QObject (optional). |
Definition at line 27 of file command.cpp.
◆ Command() [2/6]
Command::Command |
( |
const QString & |
p_sCommand, |
|
|
const QJsonObject & |
p_qCommandContent, |
|
|
bool |
p_bIsJson = true , |
|
|
QObject * |
parent = 0 |
|
) |
| |
|
explicit |
Constructor which parses a command stored in a json object
- Parameters
-
[in] | p_sCommand | Command. |
[in] | p_qCommandContent | Content encapsulated in a JsonObject. |
[in] | p_bIsJson | If is received/should be send as JSON (optional, default true). |
[in] | parent | Parent QObject (optional). |
Definition at line 37 of file command.cpp.
◆ Command() [3/6]
Command::Command |
( |
const QString & |
p_sCommand, |
|
|
const QString & |
p_sDescription, |
|
|
bool |
p_bIsJson = true , |
|
|
QObject * |
parent = 0 |
|
) |
| |
|
explicit |
Constructs a command without parameters
- Parameters
-
[in] | p_sCommand | Command. |
[in] | p_sDescription | Command description. |
[in] | p_bIsJson | If is received/should be send as JSON (optional, default true). |
[in] | parent | Parent QObject (optional). |
Definition at line 61 of file command.cpp.
◆ Command() [4/6]
Command::Command |
( |
const QString & |
p_sCommand, |
|
|
const QString & |
p_sDescription, |
|
|
const QStringList & |
p_qListParamNames, |
|
|
const QList< QVariant > & |
p_qListParamValues, |
|
|
bool |
p_bIsJson = true , |
|
|
QObject * |
parent = 0 |
|
) |
| |
|
explicit |
Constructor which assembles a command from single parts
- Parameters
-
[in] | p_sCommand | Command. |
[in] | p_sDescription | Command description. |
[in] | p_qListParamNames | Parameter names. |
[in] | p_qListParamValues | Parameter values/types. |
[in] | p_bIsJson | If is received/should be send as JSON (optional, default true). |
[in] | parent | Parent QObject (optional). |
Definition at line 71 of file command.cpp.
◆ Command() [5/6]
Command::Command |
( |
const QString & |
p_sCommand, |
|
|
const QString & |
p_sDescription, |
|
|
const QStringList & |
p_qListParamNames, |
|
|
const QList< QVariant > & |
p_qListParamValues, |
|
|
const QStringList & |
p_vecParameterDescriptions, |
|
|
bool |
p_bIsJson = true , |
|
|
QObject * |
parent = 0 |
|
) |
| |
|
explicit |
Constructor which assembles a command from single parts
- Parameters
-
[in] | p_sCommand | Command. |
[in] | p_sDescription | Command description. |
[in] | p_qListParamNames | Parameter names. |
[in] | p_qListParamValues | Parameter values/types. |
[in] | p_vecParameterDescriptions | Parameter descriptions;. |
Definition at line 87 of file command.cpp.
◆ Command() [6/6]
Command::Command |
( |
const Command & |
p_Command | ) |
|
Copy constructor.
- Parameters
-
Definition at line 112 of file command.cpp.
◆ ~Command()
◆ command()
QString COMMUNICATIONLIB::Command::command |
( |
| ) |
const |
|
inline |
Short command for this request
- Returns
- Short command representation.
Definition at line 319 of file command.h.
◆ count()
quint32 COMMUNICATIONLIB::Command::count |
( |
| ) |
const |
|
inline |
Returns the number of parameters.
- Returns
- number of parameters.
Definition at line 326 of file command.h.
◆ description()
QString COMMUNICATIONLIB::Command::description |
( |
| ) |
const |
|
inline |
Gets the help text or description of this command.
- Returns
- Help text.
Definition at line 333 of file command.h.
◆ execute()
void Command::execute |
( |
| ) |
|
|
virtual |
◆ executed
void COMMUNICATIONLIB::Command::executed |
( |
Command |
p_command | ) |
|
|
signal |
Signal which is emitted when command patterns execute method is processed.
- Parameters
-
[in] | p_command | the executed command. |
◆ isJson()
bool & COMMUNICATIONLIB::Command::isJson |
( |
| ) |
|
|
inline |
If received command was Json fomratted or triggered command should be Json formatted.
- Returns
- Json formatted.
Definition at line 340 of file command.h.
◆ operator=()
Assignment Operator
- Parameters
-
[in] | rhs | Command which should be assigned. |
Definition at line 223 of file command.cpp.
◆ operator[]() [1/3]
QVariant & Command::operator[] |
( |
const QString & |
key | ) |
|
Subscript operator [] to access parameter values by name
- Parameters
-
[in] | key | the parameter name. |
- Returns
- Parameter value related to the parameter name.
Definition at line 239 of file command.cpp.
◆ operator[]() [2/3]
const QVariant Command::operator[] |
( |
const QString & |
key | ) |
const |
Subscript operator []
- Parameters
-
[in] | key | the parameter name. |
- Returns
- Parameter value related to the parameter name.
Definition at line 259 of file command.cpp.
◆ operator[]() [3/3]
QVariant & Command::operator[] |
( |
qint32 |
idx | ) |
|
Subscript operator [] to access parameter values by index
- Parameters
-
[in] | idx | the parameter index. |
- Returns
- Parameter value related to the parameter index.
Definition at line 249 of file command.cpp.
◆ pDescriptions()
QList< QString > COMMUNICATIONLIB::Command::pDescriptions |
( |
| ) |
const |
|
inline |
Get parameter descriptions
- Returns
- parameter descriptions.
Definition at line 347 of file command.h.
◆ pNames()
QList< QString > COMMUNICATIONLIB::Command::pNames |
( |
| ) |
const |
|
inline |
Get parameter names
- Returns
- parameter names.
Definition at line 354 of file command.h.
◆ pValues()
QList< QVariant > & COMMUNICATIONLIB::Command::pValues |
( |
| ) |
|
|
inline |
Returns parameter values
- Returns
- parameter values.
Definition at line 361 of file command.h.
◆ reply()
void Command::reply |
( |
const QString & |
p_sReply | ) |
|
Inherited command reply channel.
- Parameters
-
[in] | p_sReply | command reply. |
Definition at line 138 of file command.cpp.
◆ send()
Sender slot which emmits triggered signal
Definition at line 149 of file command.cpp.
◆ toJsonObject()
QJsonObject Command::toJsonObject |
( |
| ) |
const |
◆ toStringList()
QStringList Command::toStringList |
( |
| ) |
const |
Creates a StringList with three items. First item is the command, second the parameter list and thrid the description.
- Returns
- Command as a StringList.
Definition at line 180 of file command.cpp.
◆ toStringReadySend()
QString Command::toStringReadySend |
( |
| ) |
const |
Creates a string JSON formatted ready send command.
- Returns
- Command as a JSON formatted string which contains parameter values too.
Definition at line 202 of file command.cpp.
The documentation for this class was generated from the following files: