Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef MITKIGTLSERVER_H
18 #define MITKIGTLSERVER_H
19 
20 #include "mitkIGTLDevice.h"
21 
22 #include <MitkOpenIGTLinkExports.h>
23 
24 namespace mitk
25 {
37  class MITKOPENIGTLINK_EXPORT IGTLServer : public IGTLDevice
38  {
39  public:
41  mitkNewMacro1Param(Self, bool)
42  itkCloneMacro(Self)
43 
44  typedef std::list<igtl::Socket::Pointer> SocketListType;
45  typedef SocketListType::iterator SocketListIteratorType;
46 
55  virtual bool OpenConnection() override;
56 
63  virtual bool CloseConnection() override;
64 
68  virtual unsigned int GetNumberOfConnections() override;
69 
70  protected:
72  IGTLServer(bool ReadFully);
74  virtual ~IGTLServer();
75 
84  virtual void Connect() override;
85 
91  virtual void Receive() override;
92 
98  virtual void Send() override;
99 
106  virtual void StopCommunicationWithSocket(SocketListType& toBeRemovedSockets);
107 
114  virtual void StopCommunicationWithSocket(igtl::Socket* client) override;
115 
119  SocketListType m_RegisteredClients;
120 
122  itk::FastMutexLock::Pointer m_ReceiveListMutex;
123 
125  itk::FastMutexLock::Pointer m_SentListMutex;
126  };
127 } // namespace mitk
128 #endif /* MITKIGTLSERVER_H */
std::list< igtl::Socket::Pointer > SocketListType
Superclass for OpenIGTLink server.
#define mitkNewMacro1Param(classname, type)
Definition: mitkCommon.h:76
STL namespace.
DataCollection - Class to facilitate loading/accessing structured data.
SocketListType::iterator SocketListIteratorType
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
Interface for all OpenIGTLink Devices.