Hi Gerrit,
Gerrit Voß wrote:
> On Thu, 2009-03-26 at 17:21 -0500, Carsten Neumann wrote:
>> Gerrit Voß wrote:
> IIRC we had this discussion before but I don't exactly recall why we
> choose the current form.
it was problematic for the regular ref count, because it would become
hard to tell when an aspect copy is not needed anymore. Also, going to
the AspectStore for every ref count change seems expensive - weak ref
counts are much less common of course.
>> Then we
>> can destroy the FieldContainer objects when the last strong reference
>> goes away, but the weak pointer can still detect this (the aspect store
>> will have a NULL pointer for the current aspect). A side-effect of this
>> is that all WeakPtr will in fact be MTWeakPtr, but there should be few
>> of them compared to the regular pointers, so the penalty for going to
>> the AspectStore should overall not be too big.
>
> I don't like the weak ptrs are always MT ptrs setup. I don't have a
> problem with jumping through the aspect store but the logic should stay
> the same.
hm, I think we would have to keep the aspect the weak pointer belongs to
in the pointer object.
> Let me change things back to the original order/sequence and think about
> it, you can't switch to the aspect store that easy because nothing
> inside OpenSG really stores a weak ptr object and before we start to
> mess around with it I want to be sure we absolutely have to ;)
agreed. I started looking into the implementation, the WeakRefCountPtr<>
template is not hard to write, but the fields looked to be more painful,
since they would not store something convertible to FieldContainer *.
So, if we can come up with another solution I'm all for it :)
Cheers,
Carsten
------------------------------------------------------------------------------
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users