VTK
dox
Common
Core
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
=========================================================================*/
62
#ifndef vtkInstantiator_h
63
#define vtkInstantiator_h
64
65
#include "vtkCommonCoreModule.h"
// For export macro
66
#include "
vtkObject.h
"
67
68
// The vtkDebugLeaks singleton must be initialized before and
69
// destroyed after the vtkInstantiator singleton.
70
#include "
vtkDebugLeaksManager.h
"
// Needed for proper singleton initialization
71
72
class
vtkInstantiatorInitialize
;
73
class
vtkInstantiatorHashTable;
74
75
class
VTKCOMMONCORE_EXPORT
vtkInstantiator
:
public
vtkObject
76
{
77
public
:
78
static
vtkInstantiator
*
New
();
79
vtkTypeMacro(
vtkInstantiator
,
vtkObject
);
80
void
PrintSelf
(ostream& os,
vtkIndent
indent) VTK_OVERRIDE;
81
86
VTK_NEWINSTANCE
87
static
vtkObject
* CreateInstance(
const
char
* className);
88
89
typedef
vtkObject
* (*CreateFunction)();
90
97
static
void
RegisterInstantiator(
const
char
* className,
98
CreateFunction createFunction);
99
105
static
void
UnRegisterInstantiator(
const
char
* className,
106
CreateFunction createFunction);
107
108
protected
:
109
vtkInstantiator
();
110
~
vtkInstantiator
() VTK_OVERRIDE;
111
112
// Internal storage for registered creation functions.
113
static vtkInstantiatorHashTable* CreatorTable;
114
115
static
void
ClassInitialize();
116
static
void
ClassFinalize();
117
118
friend class
vtkInstantiatorInitialize
;
119
120
private:
121
vtkInstantiator
(const
vtkInstantiator
&) VTK_DELETE_FUNCTION;
122
void
operator=(const
vtkInstantiator
&) VTK_DELETE_FUNCTION;
123
};
124
125
// Utility class to make sure vtkInstantiator is initialized before it
126
// is used.
127
class VTKCOMMONCORE_EXPORT
vtkInstantiatorInitialize
128
{
129
public
:
130
vtkInstantiatorInitialize
();
131
~
vtkInstantiatorInitialize
();
132
private
:
133
static
unsigned
int
Count;
134
private
:
135
vtkInstantiatorInitialize
(
const
vtkInstantiatorInitialize
& other) VTK_DELETE_FUNCTION;
136
vtkInstantiatorInitialize
& operator=(
const
vtkInstantiatorInitialize
& rhs) VTK_DELETE_FUNCTION;
137
};
138
139
// This instance will show up in any translation unit that uses
140
// vtkInstantiator. It will make sure vtkInstantiator is initialized
141
// before it is used.
142
static
vtkInstantiatorInitialize
vtkInstantiatorInitializer
;
143
144
#endif
vtkInstantiatorInitializer
static vtkInstantiatorInitialize vtkInstantiatorInitializer
Definition:
vtkInstantiator.h:142
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkObject
abstract base class for most VTK objects
Definition:
vtkObject.h:59
vtkInstantiator
create an instance of any VTK class from its name.
Definition:
vtkInstantiator.h:75
vtkDebugLeaksManager.h
vtkInstantiatorInitialize
Definition:
vtkInstantiator.h:127
vtkIndent
a simple class to control print indentation
Definition:
vtkIndent.h:39
vtkObject::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkObject.h
VTK_NEWINSTANCE
#define VTK_NEWINSTANCE
Definition:
vtkWrappingHints.h:30
Generated by
1.8.16