MNE-CPP  beta 1.0
connectormanager.h
Go to the documentation of this file.
1 //=============================================================================================================
36 #ifndef CONNECTORMANAGER_H
37 #define CONNECTORMANAGER_H
38 
39 
40 //*************************************************************************************************************
41 //=============================================================================================================
42 // INCLUDES
43 //=============================================================================================================
44 
45 #include "IConnector.h"
46 
47 
48 //*************************************************************************************************************
49 //=============================================================================================================
50 // MNELIB INCLUDES
51 //=============================================================================================================
52 
53 #include <fiff/fiff_info.h>
54 
55 
56 //*************************************************************************************************************
57 //=============================================================================================================
58 // QT INCLUDES
59 //=============================================================================================================
60 
61 #include <QVector>
62 #include <QPluginLoader>
63 
64 
65 //*************************************************************************************************************
66 //=============================================================================================================
67 // DEFINE NAMESPACE RTSERVER
68 //=============================================================================================================
69 
70 namespace RTSERVER
71 {
72 
73 //*************************************************************************************************************
74 //=============================================================================================================
75 // USED NAMESPACES
76 //=============================================================================================================
77 
78 using namespace FIFFLIB;
79 using namespace RTCOMMANDLIB;
80 
81 
82 //*************************************************************************************************************
83 //=============================================================================================================
84 // Function Pointers
85 //=============================================================================================================
86 
87 
88 //*************************************************************************************************************
89 //=============================================================================================================
90 // FORWARD DECLARATIONS
91 //=============================================================================================================
92 
93 class FiffStreamServer;
94 
95 
96 //=============================================================================================================
102 class ConnectorManager : public QPluginLoader
103 {
104  Q_OBJECT
105 
106 public:
107 
108  //=========================================================================================================
114  ConnectorManager(FiffStreamServer* p_pFiffStreamServer, QObject* parent = 0);
115 
116  //=========================================================================================================
120  virtual ~ConnectorManager();
121 
122  //=========================================================================================================
126  void connectCommands();
127 
128  //=========================================================================================================
134  void loadConnectors(const QString& dir);
135 
136  static void clearConnectorActivation();
137 
138  void connectActiveConnector();
139 
140  void disconnectActiveConnector();
141 
142  //=========================================================================================================
148  IConnector* getActiveConnector();
149 
150  //=========================================================================================================
156  static inline const QVector<IConnector*>& getConnectors();
157 
158  //=========================================================================================================
164  QByteArray getConnectorList(bool p_bFlagJSON = false) const;
165 
166  //=========================================================================================================
170  QByteArray setActiveConnector(qint32 ID);
171 
172 signals:
173  void sendMeasInfo(qint32, FIFFLIB::FiffInfo);
174 // void setBufferSize(qint32 ID);
175 // void startMeasConnector();
176 // void stopMeasConnector();
177 
178 private:
179 
180  //SLOTS
181  //=========================================================================================================
187  void comConlist(Command p_command);
188 
189  //=========================================================================================================
195  void comSelcon(Command p_command);
196 
197  //=========================================================================================================
203  void comStart(Command p_command);//comMeas
204 
205  //=========================================================================================================
211  void comStopAll(Command p_command);
212 
213 
214 
215 
216  static QVector<IConnector*> s_vecConnectors;
218  FiffStreamServer* m_pFiffStreamServer;
219 };
220 
221 
222 //*************************************************************************************************************
223 //=============================================================================================================
224 // INLINE DEFINITIONS
225 //=============================================================================================================
226 
227 inline const QVector<IConnector*>& ConnectorManager::getConnectors()
228 {
229  return s_vecConnectors;
230 }
231 
232 } // NAMESPACE
233 
234 #endif // CONNECTORMANAGER_H
FIFF measurement file information.
Definition: fiff_info.h:96
The FiffStreamServer class provides.
The IConnector class is the interface class of all plugins.
Definition: IConnector.h:119
FiffInfo class declaration.
The connector interface.
Definition: fiff.h:98
static const QVector< IConnector * > & getConnectors()
The ConnectorManager class provides a dynamic plugin loader. As well as the handling of the loaded pl...