[vtk-developers] Class Event Observers

John Biddiscombe biddisco at cscs.ch
Thu Aug 11 12:16:08 EDT 2005


Adding a static member to every single vtk class via one of the type 
macros would be wasteful when you probably only really want to monitor a 
few selected classes (especially for those of us not using them). Would 
it not be better to derive your own Object factories and insert some 
relevent tracking/management code in there?

JB


Goodwin Lawlor wrote:

> Hi All,
>
> I'd appreciate any thoughts people may have on a proposal for 
> class/global event observers.
>
> One way I thought of implementing this is to add a static member 
> pointer to each class, pointing to the first class observer. Something 
> like:
>
> static vtkObserver *GlobalStart;
>
> and having a new method:
>
> vtkObject::AddClassObserver(unsigned long event, vtkCommand *, float 
> priority = 0.0, const char *class)
>
> where "const char *class" is the class getting the new class observer. 
> Maybe, this should be a pointer to "this" or something else.
>
> Perhaps, this could easily be put in to one of the macros.
>
> Anyone done this, know an existing way or foresee any problems I'm 
> going to hit?
>
> Thanks,
>
> Goodwin
> _______________________________________________
> vtk-developers mailing list
> vtk-developers at vtk.org
> http://www.vtk.org/mailman/listinfo/vtk-developers



-- 
John Biddiscombe,                            email:biddisco @ cscs.ch
http://www.cscs.ch/about/BJohn.php
CSCS, Swiss National Supercomputing Centre  | Tel:  +41 (91) 610.82.07
Via Cantonale, 6928 Manno, Switzerland      | Fax:  +41 (91) 610.82.82





More information about the vtk-developers mailing list