MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
mitkIGTLMessageFactory.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 mitkIGTLMessageFactory_h
14#define mitkIGTLMessageFactory_h
15
16#include "MitkOpenIGTLinkExports.h"
17#include "mitkCommon.h"
18
19#include "igtlMessageBase.h"
20#include "igtlMessageHeader.h"
21
23
24namespace mitk {
33 class MITKOPENIGTLINK_EXPORT IGTLMessageFactory : public itk::Object
34 {
35 public:
39
44 typedef igtl::MessageBase::Pointer (*PointerToMessageBaseNew)();
45
54 void AddMessageType(std::string messageTypeName,
55 IGTLMessageFactory::PointerToMessageBaseNew messageTypeNewPointer,
56 mitk::IGTLMessageCloneHandler::Pointer cloneHandler);
57
66 virtual void AddMessageNewMethod(std::string messageTypeName,
67 IGTLMessageFactory::PointerToMessageBaseNew messageTypeNewPointer);
68
75 virtual IGTLMessageFactory::PointerToMessageBaseNew GetMessageTypeNewPointer(
76 std::string messageTypeName);
77
85 igtl::MessageBase::Pointer CreateInstance(std::string messageTypeName);
86
93 igtl::MessageBase::Pointer CreateInstance(igtl::MessageHeader::Pointer msg);
94
101 virtual void AddMessageCloneHandler(std::string msgTypeName,
102 mitk::IGTLMessageCloneHandler::Pointer msgCloneHandler);
103
112 virtual mitk::IGTLMessageCloneHandler::Pointer
113 GetCloneHandler(std::string messageTypeName);
114
121 igtl::MessageBase::Pointer Clone(igtl::MessageBase::Pointer msg);
122
126 std::list<std::string> GetAvailableMessageRequestTypes();
127
128 protected:
130 ~IGTLMessageFactory() override;
131
135 std::map<std::string,mitk::IGTLMessageCloneHandler::Pointer> m_CloneHandlers;
136
141 std::map<std::string, PointerToMessageBaseNew> m_NewMethods;
142
143 private:
145 };
146}
147
148#endif
Factory class of supported OpenIGTLink message types.
mitkClassMacroItkParent(IGTLMessageFactory, itk::Object)
std::map< std::string, mitk::IGTLMessageCloneHandler::Pointer > m_CloneHandlers
Map igt message types and the Clone() methods.
std::map< std::string, PointerToMessageBaseNew > m_NewMethods
Map igt message types and the New() static methods of igtl::MessageBase classes.
IGT Exceptions.