Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
mitkIGTLDummyMessage.cpp
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 
14 #include "mitkIGTLDummyMessage.h"
15 
16 #include "igtl_header.h"
17 #include "igtl_util.h"
18 
19 
21 {
22 }
23 
25 {
26 }
27 
28 void mitk::IGTLDummyMessage::SetDummyString( const std::string& dummyString )
29 {
30  this->m_dummyString = dummyString;
31  this->m_String = "This is a dummy string";
32 }
33 
34 std::string mitk::IGTLDummyMessage::GetDummyString()
35 {
36  return this->m_dummyString;
37 }
38 
39 igtl::MessageBase::Pointer mitk::IGTLDummyMessage::Clone()
40 {
41  //initialize the clone
42  mitk::IGTLDummyMessage::Pointer clone = mitk::IGTLDummyMessage::New();
43 
44  //copy the data
45  clone->SetString(this->GetString());
46  clone->SetDummyString(this->GetDummyString());
47 
48  return igtl::MessageBase::Pointer(clone.GetPointer());
49 }
50 
57 igtl::MessageBase::Pointer mitk::DummyMsgCloneHandler::Clone(igtl::MessageBase* original_)
58 {
59  mitk::IGTLDummyMessage* original = (mitk::IGTLDummyMessage*)original_;
60  return original->Clone();
61 }
igtl::SmartPointer< Self > Pointer
igtl::MessageBase::Pointer Clone() override
static void clone(T *&dst, S *src, int n)
Definition: svm.cpp:59
This class is a dummy message to show how to implement a new message type.