17 #ifndef MITKIGTLDEVICE_H
18 #define MITKIGTLDEVICE_H
23 #include "itkObject.h"
24 #include "itkFastMutexLock.h"
25 #include "itkMultiThreader.h"
28 #include "igtlSocket.h"
29 #include "igtlMessageBase.h"
30 #include "igtlTransformMessage.h"
33 #include "MitkOpenIGTLinkExports.h"
61 class MITKOPENIGTLINK_EXPORT
IGTLDevice :
public itk::Object
82 virtual bool OpenConnection() = 0;
90 virtual bool CloseConnection();
97 virtual bool StopCommunication();
104 bool StartCommunication();
115 void RunCommunication(
void (
IGTLDevice::*ComFunction)(
void), itk::FastMutexLock* mutex);
138 IGTLDeviceState GetState()
const;
165 itkSetMacro(PortNumber,
int);
170 itkGetMacro(PortNumber,
int);
175 itkSetMacro(Hostname, std::string);
180 itkGetMacro(Hostname, std::string);
185 itkGetConstMacro(Name, std::string);
190 itkSetMacro(Name, std::string);
195 itkSetMacro(ReadFully,
bool);
211 static ITK_THREAD_RETURN_TYPE ThreadStartSending(
void* data);
217 static ITK_THREAD_RETURN_TYPE ThreadStartReceiving(
void* data);
223 static ITK_THREAD_RETURN_TYPE ThreadStartConnecting(
void* data);
239 virtual bool TestConnection();
244 bool SendRTSMessage(
const char* type);
255 virtual unsigned int GetNumberOfConnections() = 0;
280 virtual void Receive() = 0;
296 unsigned int ReceivePrivate(igtl::Socket* device);
302 virtual void Send() = 0;
312 virtual void Connect();
318 virtual void StopCommunicationWithSocket(igtl::Socket* socket) = 0;
323 void SetState(IGTLDeviceState state);
367 int m_ReceiveThreadID;
369 int m_ConnectThreadID;
itk::FastMutexLock::Pointer m_ReceivingFinishedMutex
itk::FastMutexLock::Pointer m_StopCommunicationMutex
mitk::IGTLMessageFactory::Pointer m_MessageFactory
itk::SmartPointer< Self > Pointer
itk::FastMutexLock::Pointer m_StateMutex
itk::FastMutexLock::Pointer m_ConnectingFinishedMutex
DataCollection - Class to facilitate loading/accessing structured data.
A wrapper for the OpenIGTLink message type.
#define mitkClassMacroItkParent(className, SuperClassName)
IGTLDeviceState
Type for state variable. The IGTLDevice is always in one of these states.
mitk::IGTLMessageQueue::Pointer m_MessageQueue
itkEventMacro(ContourModelEvent, itk::AnyEvent)
itk::FastMutexLock::Pointer m_SendingFinishedMutex
Interface for all OpenIGTLink Devices.
igtl::Socket::Pointer m_Socket