[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: New qt copy?
From:       Matthias Ettrich <ettrich () troll ! no>
Date:       2000-02-18 10:20:41
[Download RAW message or body]

> It's not a QShared so it's shared ???
> 
> I don't get it, I guess you'll have to teach me :-)
> (Or I'll read the source code when we've updated qt-copy :-))
> 


Really shared classes contain a data pointer to a QShared object. They hide the
fact that they are doing sharing.

Old QVariant didn't do that but inherited QShared, so that it was possible to
use it as shared object in combination with a QSharedPoint (a Torben idea, I
guess ;-)

History. Forget QShared and use QVariant, it's shared ;-)

To illustrate the issue, here's the sourcecode to QShared:

struct QShared
{
    QShared()		{ count = 1; }
    void ref()		{ count++; }
    bool deref()	{ return !--count; }
    uint count;
};


Matthias

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic