Draft C Cpp Interoperability
Clone this wiki locally
C and C++ Interoperability
Attention: This is a draft
Technical Notes from the Hengelo meeting (22/05/2012)
- If feasible, make it possible to consume and provide native C or C++ services through both the C and C++ framework API
- Each bundle would provides a C and C++ header for all service interfaces
- One could be generated out of the other, or use a common IDL
- Bindings for C -> C++ and C++ -> C to translate method calls
- A C bundle provides a C++ wrapper class (generated/macro?) in a C++ shared library for the C interface struct which can be used by a C++ consumer
- A C++ (interface) bundle will contain (generated?) C-function bindings to provided access to the C++ interface class
- For full cross-platform and compiler support, each bundle (native C or C++) exposing some services will have to provide a C++ shared library containing RTTI symbols for the interface classes. This will allow dynamic casts between interfaces across library boundaries.
Specify the structure of an interface bundle...
For now, see the experimental code at https://github.com/abroekhuis/NativeOSGi/tree/master/sandbox