MNE-CPP  beta 1.0
fiffstreamthread.h
Go to the documentation of this file.
1 //=============================================================================================================
36 #ifndef FIFFSTREAMTHREAD_H
37 #define FIFFSTREAMTHREAD_H
38 
39 //*************************************************************************************************************
40 //=============================================================================================================
41 // INCLUDES
42 //=============================================================================================================
43 
44 #include <fiff/fiff_stream.h>
45 #include <fiff/fiff_info.h>
46 
47 
48 //*************************************************************************************************************
49 //=============================================================================================================
50 // QT INCLUDES
51 //=============================================================================================================
52 
53 #include <QThread>
54 #include <QTcpSocket>
55 #include <QMutex>
56 #include <QSharedPointer>
57 
58 
59 //*************************************************************************************************************
60 //=============================================================================================================
61 // DEFINE NAMESPACE RTSERVER
62 //=============================================================================================================
63 
64 namespace RTSERVER
65 {
66 
67 //*************************************************************************************************************
68 //=============================================================================================================
69 // USED NAMESPACES
70 //=============================================================================================================
71 
72 using namespace FIFFLIB;
73 
74 
75 //*************************************************************************************************************
76 //=============================================================================================================
77 // FORWARD DECLARATIONS
78 //=============================================================================================================
79 
80 class FiffStreamThread : public QThread
81 {
82  Q_OBJECT
83 public:
84  FiffStreamThread(qint32 id, int socketDescriptor, QObject *parent);
85 
87 
88  void run();
89 
90  inline qint32 getID();
91 
92  inline QString getAlias();
93 
94 // void deactivateRawBufferSending();
95 
96 
97  void parseCommand(QSharedPointer<FiffTag> p_pTag);
98 
99  void writeClientId();
100 
101 // void sendData(QTcpSocket& p_qTcpSocket);
102 
103 signals:
104  void error(QTcpSocket::SocketError socketError);
105 
106 private:
107  qint32 m_iDataClientId;
108  QString m_sDataClientAlias;
109 
110  int m_iSocketDescriptor;
111 
112  QMutex m_qMutex;
113  QByteArray m_qSendBlock;
114 
115  bool m_bIsSendingRawBuffer;
116 
117  bool m_bIsRunning;
118 
119 //public slots: --> in Qt 5 not anymore declared as slot
120  void startMeas(qint32 ID);
121  void stopMeas(qint32 ID);
122  void sendMeasurementInfo(qint32 ID, FiffInfo p_fiffInfo);
123  void sendRawBuffer(QSharedPointer<Eigen::MatrixXf> m_pMatRawData);
124  //void readToBuffer1();
125 // void readProc(QTcpSocket& p_qTcpSocket);
126 };
127 
128 
129 inline qint32 FiffStreamThread::getID()
130 {
131  return m_iDataClientId;
132 }
133 
134 
135 inline QString FiffStreamThread::getAlias()
136 {
137  return m_sDataClientAlias;
138 }
139 
140 
141 } // NAMESPACE
142 
143 #endif //FIFFSTREAMTHREAD_H
FIFF measurement file information.
Definition: fiff_info.h:96
FiffInfo class declaration.
FiffStream class declaration.
Definition: fiff.h:98