Closed pnoltes closed 4 months ago
Attention: Patch coverage is 88.98072%
with 40 lines
in your changes are missing coverage. Please review.
Project coverage is 89.65%. Comparing base (
423abb8
) to head (8ca876d
). Report is 13 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Currently it is not possible to call celix_bundleContext_trackServices*
functions with a "use tracker service" callback (because a write lock is needed while holding a read lock).
I think this can be enabled using a atomic use count, but I will do that in a separate PR.
For now I will merge this PR.
This pull request introduces several new bundle context C functions and C++ ServiceTracker methods. These additions allow tracked services to be called using callbacks on the current thread through a service tracker or service tracker ID. This method of calling services is expected to be more performant than the useService(s) functions/methods, which invoke callbacks on the event thread.
For C, the following functions where added:
celix_bundleContext_useTrackedService
celix_bundleContext_useTrackedServices
celix_bundleContext_useTrackedServiceWithOptions
celix_bundleContext_useTrackedServicesWithOptions
celix_bundleContext_getTrackedServiceCount
celix_bundleContext_getTrackedServiceName
celix_bundleContext_getTrackedServiceFilter
The signature of the following C function has been changed:
celix_bundleContext_trackServices
. The trackServices function signature is simplified to that it is easier to use when combined with the useTrackerService(s) calls.For C++, the following methods were added:
celix::ServiceTracker<I>::useService<F>
celix::ServiceTracker<I>::useServices<F>
This pull request also prepares the removal of celix_service_tracker.h as public api. This change should make it easier to refactor the celix_service_tracker.h and implementation for a better code coverage and error handling.
Also replaces the usage of
hash_map_t
in the C bundle context tocelix_long_hash_map_t
.