Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkWeakPointerProperty.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 
14 
15 bool mitk::WeakPointerProperty::IsEqual(const BaseProperty &property) const
16 {
17  return this->m_WeakPointer == static_cast<const Self &>(property).m_WeakPointer;
18 }
19 
20 bool mitk::WeakPointerProperty::Assign(const BaseProperty &property)
21 {
22  this->m_WeakPointer = static_cast<const Self &>(property).m_WeakPointer;
23  return true;
24 }
25 
27 {
28 }
29 
32 {
33 }
34 
36 {
37 }
38 
40 {
41  std::stringstream ss;
42  ss << m_WeakPointer.GetPointer();
43  return ss.str();
44 }
45 
47 {
48  return m_WeakPointer.GetPointer();
49 }
50 
52 {
53  return GetWeakPointer();
54 }
55 
57 {
58  if (m_WeakPointer.GetPointer() != pointer)
59  {
60  m_WeakPointer = pointer;
61  Modified();
62  }
63 }
64 
66 {
67  SetWeakPointer(value.GetPointer());
68 }
69 
70 itk::LightObject::Pointer mitk::WeakPointerProperty::InternalClone() const
71 {
72  itk::LightObject::Pointer result(new Self(*this));
73  result->UnRegister();
74  return result;
75 }
std::string GetValueAsString() const override
void SetValue(const ValueType &value)
DataCollection - Class to facilitate loading/accessing structured data.
Property containing a smart-pointer.
Abstract base class for properties.
WeakPointerProperty(const WeakPointerProperty &)
itk::WeakPointer< itk::Object > ValueType
itk::WeakPointer< itk::Object > m_WeakPointer
void SetWeakPointer(itk::Object *pointer)