Hello Pepijn, Very interesting and indeed I think Celix can benefit from this. I also like the fact that the interface between C and C++ is very minimal and clear in this way. Looking at the code I noticed you need at least C++11, please state that explicitly.
Questions that I have: 1. can I (or should I) deploy the C and C++ dependency manager in the same framework? 2. I notice you use the STL library. Does your code follow the guidelines for embedded/realtime programming and the use of STL? (look on the Internet for discussion using new/delete and memory fragmentation, std::list<> usage and automatic resizing, no exception handling, no RTTI) 3. Should the header files not have a distinct extension? Another point I want to mention to everyone: there has been some activity to integrate RUST with Celix by Rogier Velting, see https://github.com/RogierWV/rust-celix With kind regards, Gerrit On Wed, Jul 27, 2016 at 9:51 PM, Pepijn Noltes <pepijnnol...@gmail.com> wrote: > Hi All, > > I few day ago I pushed the Apache Celix C++ dependency manager [1] to the > development branch. > I have been busy with experimenting how to support other languages to Celix > for quite some time, but I finally convinced that this is best done with > use of the dependency manager. > > The C++ dependency manager is build on top of the C dependency manager. > I have chosen to add C++ support using C dependency manager approach > instead of wrapper the complete Celix API for the following reasons: > > 1. The Dependency Manager is arguably the most convenient way to interact > with services and covers most uses cases. > 2. It eliminates the necessity to port and maintain the rest of the (large) > API to C++. > 3. Because the relatively small codebase needed to build on top of the C > dependency manager this opens the possibility to support other languages > (e.g. D, Swift). In my opinion one of the benefits of C as programming > language it that can act as a common denominator for interoperability > between a range of languages. > > With the C++ dependency manager it is possible to provide C and C++ > services, where C++ services are registered by providing the object > instance in combination with an interface name (more like in java). It is > also possible to specify C and/or C++ service dependencies. > If a service is register as a C++ service the C++ dependency manager will > ensure that a properties "lang=c++" is added. Also when C++ service > dependency is specified the C++ dependency manager ensures the filter is > extended with "(lang=c++)". > > I think Celix can benefit, in terms of popularity, from adding C++ as > supported language. I also still think that Apache Celix should primarily > focus on providing services in the form of C services (e.g. struct of > function pointers) as this should be the common denominator. > > Any comment or though are welcome. Also feel free to have a more in depth > look at the C++ dependency manager and let me know what you think. > > [1] https://github.com/apache/celix/tree/develop/dependency_manager_cxx > > Greetings, > Pepijn >