celix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pepijn Noltes <pepijnnol...@gmail.com>
Subject C++ support
Date Wed, 27 Jul 2016 19:51:15 GMT
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


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message