NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
niftkNiftyLinkServerDataSourceService.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 #ifndef niftkNiftyLinkServerDataSourceService_h
15 #define niftkNiftyLinkServerDataSourceService_h
16 
19 #include <NiftyLinkTcpServer.h>
20 
21 #include <QSet>
22 #include <QString>
23 
24 namespace niftk
25 {
26 
28 
29  Q_OBJECT
30 
31 public:
32 
35  const IGIDataSourceProperties&, mitk::DataStorage::Pointer)
36 
37 protected:
38 
39  NiftyLinkServerDataSourceService(QString factoryName,
40  const IGIDataSourceProperties& properties,
41  mitk::DataStorage::Pointer dataStorage
42  );
43  virtual ~NiftyLinkServerDataSourceService();
44 
45 private slots:
46 
47  void OnClientConnected(int portNumber);
48  void OnClientDisconnected(int portNumber);
49  void OnSocketError(int portNumber, QAbstractSocket::SocketError errorCode, QString errorString);
50  void OnMessageReceived(int portNumber, niftk::NiftyLinkMessageContainer::Pointer message);
51 
52 private:
53 
54  NiftyLinkServerDataSourceService(const NiftyLinkServerDataSourceService&); // deliberately not implemented
55  NiftyLinkServerDataSourceService& operator=(const NiftyLinkServerDataSourceService&); // deliberately not implemented
56 
57  static niftk::IGIDataSourceLocker s_Lock;
58  static QSet<int> s_PortsInUse;
59  int m_ServerNumber;
60  niftk::NiftyLinkTcpServer *m_Server;
61 
62 };
63 
64 } // end namespace
65 
66 
67 #endif
GLsizei GLenum GLuint GLuint GLsizei GLchar * message
Definition: glew.h:2539
Definition: niftkNiftyLinkServerDataSourceService.h:27
QString
Definition: niftkNiftyLinkServerDataSourceService.h:34
Definition: ReceptorMemberCommandTest.cxx:25
Abstract base class for both NiftyLink Client and Server sources.
Definition: niftkNiftyLinkDataSourceService.h:63
QMap< QString, QVariant > IGIDataSourceProperties
Definition: niftkIGIDataSourceI.h:33
mitkClassMacroItkParent(NiftyLinkServerDataSourceService, NiftyLinkDataSourceService) mitkNewMacro3Param(NiftyLinkServerDataSourceService
Helper class to provide a class-level counter.
Definition: niftkIGIDataSourceLocker.h:29
Definition: niftkExceptionObject.h:21