00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00058
#ifndef __vtkInstantiator_h
00059
#define __vtkInstantiator_h
00060
00061
#include "vtkObject.h"
00062
00063
00064
00065
#include "vtkDebugLeaksManager.h"
00066
00067
class vtkInstantiatorInitialize;
00068
class vtkInstantiatorHashTable;
00069
00070 class VTK_COMMON_EXPORT vtkInstantiator :
public vtkObject
00071 {
00072
public:
00073
static vtkInstantiator*
New();
00074 vtkTypeRevisionMacro(vtkInstantiator,
vtkObject);
00075
void PrintSelf(ostream& os,
vtkIndent indent);
00076
00079
static vtkObject* CreateInstance(
const char* className);
00080
00081
00082 typedef vtkObject* (*CreateFunction)();
00083
00085
00089
static void RegisterInstantiator(
const char* className,
00090
CreateFunction createFunction);
00092
00094
00097
static void UnRegisterInstantiator(
const char* className,
00098
CreateFunction createFunction);
00099
00101
00102
protected:
00103 vtkInstantiator();
00104 ~vtkInstantiator();
00105
00106
00107 static vtkInstantiatorHashTable* CreatorTable;
00108
00109
static void ClassInitialize();
00110
static void ClassFinalize();
00111
00112
00113
friend class vtkInstantiatorInitialize;
00114
00115
00116
private:
00117 vtkInstantiator(
const vtkInstantiator&);
00118
void operator=(
const vtkInstantiator&);
00119 };
00120
00121
00122
00123
00124 class VTK_COMMON_EXPORT vtkInstantiatorInitialize
00125 {
00126
public:
00127 vtkInstantiatorInitialize();
00128 ~vtkInstantiatorInitialize();
00129
private:
00130
static unsigned int Count;
00131 };
00132
00133
00134
00135
00136 static vtkInstantiatorInitialize
vtkInstantiatorInitializer;
00137
00138
00139
#endif