For reference, a wrapping of PyObject has been done here: <a href="https://github.com/commontk/PythonQt/blob/patched-2/src/PythonQtObjectPtr.h">https://github.com/commontk/PythonQt/blob/patched-2/src/PythonQtObjectPtr.h</a><div>
<br></div><div>Hth</div><div>Jc<br><br><div class="gmail_quote">On Tue, Jul 10, 2012 at 3:51 PM, David Lonie <span dir="ltr"><<a href="mailto:david.lonie@kitware.com" target="_blank">david.lonie@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tue, Jul 10, 2012 at 3:47 PM, David Cole <<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>> wrote:<br>
> On Tue, Jul 10, 2012 at 3:39 PM, David Lonie <<a href="mailto:david.lonie@kitware.com">david.lonie@kitware.com</a>><br>
> wrote:<br>
>> On Tue, Jul 10, 2012 at 3:25 PM, David Cole <<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>><br>
>> wrote:<br>
>> > Why are the static New methods of singleton objects in VTK public?<br>
>> > static vtkMathTextUtilities *New();<br>
>><br>
>> That New method just returns the singleton instance after increasing<br>
>> its reference count. Not sure exactly why it was included (the<br>
>> original author of the vtkFreeTypeUtilities pattern may), but I like<br>
>> having it around for use with vtkNew/vtkSmartPointer. I think the VTK<br>
>> user guide also says that all vtkObject subclasses _must_ define it.<br>
><br>
> Right, but I phrased it strangely. My real question was "does static New<br>
> have to be in the public section of the class"?<br>
><br>
> (For a singleton that is created via a call to GetInstance, isn't it a good<br>
> idea to make "New" protected or even private?)<br>
><br>
> Maybe it does need to be public for the wrappers or something, but seems<br>
> like a bad idea to have a public New for a singleton.<br>
<br>
</div></div>It still needs to be public for the smart pointer classes (not a very<br>
compelling reason since singletons don't really need smart pointers,<br>
but it's the best I can come up with).<br>
<br>
Dave<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>+1 919 869 8849<br><br>
</div>