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