heremaps / gluecodium

Cross-language bindings generator for C++, Java, Swift, and Dart
Apache License 2.0
202 stars 27 forks source link

Add support for multiple inheritance #723

Closed DanielKamkha closed 3 years ago

DanielKamkha commented 3 years ago

Add support for multiple inheritance in LIME IDL and in generators. The multiple inheritance should function in the style of modern programming languages: zero or one class parent, any number of interface parents.

The feasibility of this approach was positively assessed in #697.

DanielKamkha commented 3 years ago

Further experimentation shows that the way C++ pointers work for parent types beyond the first parent interferes with Gluecodium's "type repository" system, making this system (kind of primitive RTTI) unusable with multiple inheritance.

Multiple inheritance could be potentially implemented using C++ own RTTI (typeid operator in particular). But this would require a complete rewrite of how Gluecodium preserves type information across language boundaries. Current consensus is that such a rewrite is not worth the effort, as there is not actual current requirement for multiple inheritance from any Gluecodium users.

DanielKamkha commented 3 years ago

Current efforts were preserved in https://github.com/heremaps/gluecodium/tree/shelve-multiple-inheritance branch.