On 8-Apr-07, at 11:02 AM, Theodore H. Smith wrote:
>
> My RingTree class (part of the ElfData plugin, only compiles to 4K)
> actually uses weak references, internally. Without all the RAM
> overhead normally associated with weak references.
>
> It just doesn't really advertise the fact that it uses weak
> references. All it advertises is that it makes a tree.
>
> AND it uses it for the most important purpose of weak references. To
> build trees that automatically dispose themselves! It's nice to be
> able to move up and down a tree, without it making cyclical refs.

You can make a self-cleaning tree in RB code without weakrefs, though  
you need to call the plugin API's Lock/Unlock functions - the  
framework provides these if you know where to look ;) I use this  
technique to travel a 3D scenegraph upwards from a leaf node and have  
been very satisfied with the results.

There are times weakrefs come in handy beyond tree structures  
however. E.g. I'd refactor my file caching system to use weakrefs if  
I had 2007r2, but I'm stuck with 2007r1 for the next few months at  
least.

Frank.
<http://developer.chaoticbox.com/>
<http://macgameblog.com/>


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to