[vtk-developers] Smart pointer declaration macro?

Jeff Baumes jeff.baumes at kitware.com
Thu Jan 28 10:16:24 EST 2010


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.

Jeff

>
>
> On Thu, Jan 28, 2010 at 9:58 AM, Sebastien BARRE
> <sebastien.barre at kitware.com> wrote:
>>
>> +1, especially as a foreigner. If you don't speak/read English that well,
>> abbreviations are not all that obvious and bring one more mental gymnastic
>> to the table, slowing down the whole process of remembering the right
>> name...
>>
>> At 1/28/2010 08:50 AM, Will Schroeder wrote:
>>
>> Sorry, I don't like the abbreviation, I love change :-)
>>
>>
>> On Thu, Jan 28, 2010 at 8:45 AM, Jeff Baumes <jeff.baumes at kitware.com >
>> wrote:
>> On Wed, Jan 27, 2010 at 10:58 AM, Will Schroeder
>> < will.schroeder at kitware.com> wrote:
>> > VTK has a verbose, self documenting style (for better or worse). I'd
>> > like to
>> > stick with it if possible.
>>
>> Will,
>>
>> Are you suggesting no change? Or just that you don't like the
>> abbreviated typedefs like vtkRendererSP?
>>
>> Jeff
>
>
>
> --
> William J. Schroeder, PhD
> Kitware, Inc.
> 28 Corporate Drive
> Clifton Park, NY 12065
> will.schroeder at kitware.com
> http://www.kitware.com
> (518) 881-4902
>



More information about the vtk-developers mailing list