On Fri, 2008-03-14 at 13:57 +0100, Maximilian Albert wrote:
So for each SPObject a corresponding C++ class needs to be created which encapsulates its functionality, and all the SPObject "methods" would be changed to only call the corresponding ones of the new class (as seems to already be the case in sp-item-group.cpp). Is that correct or am I getting something completely wrong here? Should we keep a list on the wiki for which SPObjects this conversion has already be done so that we can keep track of the progress?
I'm not happy with the approach that was taken with CGroup -- I think it's an unmaintainable mess, and we'd be unlikely to ever finish the migration if we went that route.
My preferred approach would be to replace GObject with NRObject in the SPObject hierarchy, removing the inter-SPObject refcounting (which would create unbreakable GC cycles) and explicit member initialization (no longer needed, as NRObject calls the C++ constructor/destructors). At that point we can start using all C++ features directly in the existing SPObject classes.
It's a big hurdle to get over initially, but it's one shot, and once we do it we can start improving the design and adopting native C++ features organically and incrementally.
-mental