Use of Boost library classes in kdecore?

David Jarvie lists at astrojar.org.uk
Fri Jul 6 23:29:51 BST 2007


On Friday 06 July 2007 23:07:36 koos vriezen wrote:
> 2007/7/7, David Jarvie <lists at astrojar.org.uk>:
> > On Friday 06 July 2007 22:42:39 koos vriezen wrote:
> > > Btw. how many timeszones are there anyhow?
> >
> > In an iCalendar file, I would guess that there would typically be only a
> > small number. There could be other applications in the future which
> > create a much larger number of instances (e.g. of KTzfileTimeZone, if
> > historical information was required for system time zones).
>
> Ok, I thought there wouldn't be more than 24 unique ones, which would
> make a map more obvious ..

There are around 400 time zones in the system time zone database.

> > > > typedef shared_ptr<KTimeZone> KTimeZonePtr;
> > >
> > > Note that this may add other headaches like a pointer ending in two
> > > shared pointers
> >
> > I don't understand.
> >
> > > and the KTimeZone unaware of its own shared_ptr.
> >
> > The KTimeZone doesn't have a shared_ptr - it just contains the reference
> > counter.
>
> Well if they already have a reference counter, why make another
> shared_ptr of it.

They don't currently have a reference counter - I'm proposing to add one.

> Unless you don't get my point, ie. difference between subclassing
> KShared vs. shared_ptr, first is aware of it's shared ptr, second
> isn't.

I'm still unclear. Both of them are aware that their pointers are to a shared 
data object. The two classes appear to be similar, except that KSharedPtr is 
more limited than shared_ptr, and if it were to be used would need to be 
subclassed to add the necessary facilities which shared_ptr already has.

-- 
David Jarvie.
KAlarm author and maintainer.
http://www.astrojar.org.uk/kalarm




More information about the kde-core-devel mailing list