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

List:       kde-core-devel
Subject:    Re: Proposed new KDateTime class
From:       David Jarvie <lists () astrojar ! org ! uk>
Date:       2005-11-15 13:17:42
Message-ID: 20051115131348.2442.qmail () ktown ! kde ! org
[Download RAW message or body]

On Mon, Nov 14 2005 at 11:06, Tobias Koenig wrote:

>On Mon, Nov 14, 2005 at 01:10:41AM +0000, David Jarvie wrote:
>> operator>(): are these needed?
>Yes, they are. In 4.0 we'd like to be able to serialize libkcal objects,
>so a serializer for a datetime class is a must.

That would require a serialiser for the KTimezone class (which is one of the private 
components of KDateTime). KTimezone is polymorphic, so you couldn't have
    operator>>(QDataStream&, KTimezone&)
because the memory size required by the KTimezone object would be unknown.

Presumably this would have to be implemented as
    operator>>(QDataStream&, KTimezone*&)
instead, with the serialisation method constructing a new KTimezone of the appropriate class, 
and returning a pointer to it. The problem then would be how operator>>() would be able to 
determine which KTimezone sub-class was contained in the QDataStream, given that it doesn't 
know what classes may in the future be derived from it. I can't see how to resolve this 
problem, so if anybody has any suggestions ...

--
David Jarvie.
KAlarm author & maintainer.
http://www.astrojar.org.uk/linux/kalarm.html
[prev in list] [next in list] [prev in thread] [next in thread] 

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