[PD-dev] # of instances of an object

Miller Puckette mpuckett at man104-1.ucsd.edu
Sun Nov 7 19:55:37 CET 2004


It can be static (doesn't have to be global) --- and that's the way I
do similar things; this comes up all over the Pd source code.

cheers
Miller

On Sun, Nov 07, 2004 at 01:50:16PM -0500, Hans-Christoph Steiner wrote:
> 
> So here's my problem:
> 
> An object's _free function is called when any instance is deleted.  I  
> need to send a free msg to the MacOS X HID Manager only when the last  
> instance is deleted.  Should I just use a global variable to keep track  
> of the instances, or can anyone think of a better solution?
> 
> .hc
> 
> On Nov 6, 2004, at 6:24 PM, Miller Puckette wrote:
> 
> >Nope... Pd doesn't track instances of things...
> >
> >You could write C code to traverse all open canvases to find them, if
> >you really wanted to.
> >
> >cheers
> >Miller
> >
> >On Sat, Nov 06, 2004 at 05:51:23PM -0500, Hans-Christoph Steiner wrote:
> >>
> >>Is there anyway I can get how many instances of my object are
> >>instantiated from Pd?  I could keep track of this myself, but I figure
> >>if I can get it from Pd, that would be all the better.
> >>
> >>.hc
> >>
> >>
> >>______________________________________________________________________ 
> >>______
> >>
> >>
> >>"[W]e have invented the technology to eliminate scarcity, but we are
> >>deliberately throwing it
> >>away to benefit those who profit from scarcity."
> >>							-John Gilmore
> >>
> >>
> 
> ________________________________________________________________________ 
> ____
> 
>                   ¡El pueblo unido jamás será vencido!
> 
> 
> _______________________________________________
> PD-dev mailing list
> PD-dev at iem.at
> http://iem.at/cgi-bin/mailman/listinfo/pd-dev




More information about the Pd-dev mailing list