Draft C Cpp Interoperability

pnoltes edited this page May 29, 2012 · 2 revisions

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.

Interface Bundle

Specify the structure of an interface bundle...

For now, see the experimental code at https://github.com/abroekhuis/NativeOSGi/tree/master/sandbox