Medical Imaging Interaction Toolkit  2018.4.99-1640525a
Medical Imaging Interaction Toolkit
mitkIGTLServer.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef MITKIGTLSERVER_H
14 #define MITKIGTLSERVER_H
15 
16 #include "mitkIGTLDevice.h"
17 
18 #include <MitkOpenIGTLinkExports.h>
19 
20 namespace mitk
21 {
34  {
35  public:
37  mitkNewMacro1Param(Self, bool);
38  itkCloneMacro(Self);
39 
40  typedef std::list<igtl::Socket::Pointer> SocketListType;
41  typedef SocketListType::iterator SocketListIteratorType;
42 
51  bool OpenConnection() override;
52 
59  bool CloseConnection() override;
60 
64  unsigned int GetNumberOfConnections() override;
65 
66  protected:
68  IGTLServer(bool ReadFully);
70  ~IGTLServer() override;
71 
80  void Connect() override;
81 
87  void Receive() override;
88 
94  void Send() override;
95 
102  virtual void StopCommunicationWithSocket(SocketListType& toBeRemovedSockets);
103 
110  void StopCommunicationWithSocket(igtl::Socket* client) override;
111 
115  SocketListType m_RegisteredClients;
116 
118  itk::FastMutexLock::Pointer m_ReceiveListMutex;
119 
121  itk::FastMutexLock::Pointer m_SentListMutex;
122  };
123 } // namespace mitk
124 #endif /* MITKIGTLSERVER_H */
std::list< igtl::Socket::Pointer > SocketListType
Superclass for OpenIGTLink server.
#define mitkNewMacro1Param(classname, type)
Definition: mitkCommon.h:72
DataCollection - Class to facilitate loading/accessing structured data.
#define MITKOPENIGTLINK_EXPORT
itk::FastMutexLock::Pointer m_ReceiveListMutex
SocketListType::iterator SocketListIteratorType
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
itk::FastMutexLock::Pointer m_SentListMutex
Interface for all OpenIGTLink Devices.
SocketListType m_RegisteredClients
A list with all registered clients.