v2.0.0
Loading...
Searching...
No Matches
COMLIB::RtCmdClient Class Reference

QTcpSocket subclass driving the mne_rt_server control channel (default port 4217). More...

#include <rt_cmd_client.h>

Public Types

typedef QSharedPointer< RtCmdClientSPtr
typedef QSharedPointer< const RtCmdClientConstSPtr

Signals

void response (QString p_sResponse)

Public Member Functions

 RtCmdClient (QObject *parent=nullptr)
bool hasCommand (const QString &p_sCommand) const
QString sendCLICommand (const QString &p_sCommand)
void sendCommandJSON (const Command &p_command)
QString readAvailableData ()
qint32 requestBufsize ()
void requestCommands ()
qint32 requestConnectors (QMap< qint32, QString > &p_qMapConnectors)
bool waitForDataAvailable (qint32 msecs=30000) const
Commandoperator[] (const QString &key)
const Command operator[] (const QString &key) const

Detailed Description

QTcpSocket subclass driving the mne_rt_server control channel (default port 4217).

Sends commands in either CLI or JSON form via sendCLICommand / sendCommandJSON, accumulates replies under an internal mutex so a worker thread can produce while the GUI thread consumes through readAvailableData, and mirrors the server’s self-described command vocabulary into an embedded CommandManager so callers can look commands up by name without hard-coding their schemas.

Definition at line 75 of file rt_cmd_client.h.

Inheritance diagram for COMLIB::RtCmdClient:
Inheritance graph

Member Typedef Documentation

◆ ConstSPtr

typedef QSharedPointer<const RtCmdClient> COMLIB::RtCmdClient::ConstSPtr

Const shared pointer type for RtCmdClient.

Definition at line 81 of file rt_cmd_client.h.

◆ SPtr

typedef QSharedPointer<RtCmdClient> COMLIB::RtCmdClient::SPtr

Shared pointer type for RtCmdClient.

Definition at line 80 of file rt_cmd_client.h.

Constructor & Destructor Documentation

◆ RtCmdClient()

RtCmdClient::RtCmdClient ( QObject * parent = nullptr)
explicit

Creates the real-time command client.

Parameters
[in]parentParent QObject (optional).

Definition at line 49 of file rt_cmd_client.cpp.

Member Function Documentation

◆ hasCommand()

bool COMLIB::RtCmdClient::hasCommand ( const QString & p_sCommand) const
inline

Checks if a command is managed;

Parameters
p_sCommandCommand to check.
Returns
true if part of command manager, false otherwise.

Definition at line 212 of file rt_cmd_client.h.

◆ operator[]() [1/2]

Command & RtCmdClient::operator[] ( const QString & key)

Subscript operator [] to access commands by command name

Parameters
[in]keythe command key word.
Returns
Command object related to command key word.

Definition at line 336 of file rt_cmd_client.cpp.

◆ operator[]() [2/2]

const Command RtCmdClient::operator[] ( const QString & key) const

Subscript operator [] to access commands by command name

Parameters
keythe command key word.
Returns
Command object related to command key word.

Definition at line 343 of file rt_cmd_client.cpp.

◆ readAvailableData()

QString COMLIB::RtCmdClient::readAvailableData ( )
inline

Returns the available data.

Returns
the available data.

Definition at line 200 of file rt_cmd_client.h.

◆ requestBufsize()

qint32 RtCmdClient::requestBufsize ( )

Request buffer size from mne_rt_server

Definition at line 167 of file rt_cmd_client.cpp.

◆ requestCommands()

void RtCmdClient::requestCommands ( )

Request available commands from mne_rt_server

Definition at line 199 of file rt_cmd_client.cpp.

◆ requestConnectors()

qint32 RtCmdClient::requestConnectors ( QMap< qint32, QString > & p_qMapConnectors)

Request available connectors from mne_rt_server

Parameters
[in]p_qMapConnectorslist of connectors.
Returns
the active connector.

Definition at line 228 of file rt_cmd_client.cpp.

◆ response

void COMLIB::RtCmdClient::response ( QString p_sResponse)
signal

Emits the received response.

Parameters
[in]p_sResponsethe received response.

◆ sendCLICommand()

QString RtCmdClient::sendCLICommand ( const QString & p_sCommand)

Sends a command line formatted command to a connected mne_rt_server

Parameters
[in]p_sCommandThe command to send.
Returns
mne_rt_server reply.

Definition at line 58 of file rt_cmd_client.cpp.

◆ sendCommandJSON()

void RtCmdClient::sendCommandJSON ( const Command & p_command)

Sends a command to a connected mne_rt_server

Parameters
[in]p_commandThe command to send.
Returns
mne_rt_server reply.

Definition at line 83 of file rt_cmd_client.cpp.

◆ waitForDataAvailable()

bool RtCmdClient::waitForDataAvailable ( qint32 msecs = 30000) const

Wait for ready read until data are available.

Parameters
[in]msecstime to wait in milliseconds, if -1 function will not time out. Default value is 30000.
Returns
Command object related to command key word.

Definition at line 316 of file rt_cmd_client.cpp.


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