MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
mitkIGTLServer.h
Go to the documentation of this file.
1/*============================================================================
2
3The Medical Imaging Interaction Toolkit (MITK)
4
5Copyright (c) German Cancer Research Center (DKFZ)
6All rights reserved.
7
8Use of this source code is governed by a 3-clause BSD license that can be
9found 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
20namespace mitk
21{
33 class MITKOPENIGTLINK_EXPORT IGTLServer : public IGTLDevice
34 {
35 public:
37 mitkNewMacro1Param(Self, bool);
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
119
121 std::mutex m_SentListMutex;
122 };
123} // namespace mitk
124#endif
Interface for all OpenIGTLink Devices.
Superclass for OpenIGTLink server.
SocketListType m_RegisteredClients
A list with all registered clients.
std::mutex m_SentListMutex
mitkClassMacro(IGTLServer, IGTLDevice)
std::mutex m_ReceiveListMutex
std::list< igtl::Socket::Pointer > SocketListType
mitkNewMacro1Param(Self, bool)
SocketListType::iterator SocketListIteratorType
IGT Exceptions.