MNE-CPP  0.1.9
A Framework for Electrophysiology
Public Types | Signals | Public Member Functions | List of all members
COMMUNICATIONLIB::RtCmdClient Class Reference

Real-time command client. More...

#include <rtcmdclient.h>

Public Types

typedef QSharedPointer< RtCmdClientSPtr
 
typedef QSharedPointer< const RtCmdClientConstSPtr
 

Signals

void response (QString p_sResponse)
 

Public Member Functions

 RtCmdClient (QObject *parent=Q_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

Real-time command client.

The real-time command client class provides an interface to communicate with the command port 4217 of a running mne_rt_server.

Definition at line 71 of file rtcmdclient.h.

Inheritance diagram for COMMUNICATIONLIB::RtCmdClient:
Inheritance graph

Member Typedef Documentation

◆ ConstSPtr

Const shared pointer type for RtCmdClient.

Definition at line 77 of file rtcmdclient.h.

◆ SPtr

Shared pointer type for RtCmdClient.

Definition at line 76 of file rtcmdclient.h.

Constructor & Destructor Documentation

◆ RtCmdClient()

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

Creates the real-time command client.

Parameters
[in]parentParent QObject (optional).

Definition at line 64 of file rtcmdclient.cpp.

Member Function Documentation

◆ hasCommand()

bool COMMUNICATIONLIB::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 208 of file rtcmdclient.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 349 of file rtcmdclient.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 356 of file rtcmdclient.cpp.

◆ readAvailableData()

QString COMMUNICATIONLIB::RtCmdClient::readAvailableData ( )
inline

Returns the available data.

Returns
the available data.

Definition at line 196 of file rtcmdclient.h.

◆ requestBufsize()

qint32 RtCmdClient::requestBufsize ( )

Request buffer size from mne_rt_server

Definition at line 180 of file rtcmdclient.cpp.

◆ requestCommands()

void RtCmdClient::requestCommands ( )

Request available commands from mne_rt_server

Definition at line 212 of file rtcmdclient.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 241 of file rtcmdclient.cpp.

◆ response

void COMMUNICATIONLIB::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 73 of file rtcmdclient.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 98 of file rtcmdclient.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 329 of file rtcmdclient.cpp.


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