Listeners¶
-
using
ServiceListener
= std::function<void(ServiceEvent const&)>¶ A
ServiceEvent
listener.A
ServiceListener
can be any callable object and is registered with the Framework using the BundleContext#AddServiceListener(const ServiceListener&, const std::string&) method.ServiceListener
instances are called with aServiceEvent
object when a service has been registered, unregistered, or modified.- See
-
using
BundleListener
= std::function<void(BundleEvent const&)>¶ A
BundleEvent
listener.When a
BundleEvent
is fired, it is asynchronously (if threading support is enabled) delivered to aBundleListener
. The Framework deliversBundleEvent
objects to aBundleListener
in order and does not concurrently call aBundleListener
.A
BundleListener
can be any callable object and is registered with the Framework using the BundleContext#AddBundleListener(const BundleListener&) method.BundleListener
instances are called with aBundleEvent
object when a bundle has been installed, resolved, started, stopped, updated, unresolved, or uninstalled.- See
-
using
FrameworkListener
= std::function<void(FrameworkEvent const&)>¶ A
FrameworkEvent
listener.When a
BundleEvent
is fired, it is asynchronously (if threading support is enabled) delivered to aFrameworkListener
. The Framework deliversFrameworkEvent
objects to aFrameworkListener
in order and does not concurrently call aFrameworkListener
.A
FrameworkListener
can be any callable object and is registered with the Framework using the BundleContext#AddFrameworkListener(const FrameworkListener&) method.FrameworkListener
instances are called with aFrameworkEvent
object when a framework life-cycle event or notification message occured.
-
template<class
R
>
ServiceListenerServiceListenerMemberFunctor
(R *receiver, void (R::* callback)(ServiceEvent const&))¶ A convenience function that binds the member function
callback
of an object of typeR
and returns aServiceListener
object.This object can then be passed into
AddServiceListener()
.Deprecated since version 3.1.0: This function exists only to maintain backwards compatibility and will be removed in the next major release. Use std::bind instead.
- Return
a ServiceListener object.
- Template Parameters
R
: The type containing the member function.
- Parameters
receiver
: The object of type R.callback
: The member function pointer.
-
template<class
R
>
BundleListenerBundleListenerMemberFunctor
(R *receiver, void (R::* callback)(BundleEvent const&))¶ A convenience function that binds the member function
callback
of an object of typeR
and returns aBundleListener
object.This object can then be passed into
AddBundleListener()
.Deprecated since version 3.1.0: This function exists only to maintain backwards compatibility and will be removed in the next major release. Use std::bind instead.
- Return
a BundleListener object.
- Template Parameters
R
: The type containing the member function.
- Parameters
receiver
: The object of type R.callback
: The member function pointer.
-
template<class
R
>
FrameworkListenerBindFrameworkListenerToFunctor
(R *receiver, void (R::* callback)(FrameworkEvent const&))¶ A convenience function that binds the member function
callback
of an object of typeR
and returns aFrameworkListener
object.This object can then be passed into
AddFrameworkListener()
.Deprecated since version 3.1.0: This function exists only to maintain backwards compatibility and will be removed in the next major release. Use std::bind instead.
- Return
a FrameworkListener object.
- Template Parameters
R
: The type containing the member function.
- Parameters
receiver
: The object of type R.callback
: The member function pointer.