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

QTcpSocket subclass that talks the FIFF wire dialect of the mne_rt_server data port (default 4218). More...

#include <rt_data_client.h>

Public Types

typedef QSharedPointer< RtDataClientSPtr
typedef QSharedPointer< const RtDataClientConstSPtr

Public Member Functions

 RtDataClient (QObject *parent=nullptr)
virtual void disconnectFromHost ()
qint32 getClientId ()
FIFFLIB::FiffInfo::SPtr readInfo ()
MetaData readMetadata ()
void readRawBuffer (qint32 p_nChannels, Eigen::MatrixXf &data, FIFFLIB::fiff_int_t &kind)
void setClientAlias (const QString &p_sAlias)

Detailed Description

QTcpSocket subclass that talks the FIFF wire dialect of the mne_rt_server data port (default 4218).

Negotiates the per-session client id with setClientAlias / getClientId, fetches the FiffInfo (and optionally the digitiser point set) via readInfo / readMetadata, and then blocks on readRawBuffer to deliver one Eigen::MatrixXf sample matrix at a time. Parsing is delegated to FIFFLIB::FiffStream / FiffTag so this class never re-implements the binary framing; the only socket state it owns beyond the QTcpSocket base is the assigned m_clientID.

Definition at line 101 of file rt_data_client.h.

Inheritance diagram for COMLIB::RtDataClient:
Inheritance graph

Member Typedef Documentation

◆ ConstSPtr

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

Const shared pointer type for RtDataClient.

Definition at line 107 of file rt_data_client.h.

◆ SPtr

typedef QSharedPointer<RtDataClient> COMLIB::RtDataClient::SPtr

Shared pointer type for RtDataClient.

Definition at line 106 of file rt_data_client.h.

Constructor & Destructor Documentation

◆ RtDataClient()

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

Creates the real-time data client.

Parameters
[in]parentParent QObject (optional).

Definition at line 41 of file rt_data_client.cpp.

Member Function Documentation

◆ disconnectFromHost()

void RtDataClient::disconnectFromHost ( )
virtual

Attempts to close the socket. If there is pending data waiting to be written, QAbstractSocket will enter ClosingState and wait until all data has been written. Eventually, it will enter UnconnectedState and emit the disconnected() signal.

Definition at line 50 of file rt_data_client.cpp.

◆ getClientId()

qint32 RtDataClient::getClientId ( )

Requests the ID at mne_rt_server and returns it

Returns
the requested id.

Definition at line 58 of file rt_data_client.cpp.

◆ readInfo()

FiffInfo::SPtr RtDataClient::readInfo ( )

Reads fiff measurement information of a data the connection

Returns
the read fiff measurement information.

Definition at line 81 of file rt_data_client.cpp.

◆ readMetadata()

MetaData RtDataClient::readMetadata ( )

Reads fiff metaata class from data connection

Returns
returns metadata class (FiffInfo and FiffDigitizerData)

Definition at line 354 of file rt_data_client.cpp.

◆ readRawBuffer()

void RtDataClient::readRawBuffer ( qint32 p_nChannels,
Eigen::MatrixXf & data,
FIFFLIB::fiff_int_t & kind )

Reads fiff measurement information of a data the connection

Parameters
[in]p_nChannelsNumber of channels to reshape the received data.
[out]dataThe read data - ToDo change this to raw buffer data object.
[out]kindData kind.

Definition at line 641 of file rt_data_client.cpp.

◆ setClientAlias()

void RtDataClient::setClientAlias ( const QString & p_sAlias)

Sets the alias of the data client

Parameters
[in]p_sAliasThe alias of the data client.

Definition at line 666 of file rt_data_client.cpp.


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