[vtk-developers] RFC: vtkScopedPointer - a new hope?

Marcus D. Hanwell marcus.hanwell at kitware.com
Mon Jan 31 10:29:38 EST 2011


Hi Karthik,

It is merged now, and there seemed to be quite a good consensus on
vtkNew. Brad said there was precedent in using the word New as it
instantiates, and anything that instantiates vtkObject derived classes
has new in the name. I quite liked having the word pointer in the name
too, but the conciseness of vtkNew and the support for that name made
it take the lead.

I just converted a few tests in charts to use it and see no new
issues. It is in Doxygen now too.

Marcus

On Mon, Jan 31, 2011 at 10:23 AM, Karthik Krishnan
<karthik.krishnan at kitware.com> wrote:
> Dear Marcus:
>
> Sorry for the late comments on the naming convention..
>
> Despite its verbosity, I like the older name (vtkScopedPointer),
> specifically the "Pointer" fragment. The Scoped fragment is open to
> discussion.
>
> Its has a naming convention and its easy to explain to someone. We have a
> vtkWeakPointer, vtkSmartPointer, vtkScopedPointer.  Just like we use Reader,
> Writer, Mapper, Actor, Widget, Data suffixes, it seems appropriate to have
> the "Pointer" suffix here.
>
> Thanks
> --
> karthik
>
> On Wed, Jan 26, 2011 at 8:10 PM, Marcus D. Hanwell
> <marcus.hanwell at kitware.com> wrote:
>>
>> I just merged the vtkNew topic branch. I will keep an eye on the
>> dashboards. Personally, I think it is a good addition but due to VTK's
>> API (largely passing pointers around as function arguments) I can see
>> some motivation (and precedent from vtkSmartPointer) for opening up
>> the API later. This is totally possible should there be motivation to
>> do so.
>>
>> There are a few ideas I have to make it more useful in the future, but
>> I think even in its current form it should enable us to write more
>> concise, readable code. Let me know if there is anything I missed, I
>> am very tempted to add a Get() method that returns the pointer, in
>> addition to the more standard GetPointer() for example.
>>
>> Thanks for all of the comments and feedback.
>>
>> Marcus
>> _______________________________________________
>> 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