Common/vtkInstantiator.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00072 #ifndef __vtkInstantiator_h
00073 #define __vtkInstantiator_h
00074
00075 #include "vtkObject.h"
00076
00077
00078
00079 #include "vtkDebugLeaksManager.h"
00080
00081 class vtkInstantiatorInitialize;
00082 class vtkInstantiatorHashTable;
00083
00084 class VTK_COMMON_EXPORT vtkInstantiator : public vtkObject
00085 {
00086 public:
00087 static vtkInstantiator* New();
00088 vtkTypeRevisionMacro(vtkInstantiator,vtkObject);
00089 void PrintSelf(ostream& os, vtkIndent indent);
00090
00093 static vtkObject* CreateInstance(const char* className);
00094
00095
00096 typedef vtkObject* (*CreateFunction)();
00097
00099
00103 static void RegisterInstantiator(const char* className,
00104 CreateFunction createFunction);
00106
00108
00111 static void UnRegisterInstantiator(const char* className,
00112 CreateFunction createFunction);
00113
00115
00116 protected:
00117 vtkInstantiator();
00118 ~vtkInstantiator();
00119
00120
00121 static vtkInstantiatorHashTable* CreatorTable;
00122
00123 static void ClassInitialize();
00124 static void ClassFinalize();
00125
00126
00127 friend class vtkInstantiatorInitialize;
00128
00129
00130 private:
00131 vtkInstantiator(const vtkInstantiator&);
00132 void operator=(const vtkInstantiator&);
00133 };
00134
00135
00136
00137
00138 class VTK_COMMON_EXPORT vtkInstantiatorInitialize
00139 {
00140 public:
00141 vtkInstantiatorInitialize();
00142 ~vtkInstantiatorInitialize();
00143 private:
00144 static unsigned int Count;
00145 };
00146
00147
00148
00149
00150 static vtkInstantiatorInitialize vtkInstantiatorInitializer;
00151
00152
00153 #endif