Hello David<br><br>Thanks for the suggestion: I am concerned by the overhead that comes with variants. Wouldn't it be more lightweight to use a vtkVoidArray instead? The array can potentially contain O(10⁶) pointers. By the way this is for the same reason that I have, so far, refrained from using vtkSmartPointers as opposed to raw pointers, by fear of the overhead involved. Is this extra caution excessive?<br>
<br>Thanks<br>Philippe <br><br><div class="gmail_quote">On Tue, Nov 20, 2012 at 5:31 PM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Philippe,<br>
<br>
If the pointers are pointers to VTK objects, then you can use vtkVariantArray.<br>
<br>
 - David<br>
<br>
<br>
On Tue, Nov 20, 2012 at 9:29 AM, Philippe Pébay<br>
<div class="HOEnZb"><div class="h5"><<a href="mailto:philippe.pebay@kitware.com">philippe.pebay@kitware.com</a>> wrote:<br>
> Just an idea: couldn't a vtkVoidArray be used (or abused) as container of<br>
> raw pointers, that would be appropriately downcasted internally to the<br>
> concrete type to which they are supposed to point? For instance, instead of<br>
> having a<br>
>  vtkMyInternalObject** obj<br>
> instance variable, couldn't I use a<br>
>  vtkVoidArray* obj<br>
> instead, where each entry in obj would be the raw pointer to a<br>
> vtkSmartPointer<vtkMyInternalObject>?<br>
><br>
> Thanks<br>
> Philippe<br>
><br>
><br>
> On Tue, Nov 20, 2012 at 5:14 PM, Philippe Pébay <<a href="mailto:philippe.pebay@kitware.com">philippe.pebay@kitware.com</a>><br>
> wrote:<br>
>><br>
>> Hello Kyle<br>
>><br>
>> Yes, I would want to avoid a dependency on Boost. But this is basically<br>
>> what I am tried to reproduce (the Boost shared array of pointers).<br>
>><br>
>> Thanks<br>
>> P<br>
>><br>
>><br>
>> On Tue, Nov 20, 2012 at 5:13 PM, Kyle Lutz <<a href="mailto:kyle.lutz@kitware.com">kyle.lutz@kitware.com</a>> wrote:<br>
>>><br>
>>> Would using boost suffice? Or do you want a solution using just VTK?<br>
>>><br>
>>> -kyle<br>
>>><br>
>>> On Tue, Nov 20, 2012 at 7:58 AM, Philippe Pébay<br>
>>> <<a href="mailto:philippe.pebay@kitware.com">philippe.pebay@kitware.com</a>> wrote:<br>
>>> > Hello all,<br>
>>> ><br>
>>> > I need to keep track of shared ownership of an array of pointers. Can<br>
>>> > someone point me towards an example of code that already does this?<br>
>>> > This<br>
>>> > should amount to a small helper class that contains the array of<br>
>>> > pointers<br>
>>> > along with a reference count.<br>
>>> ><br>
>>> > Thank you!<br>
>>> > Philippe<br>
>>> ><br>
>>> ><br>
>>> > --<br>
>>> > Philippe Pébay, PhD<br>
>>> > Director of Visualization and High Performance Computing /<br>
>>> > Directeur de la Visualisation et du Calcul Haute Performance<br>
>>> > Kitware SAS<br>
>>> > 26 rue Louis Guérin, 69100 Villeurbanne, France<br>
>>> > <a href="tel:%2B33%20%280%29%206.83.61.55.70" value="+33683615570">+33 (0) 6.83.61.55.70</a> / 4.37.45.04.15<br>
>>> > <a href="http://www.kitware.fr" target="_blank">http://www.kitware.fr</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><font color="#888888">Philippe Pébay, PhD<br></font><font color="#888888">Director of Visualization and High Performance Computing /<br>
</font><font color="#888888">Directeur de la Visualisation et du Calcul Haute Performance<br>
Kitware SAS<br>26 rue Louis Guérin, 69100 Villeurbanne, France</font><br>
<font color="#888888"><a value="+33426685003">+33 (0) 6.83.61.55.70 / 4.37.45.04.15</a></font><font color="#888888"><br><a href="http://www.kitware.fr/" target="_blank">http://www.kitware.fr</a></font><font color="#888888"><a href="http://www.kitware.fr/" target="_blank"></a></font><br>