Medical Imaging Interaction Toolkit  2023.12.00
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 {
33  class MITKOPENIGTLINK_EXPORT IGTLServer : public IGTLDevice
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 
116 
118  std::mutex m_ReceiveListMutex;
119 
121  std::mutex m_SentListMutex;
122  };
123 } // namespace mitk
124 #endif
mitk::IGTLServer::m_RegisteredClients
SocketListType m_RegisteredClients
A list with all registered clients.
Definition: mitkIGTLServer.h:115
mitkNewMacro1Param
#define mitkNewMacro1Param(classname, type)
Definition: mitkCommon.h:68
mitk::IGTLServer::m_SentListMutex
std::mutex m_SentListMutex
Definition: mitkIGTLServer.h:121
mitk::IGTLDevice
Interface for all OpenIGTLink Devices.
Definition: mitkIGTLDevice.h:62
mitk::IGTLServer
Superclass for OpenIGTLink server.
Definition: mitkIGTLServer.h:33
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::IGTLServer::m_ReceiveListMutex
std::mutex m_ReceiveListMutex
Definition: mitkIGTLServer.h:118
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitk::IGTLServer::SocketListIteratorType
SocketListType::iterator SocketListIteratorType
Definition: mitkIGTLServer.h:41
mitk::IGTLServer::SocketListType
std::list< igtl::Socket::Pointer > SocketListType
Definition: mitkIGTLServer.h:38
mitkIGTLDevice.h