00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date$ 00006 Version: $Revision$ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 00019 #include "mitkWeakPointerProperty.h" 00020 00021 bool mitk::WeakPointerProperty::operator==(const BaseProperty& property) const 00022 { 00023 const Self *other = dynamic_cast<const Self*>(&property); 00024 00025 if(other==NULL) return false; 00026 00027 return other->m_WeakPointer==m_WeakPointer; 00028 } 00029 00030 mitk::WeakPointerProperty::WeakPointerProperty(itk::Object* pointer) : m_WeakPointer(pointer) 00031 { 00032 Modified(); 00033 } 00034 00035 mitk::WeakPointerProperty::~WeakPointerProperty() 00036 { 00037 } 00038 00039 00040 itk::Object::Pointer mitk::WeakPointerProperty::GetWeakPointer() const 00041 { 00042 return m_WeakPointer.GetPointer(); 00043 } 00044 00045 00046 00047 void mitk::WeakPointerProperty::SetWeakPointer(itk::Object* pointer) 00048 { 00049 if(m_WeakPointer.GetPointer() != pointer) 00050 { 00051 m_WeakPointer = pointer; 00052 Modified(); 00053 } 00054 }