[Marble-devel] Review Request: provide nodeType information for downcasting
Jens-Michael Hoffmann
jensmh at gmx.de
Sun Jul 26 13:07:51 CEST 2009
Am Sunday 26 July 2009 12:04:46 schrieb Andrew Manson:
>
> On Saturday 25 July 2009 13:20:51 jensmh at gmx.de wrote:
> > 1) casting in C++ is like goto in C, we should not use it.
>
> You see this is the problem with the current GeoData approach! We need to have
> some way to cast back to what is inserted into a GeoDataDocument or a
> GeoDataContainer because this information is currently lost because it is pass
> by reference and ultimately everything is statically downcast to a
> GeoDataFeature and we loose our typing information.
>
> > 2) if we want to cast in a safe way, we should use the compilers RTTI, or
> >maybe Qt's, but not build our own RTTI
>
> If we were to use the compilers RTTI then we would have to redo the whole
> design of GeoData, which I can safely say that at this stage nobody wants to
> do! But on the other side if we wanted to use Qt's RTTI then we would have to
> make every GeoData a QObject, which is more than likely a bit of overkill no?
sure, I agree.
I'm not against applying this patch, but I think we should know that we are doing
something which is conceptually wrong (imho) and we should know why we do it.
More information about the Marble-devel
mailing list