vtkInformationKey.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00039 #ifndef __vtkInformationKey_h
00040 #define __vtkInformationKey_h
00041
00042 #include "vtkObjectBase.h"
00043 #include "vtkObject.h"
00044
00045 class vtkInformation;
00046
00047 class VTK_FILTERING_EXPORT vtkInformationKey : public vtkObjectBase
00048 {
00049 public:
00050 vtkTypeRevisionMacro(vtkInformationKey,vtkObjectBase);
00051 void PrintSelf(ostream& os, vtkIndent indent);
00052
00054 virtual void Register(vtkObjectBase*);
00055
00057 virtual void UnRegister(vtkObjectBase*);
00058
00061 const char* GetName();
00062
00065 const char* GetLocation();
00066
00068
00073 vtkInformationKey(const char* name, const char* location);
00074 ~vtkInformationKey();
00076
00080 virtual void Copy(vtkInformation* from, vtkInformation* to)=0;
00081
00083 void Remove(vtkInformation* info);
00084
00086 virtual void Report(vtkInformation* info, vtkGarbageCollector* collector);
00087
00088 protected:
00089 const char* Name;
00090 const char* Location;
00091
00092
00093
00094 void SetAsObjectBase(vtkInformation* info, vtkObjectBase* value);
00095 vtkObjectBase* GetAsObjectBase(vtkInformation* info);
00096
00097
00098 void ConstructClass(const char*);
00099
00100 private:
00101 vtkInformationKey(const vtkInformationKey&);
00102 void operator=(const vtkInformationKey&);
00103 };
00104
00105
00106
00107
00108 #define vtkInformationKeyMacro(CLASS, NAME, type) \
00109 static vtkInformation##type##Key CLASS##_##NAME(#NAME, #CLASS); \
00110 vtkInformation##type##Key* CLASS::NAME() { return &CLASS##_##NAME; }
00111 #define vtkInformationKeyRestrictedMacro(CLASS, NAME, type, required) \
00112 static vtkInformation##type##Key CLASS##_##NAME(#NAME, #CLASS, required); \
00113 vtkInformation##type##Key* CLASS::NAME() { return &CLASS##_##NAME; }
00114
00115 #endif