[Marble-devel] Review Request: provide nodeType information for downcasting

Andrew Manson g.real.ate at gmail.com
Sun Jul 26 12:04:46 CEST 2009


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?

- Andrew 


More information about the Marble-devel mailing list