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

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Wed Oct 6 11:19:03 EDT 2010


Looks good to me.

Utkarsh

On Wed, Oct 6, 2010 at 11:11 AM, David Gobbi <david.gobbi at gmail.com> wrote:
> I thought that I'd shoot this out for other people to proofread, so
> that I don't have to do any follow-up commits to vtkObject.h just for
> spelling mistakes and whatnot.  Thanks.
>
>  // Description:
>  // Overloads to AddObserver that allow developers to add class member
>  // functions as callbacks for events.  The callback function can
>  // be one of these two types:
>  // \code
>  // void foo(void)
>  // void foo(vtkObject*, unsigned long, void*)
>  // \endcode
>  // If the callback is a member of a vtkObjectBase-derived object,
>  // then the callback will automatically be disabled if the object
>  // destructs (but the observer will not automatically be removed).
>  // If the callback is a member of any other type of object, then
>  // the observer must be removed before the object destructs or else
>  // the observer will be left with a dangling pointer to a dead object.
>  // Typical usage of these functions is as follows:
>  // \code
>  // vtkHandlerClass * observer = vtkHandlerClass::New();
>  // to_observe->AddObserver(
>  //   event, observer, &vtkHandlerClass::CallbackMethod);
>  // \endcode
>  // Note that this does not affect the reference count of a
>  // vtkObjectBase-derived \c observer, which can be safely deleted
>  // with the observer still in place. For non-vtkObjectBase observers,
>  // the observer should never be deleted before it is removed.
>  // Return value is a tag that can be used to remove the observer.
> _______________________________________________
> 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