VTK
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
dox
Common
vtkInstantiator.h
Go to the documentation of this file.
1
/*=========================================================================
2
3
Program: Visualization Toolkit
4
Module: vtkInstantiator.h
5
6
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7
All rights reserved.
8
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10
This software is distributed WITHOUT ANY WARRANTY; without even
11
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12
PURPOSE. See the above copyright notice for more information.
13
14
=========================================================================*/
58
#ifndef __vtkInstantiator_h
59
#define __vtkInstantiator_h
60
61
#include "
vtkObject.h
"
62
63
// The vtkDebugLeaks singleton must be initialized before and
64
// destroyed after the vtkInstantiator singleton.
65
#include "
vtkDebugLeaksManager.h
"
// Needed for proper singleton initialization
66
67
class
vtkInstantiatorInitialize
;
68
class
vtkInstantiatorHashTable;
69
70
class
VTK_COMMON_EXPORT
vtkInstantiator
:
public
vtkObject
71
{
72
public
:
73
static
vtkInstantiator
*
New
();
74
vtkTypeMacro(
vtkInstantiator
,
vtkObject
);
75
void
PrintSelf
(ostream& os,
vtkIndent
indent);
76
79
static
vtkObject
* CreateInstance(
const
char
* className);
80
81
//BTX
82
typedef
vtkObject
* (*CreateFunction)();
83
85
89
static
void
RegisterInstantiator(
const
char
* className,
90
CreateFunction createFunction);
92
94
97
static
void
UnRegisterInstantiator(
const
char
* className,
98
CreateFunction createFunction);
99
//ETX
101
102
protected
:
103
vtkInstantiator
();
104
~
vtkInstantiator
();
105
106
// Internal storage for registered creation functions.
107
static
vtkInstantiatorHashTable*
CreatorTable
;
108
109
static
void
ClassInitialize();
110
static
void
ClassFinalize();
111
112
//BTX
113
friend
class
vtkInstantiatorInitialize
;
114
//ETX
115
116
private
:
117
vtkInstantiator
(
const
vtkInstantiator
&);
// Not implemented.
118
void
operator=(
const
vtkInstantiator
&);
// Not implemented.
119
};
120
121
//BTX
122
// Utility class to make sure vtkInstantiator is initialized before it
123
// is used.
124
class
VTK_COMMON_EXPORT
vtkInstantiatorInitialize
125
{
126
public
:
127
vtkInstantiatorInitialize
();
128
~
vtkInstantiatorInitialize
();
129
private
:
130
static
unsigned
int
Count;
131
};
132
133
// This instance will show up in any translation unit that uses
134
// vtkInstantiator. It will make sure vtkInstantiator is initialized
135
// before it is used.
136
static
vtkInstantiatorInitialize
vtkInstantiatorInitializer
;
137
//ETX
138
139
#endif
Generated on Sun Sep 9 2012 13:03:26 for VTK by
1.8.1.2