[vtk-developers] Smart pointer declaration macro?
Aashish Chaudhary
aashish24 at gmail.com
Thu Jan 28 11:28:23 EST 2010
My response below:
>
> leading to:
>
> vtkSmartPointer<vtkObject> c = vtkNew<vtkPolyData>();
>
> Beyond that, the verbosity is an artifact of using C++ as a language
> and the non-abbreviated name "vtkSmartPointer". We could change it
> to something shorter, like "vtkRef", but that will just leave two
> names for the same thing.
I like this suggestion but I think it does not make the code any more
cleaner / readable. I like Tim's suggestion to clean up the API a bit
(if given we are going to create new classes).
I think in the future if ARB decides to break the backward
compatibility for one or more reasons then probably it would be a good
time to do a over haul on how smart pointers are used / created in
VTK.
Just for reference OpenSG (similar to OpenSceneGraph, popular SG in
Germary) (another library that I used) had to do this transition for
the same / similar and related issues and it was little painful.
At that time then we can think about some other pointer types such as
transient pointers (can be used as a return value for the function),
scope pointers, true weak pointers and so on.
Just my 2 cents :)
>
> -Brad
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>
More information about the vtk-developers
mailing list