00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00028 #ifndef __vtkInformationKey_h
00029 #define __vtkInformationKey_h
00030
00031 #include "vtkObjectBase.h"
00032 #include "vtkObject.h"
00033
00034 class vtkInformation;
00035
00036 class VTK_FILTERING_EXPORT vtkInformationKey : public vtkObjectBase
00037 {
00038 public:
00039 vtkTypeRevisionMacro(vtkInformationKey,vtkObjectBase);
00040 void PrintSelf(ostream& os, vtkIndent indent);
00041
00043 virtual void Register(vtkObjectBase*);
00044
00046 virtual void UnRegister(vtkObjectBase*);
00047
00050 const char* GetName();
00051
00054 const char* GetLocation();
00055
00057
00062 vtkInformationKey(const char* name, const char* location);
00063 ~vtkInformationKey();
00065
00069 virtual void ShallowCopy(vtkInformation* from, vtkInformation* to)=0;
00070
00072
00076 virtual void DeepCopy(vtkInformation *vtkNotUsed(from),
00077 vtkInformation *vtkNotUsed(to)) {}
00079
00081 virtual void Remove(vtkInformation* info);
00082
00084 virtual void Report(vtkInformation* info, vtkGarbageCollector* collector);
00085
00087
00088 void Print(vtkInformation* info);
00089 virtual void Print(ostream& os, vtkInformation* info);
00091
00092 protected:
00093 const char* Name;
00094 const char* Location;
00095
00096
00097
00098 void SetAsObjectBase(vtkInformation* info, vtkObjectBase* value);
00099 vtkObjectBase* GetAsObjectBase(vtkInformation* info);
00100
00101
00102
00103 void ReportAsObjectBase(vtkInformation* info,
00104 vtkGarbageCollector* collector);
00105
00106
00107 void ConstructClass(const char*);
00108
00109 private:
00110 vtkInformationKey(const vtkInformationKey&);
00111 void operator=(const vtkInformationKey&);
00112 };
00113
00114
00115
00116
00117 #define vtkInformationKeyMacro(CLASS, NAME, type) \
00118 static vtkInformation##type##Key* CLASS##_##NAME = \
00119 new vtkInformation##type##Key(#NAME, #CLASS); \
00120 vtkInformation##type##Key* CLASS::NAME() { return CLASS##_##NAME; }
00121 #define vtkInformationKeyRestrictedMacro(CLASS, NAME, type, required) \
00122 static vtkInformation##type##Key* CLASS##_##NAME = \
00123 new vtkInformation##type##Key(#NAME, #CLASS, required); \
00124 vtkInformation##type##Key* CLASS::NAME() { return CLASS##_##NAME; }
00125
00126 #endif