VTK: Common/Core/vtkObjectFactory.h File Reference

| VTK 9.3.1

Classes | Macros | Variables
vtkObjectFactory.h File Reference
`#include "vtkCommonCoreModule.h"`
`#include "vtkDebugLeaksManager.h"`
`#include "vtkFeatures.h"`
`#include "vtkObject.h"`
`#include <string>`
Include dependency graph for vtkObjectFactory.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Classes
class | vtkObjectFactory
| abstract base class for vtkObjectFactories More...
struct | vtkObjectFactory::OverrideInformation
class | vtkObjectFactoryRegistryCleanup

## Macros
#define | VTK_CREATE_CREATE_FUNCTION(classname) static vtkObject* vtkObjectFactoryCreate##classname() { return classname::New(); }
#define | VTK_FACTORY_INTERFACE_EXPORT VTKCOMMONCORE_EXPORT
#define | VTK_FACTORY_INTERFACE_IMPLEMENT(factoryName)
#define | VTK_OBJECT_FACTORY_NEW_BODY(thisClass)
#define | VTK_ABSTRACT_OBJECT_FACTORY_NEW_BODY(thisClass)
#define | VTK_STANDARD_NEW_BODY(thisClass)
#define | vtkStandardNewMacro(thisClass) thisClass* thisClass::New() { VTK_STANDARD_NEW_BODY(thisClass); }
#define | vtkStandardExtendedNewMacro(thisClass)
#define | vtkObjectFactoryNewMacro(thisClass) thisClass* thisClass::New() { VTK_OBJECT_FACTORY_NEW_BODY(thisClass); }
#define | vtkAbstractObjectFactoryNewMacro(thisClass) thisClass* thisClass::New() { VTK_ABSTRACT_OBJECT_FACTORY_NEW_BODY(thisClass); }

## Variables
static vtkObjectFactoryRegistryCleanup | vtkObjectFactoryRegistryCleanupInstance

## Macro Definition Documentation

## ◆ VTK_CREATE_CREATE_FUNCTION

#define VTK_CREATE_CREATE_FUNCTION | ( |  | classname | ) | static vtkObject* vtkObjectFactoryCreate##classname() { return classname::New(); }

Definition at line 288 of file vtkObjectFactory.h.

## ◆ VTK_FACTORY_INTERFACE_EXPORT

#define VTK_FACTORY_INTERFACE_EXPORT VTKCOMMONCORE_EXPORT

Definition at line 294 of file vtkObjectFactory.h.

## ◆ VTK_FACTORY_INTERFACE_IMPLEMENT

#define VTK_FACTORY_INTERFACE_IMPLEMENT | ( |  | factoryName | ) |

Value:
extern "C" VTK_FACTORY_INTERFACE_EXPORT const char* vtkGetFactoryVersion() \
{ \
return VTK_SOURCE_VERSION; \
} \
extern "C" VTK_FACTORY_INTERFACE_EXPORT vtkObjectFactory* vtkLoad() \
{ \
return factoryName ::New(); \
}
vtkObjectFactory
abstract base class for vtkObjectFactories
Definition: vtkObjectFactory.h:54
VTK_FACTORY_INTERFACE_EXPORT
#define VTK_FACTORY_INTERFACE_EXPORT
Definition: vtkObjectFactory.h:294

Definition at line 301 of file vtkObjectFactory.h.

## ◆ VTK_OBJECT_FACTORY_NEW_BODY

#define VTK_OBJECT_FACTORY_NEW_BODY | ( |  | thisClass | ) |

Value:
vtkObject* ret = vtkObjectFactory::CreateInstance(#thisClass, false); \
if (ret) \
{ \
return static_cast<thisClass*>(ret); \
} \
auto result = new thisClass; \
result->InitializeObjectBase(); \
return result
vtkObjectFactory::CreateInstance
static vtkObject * CreateInstance(const char *vtkclassname, bool isAbstract=false)
Create and return an instance of the named vtk object.
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61

Definition at line 312 of file vtkObjectFactory.h.

## ◆ VTK_ABSTRACT_OBJECT_FACTORY_NEW_BODY

#define VTK_ABSTRACT_OBJECT_FACTORY_NEW_BODY | ( |  | thisClass | ) |

Value:
vtkObject* ret = vtkObjectFactory::CreateInstance(#thisClass, true); \
if (ret) \
{ \
return static_cast<thisClass*>(ret); \
} \
vtkGenericWarningMacro("Error: no override found for '" #thisClass "'."); \
return nullptr

Definition at line 325 of file vtkObjectFactory.h.

## ◆ VTK_STANDARD_NEW_BODY

#define VTK_STANDARD_NEW_BODY | ( |  | thisClass | ) |

Value:
auto result = new thisClass; \
result->InitializeObjectBase(); \
return result

Definition at line 338 of file vtkObjectFactory.h.

## ◆ vtkStandardNewMacro

#define vtkStandardNewMacro | ( |  | thisClass | ) | thisClass* thisClass::New() { VTK_STANDARD_NEW_BODY(thisClass); }

Definition at line 345 of file vtkObjectFactory.h.

## ◆ vtkStandardExtendedNewMacro

#define vtkStandardExtendedNewMacro | ( |  | thisClass | ) |

Value:
thisClass* thisClass::ExtendedNew() \
{ \
auto mkhold = vtkMemkindRAII(true); \
(void)mkhold; \
return thisClass::New(); \
}

Definition at line 350 of file vtkObjectFactory.h.

## ◆ vtkObjectFactoryNewMacro

#define vtkObjectFactoryNewMacro | ( |  | thisClass | ) | thisClass* thisClass::New() { VTK_OBJECT_FACTORY_NEW_BODY(thisClass); }

Definition at line 359 of file vtkObjectFactory.h.

## ◆ vtkAbstractObjectFactoryNewMacro

#define vtkAbstractObjectFactoryNewMacro | ( |  | thisClass | ) | thisClass* thisClass::New() { VTK_ABSTRACT_OBJECT_FACTORY_NEW_BODY(thisClass); }

Definition at line 365 of file vtkObjectFactory.h.

## Variable Documentation

## ◆ vtkObjectFactoryRegistryCleanupInstance

vtkObjectFactoryRegistryCleanup vtkObjectFactoryRegistryCleanupInstance
| static

Definition at line 283 of file vtkObjectFactory.h.