Factory class of supported OpenIGTLink message types.
More...
#include <mitkIGTLMessageFactory.h>
Factory class of supported OpenIGTLink message types.
This class is a factory for the creation of OpenIGTLink messages. It stores pairs of type and pointer to the message new method. Available standard types are already added but you can also add your custom types at runtime.
Definition at line 33 of file mitkIGTLMessageFactory.h.
◆ PointerToMessageBaseNew
typedef igtl::MessageBase::Pointer(* mitk::IGTLMessageFactory::PointerToMessageBaseNew) () |
◆ IGTLMessageFactory()
mitk::IGTLMessageFactory::IGTLMessageFactory |
( |
| ) |
|
|
protected |
◆ ~IGTLMessageFactory()
mitk::IGTLMessageFactory::~IGTLMessageFactory |
( |
| ) |
|
|
overrideprotected |
◆ AddMessageCloneHandler()
virtual void mitk::IGTLMessageFactory::AddMessageCloneHandler |
( |
std::string |
msgTypeName, |
|
|
mitk::IGTLMessageCloneHandler::Pointer |
msgCloneHandler |
|
) |
| |
|
virtual |
Adds a clone function for the specified message type.
- Parameters
-
msgTypeName | The name of the message type |
msgCloneHandler | Function pointer to the message clone function (e.g. TBD ) |
◆ AddMessageNewMethod()
Add message type name and pointer to IGTL message new function Usage: AddMessageType("IMAGE", (PointerToMessageBaseNew)&igtl::ImageMessage::New);.
- Parameters
-
messageTypeName | The name of the message type |
messageTypeNewPointer | Function pointer to the message type new function (e.g. (PointerToMessageBaseNew)&igtl::ImageMessage::New ) |
◆ AddMessageType()
Add message type name and pointer to IGTL message new function and the clone handler.
- Parameters
-
messageTypeName | The name of the message type |
messageTypeNewPointer | Function pointer to the message type new function (e.g. (PointerToMessageBaseNew)&igtl::ImageMessage::New ) |
cloneHandler | pointer to the message clone object |
◆ Clone() [1/2]
Pointer mitk::IGTLMessageFactory::Clone |
( |
| ) |
const |
◆ Clone() [2/2]
igtl::MessageBase::Pointer mitk::IGTLMessageFactory::Clone |
( |
igtl::MessageBase::Pointer |
msg | ) |
|
Clones the given message according to the available clone methods.
- Parameters
-
msg | The message that has to be cloned This method checks the data type and clones the message according to this type. |
◆ CreateInstance() [1/2]
igtl::MessageBase::Pointer mitk::IGTLMessageFactory::CreateInstance |
( |
igtl::MessageHeader::Pointer |
msg | ) |
|
Creates a new message according to the given header.
- Parameters
-
msg | The message header that defines the type of the message This method checks the data type and creates a new message according to the type. |
◆ CreateInstance() [2/2]
igtl::MessageBase::Pointer mitk::IGTLMessageFactory::CreateInstance |
( |
std::string |
messageTypeName | ) |
|
Creates a new message instance fitting to the given type.
If this type is not registered it returns nullptr Usage: igtl::MessageBase::Pointer message = CreateInstance("IMAGE");
◆ GetAvailableMessageRequestTypes()
std::list<std::string> mitk::IGTLMessageFactory::GetAvailableMessageRequestTypes |
( |
| ) |
|
Returns available get messages.
◆ GetCloneHandler()
virtual mitk::IGTLMessageCloneHandler::Pointer mitk::IGTLMessageFactory::GetCloneHandler |
( |
std::string |
messageTypeName | ) |
|
|
virtual |
Get pointer to message type clone function, or nullptr if the message type is not registered Usage: igtl::TransformMessage::Pointer original = igtl::TransformMessage::New(); igtl::MessageBase::Pointer message = GetCloneHandler("IMAGE")->Clone(original);.
◆ GetMessageTypeNewPointer()
Get pointer to message type new function, or nullptr if the message type not registered Usage: igtl::MessageBase::Pointer message = GetMessageTypeNewPointer("IMAGE")();.
◆ mitkClassMacroItkParent()
◆ New()
static Pointer mitk::IGTLMessageFactory::New |
( |
| ) |
|
|
static |
◆ m_CloneHandlers
std::map<std::string,mitk::IGTLMessageCloneHandler::Pointer> mitk::IGTLMessageFactory::m_CloneHandlers |
|
protected |
◆ m_NewMethods
The documentation for this class was generated from the following file: