[vtk-developers] [Paraview-developers] Moving vtkMemberFunctionCommand to VTK

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Wed Oct 6 09:06:25 EDT 2010


I like your changes. In absence of your changes, if a developer does
indeed want to achieve same effect he'll be doing something similar
and will indeed have the onus of worrying about dangling ptrs. So I
don't think this makes it any more confusing. We should probably add
documentation to that effect and that pretty much should do it.

About the dynamic_cast, yea static_cast should be fine too and totally
safe in this case. If the developer was stupid enough to pass in a ptr
as a wrong type when making the AddObserver call, he deserves the side
effects :).

I'd vote for committing your changes. (You should use the stage, add
your commit to the "member_function_observers" branch and then merge
it in).

Utkarsh

On Wed, Oct 6, 2010 at 8:24 AM, David Gobbi <david.gobbi at gmail.com> wrote:
> On Wed, Oct 6, 2010 at 6:01 AM, David Doria <daviddoria at gmail.com> wrote:
>>
>> David G,
>>
>> Are you suggesting this in place of what Utkarsh pushed? Utkarsh, can
>> you take a look and let David G know if he should push it? I think it
>> is a good idea to allow event handling from as many places as possible
>> (i.e. I support NOT requiring the class to derive from vtkObjectBase).
>
> I'm just putting it out for discussion.  It does come with some danger,
> for example you should not use it instead of vtkEventQtSlotConnect,
> because Qt's signal/slot mechanism is safe, and this is not.  It's only
> safe when the listener is a vtkObjectBase class.
>
>  David
>



More information about the vtk-developers mailing list