2013/9/14 Markus Engel <p637777@...1081...>:
Okay. We have to be careful, though, as dynamic_casts add some runtime overhead. After some more refactoring steps we hopefully can omit most of these type checks.
The original GObject implementation calls a function which is equivalent to dynamic_cast, so I think the performance will remain the same.
SP_TYPE() macros should be reimplemented as dynamic_cast so that they generate compile-time errors when something not derived from SPObject is passed.
I checked that and it is currently impossible without changing a huge amount of code. Some parts use these GSLists and they store void-pointers. Thousands of SP_TYPE-lines would fail compilation. I'd suggest doing this change later.
OK, I forgot about Glib-style lists.
Regards, Krzysztof