MNE-CPP  beta 1.0
Public Types | Signals | Public Member Functions | List of all members
RTCLIENTLIB::RtCmdClient Class Reference

Real-time command client. More...

#include <rtcmdclient.h>

Inheritance diagram for RTCLIENTLIB::RtCmdClient:

Public Types

typedef QSharedPointer< RtCmdClientSPtr
 
typedef QSharedPointer< const RtCmdClientConstSPtr
 

Signals

void response (QString p_sResponse)
 

Public Member Functions

 RtCmdClient (QObject *parent=0)
 
void connectToHost (QString &p_sRtServerHostName)
 
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 86 of file rtcmdclient.h.

Member Typedef Documentation

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

Const shared pointer type for RtCmdClient.

Definition at line 91 of file rtcmdclient.h.

Shared pointer type for RtCmdClient.

Definition at line 90 of file rtcmdclient.h.

Constructor & Destructor Documentation

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

Creates the real-time command client.

Parameters
[in]parentParent QObject (optional)

Definition at line 70 of file rtcmdclient.cpp.

Member Function Documentation

void RtCmdClient::connectToHost ( QString &  p_sRtServerHostName)

Connect to a mne_rt_server using port 4217

Parameters
[in]p_sRtServerHostNameThe IP address of the mne_rt_server

Definition at line 79 of file rtcmdclient.cpp.

bool RTCLIENTLIB::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 232 of file rtcmdclient.h.

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 367 of file rtcmdclient.cpp.

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 374 of file rtcmdclient.cpp.

QString RTCLIENTLIB::RtCmdClient::readAvailableData ( )
inline

Returns the available data.

Returns
the available data.

Definition at line 219 of file rtcmdclient.h.

qint32 RtCmdClient::requestBufsize ( )

Request buffer size from mne_rt_server

Definition at line 195 of file rtcmdclient.cpp.

void RtCmdClient::requestCommands ( )

Request available commands from mne_rt_server

Definition at line 228 of file rtcmdclient.cpp.

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 258 of file rtcmdclient.cpp.

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

Emits the received response.

Parameters
[in]p_sResponsethe received response
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 86 of file rtcmdclient.cpp.

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 111 of file rtcmdclient.cpp.

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 347 of file rtcmdclient.cpp.


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