We are going to redesign the inheritance system in ChibiOS/HAL.
Among the changes:
- All classes will descend from a common ancestor "BaseObject".
- Simple inheritance will be done just like now, by extending data and VMT macros.
- Multiple inheritance will be completely redesigned.
- Multiple inheritance will be implemented by including the whole ancestor structureS into the object.
- Multiple inheritance will allow to inherit both pure interfaces (with no data associated) and classes (methods with associated data).
- Calling a method will always pass the pointer to the proper inherited object structure (interface pointer, where the VMT is).
- Obtaining the pointer to the object (instance pointer) starting from an interface pointer will be done by subtracting an offset written in the first element of a VMT (using a macro objGetInstance()).
- VMT fields will always be called "vmt", no need to have different names any more.
The repository is going "unstable" until things are complete, not a huge problem because we just branched 18.2.0 so nothing new in trunk yet.
This new system will be backported to 18.2.x for sure, we are evaluating if to backport to 17.4.x too.
This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome.
2 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 3 guests