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 #ifndef MITKWEAKPOINTERPROPERTY_H_HEADER_INCLUDED_C126B791 00020 #define MITKWEAKPOINTERPROPERTY_H_HEADER_INCLUDED_C126B791 00021 00022 #include "mitkCommon.h" 00023 #include "mitkBaseProperty.h" 00024 #include "itkWeakPointer.h" 00025 00026 namespace mitk { 00027 00028 //##Documentation 00029 //## @brief Property containing a smart-pointer 00030 //## 00031 //## @ingroup DataManagement 00032 class MITK_CORE_EXPORT WeakPointerProperty : public BaseProperty 00033 { 00034 public: 00035 mitkClassMacro(WeakPointerProperty, BaseProperty); 00036 00037 mitkNewMacro1Param(WeakPointerProperty, itk::Object*); 00038 00039 virtual bool operator==(const BaseProperty& property) const; 00040 00041 virtual ~WeakPointerProperty(); 00042 00043 itk::Object::Pointer GetWeakPointer() const; 00044 00045 void SetWeakPointer(itk::Object* pointer); 00046 protected: 00047 itk::WeakPointer<itk::Object> m_WeakPointer; 00048 00049 WeakPointerProperty(itk::Object* pointer); 00050 }; 00051 00052 } // namespace mitk 00053 00054 00055 00056 #endif /* MITKWEAKPOINTERPROPERTY_H_HEADER_INCLUDED_C126B791 */