Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef MITKSMARTPOINTERPROPERTY_H_HEADER_INCLUDED_C126B791
00020 #define MITKSMARTPOINTERPROPERTY_H_HEADER_INCLUDED_C126B791
00021
00022 #include "mitkCommon.h"
00023 #include "mitkBaseProperty.h"
00024 #include "mitkUIDGenerator.h"
00025
00026 #include<map>
00027 #include<list>
00028 #include<string>
00029
00030 namespace mitk {
00031
00032
00033
00034
00035 class MITK_CORE_EXPORT SmartPointerProperty : public BaseProperty
00036 {
00037 public:
00038 mitkClassMacro(SmartPointerProperty, BaseProperty);
00039
00040 itkNewMacro(SmartPointerProperty);
00041 mitkNewMacro1Param(SmartPointerProperty, itk::Object*);
00042
00043 virtual bool operator==(const BaseProperty&) const;
00044
00045 virtual ~SmartPointerProperty();
00046
00047 itk::Object::Pointer GetSmartPointer() const;
00048
00049 void SetSmartPointer(itk::Object*);
00050
00052 virtual std::string GetValueAsString() const;
00053
00054 virtual bool Assignable(const BaseProperty&) const;
00055
00056 virtual BaseProperty& operator=(const BaseProperty& property);
00057
00058 static void PostProcessXMLReading();
00059
00061 static unsigned int GetReferenceCountFor(itk::Object*);
00062 static std::string GetReferenceUIDFor(itk::Object*);
00063 static void RegisterPointerTarget(itk::Object*, const std::string uid);
00064
00065
00066 protected:
00067
00068 SmartPointerProperty(itk::Object* = NULL);
00069
00070 itk::Object::Pointer m_SmartPointer;
00071
00072 private:
00073
00074 typedef std::map<itk::Object*, unsigned int> ReferenceCountMapType;
00075 typedef std::map<itk::Object*, std::string> ReferencesUIDMapType;
00076 typedef std::map<SmartPointerProperty*, std::string> ReadInSmartPointersMapType;
00077 typedef std::map<std::string, itk::Object*> ReadInTargetsMapType;
00078
00080 static ReferenceCountMapType m_ReferenceCount;
00081 static ReferencesUIDMapType m_ReferencesUID;
00082 static ReadInSmartPointersMapType m_ReadInInstances;
00083 static ReadInTargetsMapType m_ReadInTargets;
00084
00086 static UIDGenerator m_UIDGenerator;
00087 };
00088
00089 }
00090
00091
00092
00093 #endif