Skip to content
Snippets Groups Projects
Commit 874a7d8b authored by David C. Lonie's avatar David C. Lonie
Browse files

Deprecate vtkObjectFactory::ConstructInstance(const char*)

Removing this method in favor of using
vtkObjectBase::InitializeObjectBase, since it uses a user-supplied string.
This approach has proven fragile with templated classes.

Plus, the method is only a thin wrapper around
vtkDebugLeaks::ConstructClass and doesn't need to be.
parent e5c793db
No related branches found
No related tags found
No related merge requests found
......@@ -70,11 +70,20 @@ vtkObject* vtkObjectFactory::CreateInstance(const char* vtkclassname,
return 0;
}
void vtkObjectFactory::ConstructInstance(const char*)
#ifndef VTK_LEGACY_REMOVE
void vtkObjectFactory::ConstructInstance(const char *vtkclassname)
{
// no-op. Call vtkObjectBase::InitializeObjectBase() from the New()
// implementation instead.
// implementation instead. That way we ensure that the
// registration/deregistration strings match.
VTK_LEGACY_REPLACED_BODY(vtkObjectFactory::ConstructInstance, "VTK 7.1",
vtkObjectBase::InitializeObjectBase);
#ifdef VTK_DEBUG_LEAKS
vtkDebugLeaks::ConstructClass(vtkclassname);
#endif // VTK_DEBUG_LEAKS
}
#endif // not VTK_LEGACY_REMOVE
// A one time initialization method.
void vtkObjectFactory::Init()
......
......@@ -66,8 +66,10 @@ public:
/**
* No longer used. Call vtkObjectBase::InitializeObjectBase() from the
* New() implementation instead.
* @deprecated because this method relies on taking an arbitrary string,
* which may not match the GetClassName() string (especially for templates).
*/
static void ConstructInstance(const char* vtkclassname);
VTK_LEGACY(static void ConstructInstance(const char* vtkclassname));
/**
* Create all possible instances of the named vtk object.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment