|
Sen API
Sen Libraries
|
Converts multiple object providers into one. Providers might reside in different threads. Note that addition and removal notifications for objects that are matched by overlapping interests might mention different interest IDs. More...
#include <object_mux.h>
Public Member Functions | |
| ObjectMux ()=default | |
| ~ObjectMux () override=default | |
| void | addListener (ObjectProviderListener *listener, bool notifyAboutExistingObjects) override |
| Registers an event listener. | |
| void | removeListener (ObjectProviderListener *listener, bool notifyAboutExistingObjects) override |
| Un-registers an event listener. | |
| bool | hasListener (ObjectProviderListener *listener) const noexcept override |
| Returns true if the listener has been added. | |
| bool | hasListeners () const noexcept override |
| Returns true if there are registered listeners. | |
| void | addMuxedListener (MuxedProviderListener *listener, bool notifyAboutExistingObjects) |
| void | removeMuxedListener (MuxedProviderListener *listener, bool notifyAboutExistingObjects) |
| bool | hasMuxedListener (MuxedProviderListener *listener) const noexcept |
| virtual kernel::impl::RemoteParticipant * | isRemoteParticipant () noexcept |
| virtual kernel::impl::LocalParticipant * | isLocalParticipant () noexcept |
Protected Member Functions | |
| void | notifyAddedOnExistingObjects (ObjectProviderListener *listener) override |
| Subclasses must call onObjectAdded on the listener for all the existing objects. | |
| void | notifyRemovedOnExistingObjects (ObjectProviderListener *listener) override |
| Subclasses must call onObjectRemoved on the listener for all the existing objects. | |
| void | notifyObjectsAdded (const ObjectAdditionList &additions) override |
| Calls onObjectAdded on all the registered listeners. | |
| void | notifyObjectsRemoved (const ObjectRemovalList &removals) override |
| Calls onObjectRemoved on all the registered listeners. | |
| void | notifyMuxedAddedOnExistingObjects (MuxedProviderListener *listener) |
| void | notifyMuxedRemovedOnExistingObjects (MuxedProviderListener *listener) |
| void | notifyExistingObjectsReadded (const ObjectAdditionList &additions) |
| void | notifyObjectsRefCountReduced (const ObjectRemovalList &removals) |
| virtual void | muxedListenerAdded (MuxedProviderListener *listener, bool notifyAboutExistingObjects) |
| Does nothing by default. | |
| virtual void | muxedListenerRemoved (MuxedProviderListener *listener, bool notifyAboutExistingObjects) |
| Does nothing by default. | |
| void | callOnExistingObjectsReadded (MuxedProviderListener *listener, const ObjectAdditionList &additions) const |
| void | callOnObjectsRefCountReduced (MuxedProviderListener *listener, const ObjectRemovalList &removals) const |
| void | onObjectsAdded (const ObjectAdditionList &additions) override |
| Called when objects are been added to a source. | |
| void | onObjectsRemoved (const ObjectRemovalList &removals) override |
| Called when objects will be removed from a source. | |
| virtual void | listenerAdded (ObjectProviderListener *listener, bool notifyAboutExistingObjects) |
| Does nothing by default. | |
| virtual void | listenerRemoved (ObjectProviderListener *listener, bool notifyAboutExistingObjects) |
| Does nothing by default. | |
| void | notifyRemovedOnExistingObjectsForAllListeners () |
| Same as notifyRemovedOnExistingObjects but for all registered listeners. | |
| void | callOnObjectsAdded (ObjectProviderListener *listener, const ObjectAdditionList &additions) const |
| void | callOnObjectsRemoved (ObjectProviderListener *listener, const ObjectRemovalList &removals) const |
| const std::vector< ObjectProviderListener * > & | getListeners () const noexcept |
Friends | |
| class | MuxedProviderListener |
Converts multiple object providers into one. Providers might reside in different threads. Note that addition and removal notifications for objects that are matched by overlapping interests might mention different interest IDs.
|
default |
|
overridedefault |
|
overridevirtual |
Registers an event listener.
The listener will be notified of objects being added and removed, and this provider will pass itself as the source of the objects.
A listener can be only added once to the same provider. So calling his method with the same listener will do nothing.
This provider will not take ownership of the added listener. But when a listener gets destroyed, it will ensure that it removes itself from the providers it was added to. Note that in this case your listener will not be notified about the removal of existing objects.
| listener | the entity that will be notified about objects. |
| notifyAboutExistingObjects | if true, the listener will get an immediate 'onObjectAdded' call for each existing object in the provider. |
Reimplemented from sen::ObjectProvider.
|
overridevirtual |
Un-registers an event listener.
Does nothing if the provided event listener was not added.
| listener | the listener that was previously added. |
| notifyAboutExistingObjects | if true, the listener will get a 'onObjectRemoved' call for each existing object in the provider. |
Reimplemented from sen::ObjectProvider.
|
nodiscardoverridevirtualnoexcept |
Returns true if the listener has been added.
Reimplemented from sen::ObjectProvider.
|
nodiscardoverridevirtualnoexcept |
Returns true if there are registered listeners.
Reimplemented from sen::ObjectProvider.
| void sen::ObjectMux::addMuxedListener | ( | MuxedProviderListener * | listener, |
| bool | notifyAboutExistingObjects ) |
| void sen::ObjectMux::removeMuxedListener | ( | MuxedProviderListener * | listener, |
| bool | notifyAboutExistingObjects ) |
|
nodiscardnoexcept |
|
overrideprotectedvirtual |
Subclasses must call onObjectAdded on the listener for all the existing objects.
Implements sen::ObjectProvider.
|
overrideprotectedvirtual |
Subclasses must call onObjectRemoved on the listener for all the existing objects.
Implements sen::ObjectProvider.
|
overrideprotectedvirtual |
Calls onObjectAdded on all the registered listeners.
Reimplemented from sen::ObjectProvider.
|
overrideprotectedvirtual |
Calls onObjectRemoved on all the registered listeners.
Reimplemented from sen::ObjectProvider.
|
protected |
|
protected |
|
protected |
|
protected |
|
protectedvirtual |
Does nothing by default.
|
protectedvirtual |
Does nothing by default.
|
protected |
|
protected |
|
overrideprotectedvirtual |
Called when objects are been added to a source.
Implements sen::ObjectProviderListener.
|
overrideprotectedvirtual |
Called when objects will be removed from a source.
Implements sen::ObjectProviderListener.
|
nodiscardvirtualnoexceptinherited |
|
nodiscardvirtualnoexceptinherited |
|
protectedvirtualinherited |
Does nothing by default.
|
protectedvirtualinherited |
Does nothing by default.
|
protectedinherited |
Same as notifyRemovedOnExistingObjects but for all registered listeners.
|
protectedinherited |
|
protectedinherited |
|
nodiscardprotectednoexceptinherited |
|
friend |