Hi Robert,
On Wednesday 24 January 2007 16:09, Robert Osfield wrote:
> It has occurred to me that perhaps we could put the list of observers
> in a singleton rather attached to each Referenced object. This
> singleton would have a something like a map<Referenced*,set<
> Observer*>> and a single mutex to protect this data structure.
>
> There are instances of smart pointers that have non instrusive ref
> counters done in this way. The OSG could use this approach, but its
> not a good for performance so I've avoided it. However, very few
> objects have observers so its not a cost that you'll pay too often -
> the only extra cost is the call to the singleton on deletion to tell
> it that you are no longer around. The later could possible be avoid
> via use of an atomic count of number of observers - if its non zero
> then you call the singleton.
>
> Another variation on this would be for the singleton to simple be a
> DeleteHandler (note that support already exists in Refernced for this)
> and build in the observer support.
I have that still on my radar, but currently no time left ...
Greetings
Mathias
--
Dr. Mathias Fröhlich, science + computing ag, Software Solutions
Hagellocher Weg 71-75, D-72070 Tuebingen, Germany
Phone: +49 7071 9457-268, Fax: +49 7071 9457-511
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/