[INFO] Redesign of OOP patterns, trunk repository going unstable

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome.
User avatar
Site Admin
Posts: 11647
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 488 times
Been thanked: 409 times

[INFO] Redesign of OOP patterns, trunk repository going unstable

Postby Giovanni » Fri Feb 23, 2018 2:30 pm


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.


Posts: 227
Joined: Wed Jul 19, 2017 12:44 am
Has thanked: 32 times
Been thanked: 31 times

Re: [INFO] Redesign of OOP patterns, trunk repository going unstable

Postby faisal » Fri Feb 23, 2018 10:33 pm

Thank you very much for giving this attention! Appreciate it.

Return to “Development and Feedback”

Who is online

Users browsing this forum: No registered users and 4 guests