[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. This forum is NOT for support.
User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

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

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

Hi,

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.

Giovanni

faisal
Posts: 374
Joined: Wed Jul 19, 2017 12:44 am
Has thanked: 44 times
Been thanked: 60 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 20 guests