[vtk-developers] Smart pointer declaration macro?
Aashish Chaudhary
aashish24 at gmail.com
Thu Jan 28 11:11:12 EST 2010
my vote is for 1) and I did the survey.
I think ideally it should have been (like Brad said)
vtkSmartPointer<vtkPolyData> refPtr = vtkPolyData::New();
But to maintain backward compatibility and other reasons any other
change is just a workaround. So I think its just better to keep things
as it is in which case
we would have to hit some extra keys twice.
The way I see it is this smart pointer is a somewhere between boost
shared_ptr / scope pointer / c++ auto ptr mix
(http://www.boost.org/doc/libs/1_41_0/libs/smart_ptr/smart_ptr.htm)
(may be, may be not depends on opinion).
In another very popular open source scene graph library ref_ptr class
is created and used
http://www.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00581.html
which gives us the syntax we are kind of hoping for...
my 2 cents..
On Thu, Jan 28, 2010 at 10:52 AM, Wes Turner <wes.turner at kitware.com> wrote:
> I vote for 1. I also took the survey.
> - Wes
>
> On Thu, Jan 28, 2010 at 10:45 AM, David Gobbi <david.gobbi at gmail.com> wrote:
>>
>> I kind of like having the votes here on the list. With online
>> surveys, not only is it very easy for someone to cheat, but you don't
>> know who voted for what. Anonymity of any sort has no place on the
>> VTK developers list IMHO.
>>
>> David
>>
>>
>> On Thu, Jan 28, 2010 at 8:35 AM, Karthik Krishnan
>> <karthik.krishnan at kitware.com> wrote:
>> > I vote for (1) - leaving things the way they are... I also made it
>> > known on the DavidDoria's survey.
>> >
>> > On Thu, Jan 28, 2010 at 10:33 AM, David Gobbi <david.gobbi at gmail.com>
>> > wrote:
>> >> I vote for:
>> >>
>> >> 4. vtkLocalPointer<vtkClass> instance;
>> >>
>> >> - David
>> >>
>> >> On Thu, Jan 28, 2010 at 8:31 AM, Marcus D. Hanwell
>> >> <marcus.hanwell at kitware.com> wrote:
>> >>> On Thursday 28 January 2010 10:16:24 Jeff Baumes wrote:
>> >>>> On Thu, Jan 28, 2010 at 10:00 AM, Will Schroeder
>> >>>>
>> >>>> <will.schroeder at kitware.com> wrote:
>> >>>> > Jeff can you summarize the proposed solutions (assuming we think
>> >>>> > we've
>> >>>> > covered the bases) and let's take a vote on this. I want to keep my
>> >>>> > inbox
>> >>>> > clear :-(
>> >>>>
>> >>>> 1. Keep things the way they are:
>> >>>> vtkSmartPointer<vtkClass> c = vtkSmartPointer<vtkClass>::New();
>> >>>>
>> >>>> 2. Add new constructor to vtkSmartPointer that takes a bool and if
>> >>>> true creates an instance of the object. Code would look like:
>> >>>> vtkSmartPointer<vtkClass> c(true);
>> >>>>
>> >>>> 3. Create typedefs for vtkSmartPointer<vtkClass>:
>> >>>> vtkClassSP c = vtkClassSP::New();
>> >>>>
>> >>>> 4. Make a new vtkLocalPointer type that is the same as
>> >>>> vtkSmartPointer
>> >>>> but always creates an instance of the object.
>> >>>> vtkLocalPointer<vtkClass> c;
>> >>>>
>> >>>> Unfortunately our inboxes won't be clear until everyone responds with
>> >>>> a vote (I'd maybe give it till 12pm eastern time). We can take it to
>> >>>> the ARB if there is no clear consensus.
>> >>>>
>> >>> My favorite is 4, then 2. I was thinking of reasonably concise API, I
>> >>> think 1
>> >>> has needless repetition and does not make the code any clearer.
>> >>>
>> >>> 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
>> >>
>> >>
>> > _______________________________________________
>> > 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
>> >
>> >
>> _______________________________________________
>> 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
>>
>
>
>
> --
> Wesley D. Turner, Ph.D.
> Kitware, Inc.
> Technical Leader
> 28 Corporate Drive
> Clifton Park, NY 12065-8662
> Phone: 518-881-4920
>
> _______________________________________________
> 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