[vtk-developers] Maybe ABSTRACT isn't needed

Marcus D. Hanwell marcus.hanwell at kitware.com
Wed Oct 24 11:20:25 EDT 2012


Marcus D. Hanwell, Ph.D.
Technical Leader, Kitware Inc.
(518) 881-4937


On Wed, Oct 24, 2012 at 12:43 AM, David Gobbi <david.gobbi at gmail.com> wrote:
> On Tue, Oct 23, 2012 at 11:40 AM, Brad King <brad.king at kitware.com> wrote:
>>
>> IMO it is still worth dropping the wrappers' need for ABSTRACT
>> if possible.
>
> I've pushed a wrapper patch to gerrit.
>
> I think the instantiators could be similarly fixed, if we added a
> new wrapper tool to build the instantiator source files for each
> module (rather than have the instantiator source created by
> vtkMakeInstantiator.cmake like it is now).
>
Did you take into account the abstract base classes that have New
methods that can return NULL? This was carried over from the VTK
factory classes where they would return NULL if the correct set of
defines was not present. Any class using
vtkAbstractObjectFactoryNewMacro can and does return NULL if an
override was not specified. This is so that the interface class can be
instantiated, and the correct derived form returned at runtime.

Several of those classes are pure virtual, and so preserving the
existing behavior seemed like the only reasonable course of action. If
New can never return NULL (I didn't see that anywhere, and found
several places where this was not the case) then the abstract object
factory new macro would need to be modified, it could call abort or
similar if that was desirable? I didn't think too deeply about this,
and preserved the behavior that was already present although it is
easier to see this present in applications now.

Marcus



More information about the vtk-developers mailing list