|
Sen API
Sen Libraries
|
Allows adding and receiving objects. More...
#include <object_source.h>
Public Types | |
| using | NativeObjectPtr = std::shared_ptr<NativeObject> |
Public Member Functions | |
| ObjectSource (const ObjectOwnerId &id) | |
| ~ObjectSource () override=default | |
| virtual bool | add (const Span< NativeObjectPtr > &instances)=0 |
| Registers an object (including its type). It does nothing if the object is already registered. Returns false if one or more objects could not be added. This method is thread-safe. | |
| bool | add (NativeObjectPtr instance) |
| Registers an object (including its type). It does nothing if the objects are already present. Returns false if the objects could not be added. This method is thread-safe. | |
| template<typename T> | |
| bool | add (const std::vector< std::shared_ptr< T > > &instances) |
| Convenience helper. | |
| virtual void | remove (const Span< NativeObjectPtr > &instances)=0 |
| Unregisters an object and notifies any registered listeners. Ignores objects that are not present. This method is thread-safe. | |
| void | remove (NativeObjectPtr instance) |
| Unregisters an object. Does nothing if the object is not present. This method is thread-safe. | |
| template<typename T> | |
| void | remove (const std::vector< std::shared_ptr< T > > &instances) |
| Convenience helper. | |
| void | addSubscriber (std::shared_ptr< Interest > interest, ObjectProviderListener *listener, bool notifyAboutExisting) override |
| Add a subscriber to the filter on a specific interest. | |
| void | removeSubscriber (std::shared_ptr< Interest > interest, ObjectProviderListener *listener, bool notifyAboutExisting) override |
| Removes a previously-added subscriber on a specific interest. | |
| void | removeSubscriber (ObjectProviderListener *listener, bool notifyAboutExisting) override |
| Removes all the instances of the listener. | |
| void | replaceSubscriber (ObjectProviderListener *oldListener, ObjectProviderListener *newListener) override |
| Replaces an existing subscriber with a new one. | |
| bool | hasActiveListeners () override |
| Returns true if there are still active listeners attached to this filter. | |
| std::shared_ptr< ObjectProvider > | getOrCreateNamedProvider (const std::string &name, std::shared_ptr< Interest > interest) |
| Creates a uniquely named provider for objects determined on a given interest. Returns any provider with the same name and interest. | |
| void | removeNamedProvider (std::string_view name) |
| Deletes any provider with this name. Does nothing if none found. | |
Protected Member Functions | |
| virtual void | flushOutputs ()=0 |
| virtual void | drainInputs ()=0 |
| void | evaluate (const ObjectSet &objects) |
| const ObjectOwnerId & | getOwnerId () const noexcept |
| virtual void | subscriberAdded (std::shared_ptr< Interest > interest, ObjectProviderListener *listener, bool notifyAboutExisting) |
| virtual void | subscriberRemoved (std::shared_ptr< Interest > interest, ObjectProviderListener *listener, bool notifyAboutExisting) |
| virtual void | subscriberRemoved (ObjectProviderListener *listener, bool notifyAboutExisting) |
| virtual void | objectsAdded (std::shared_ptr< Interest > interest, ObjectAdditionList additions) |
| virtual void | objectsRemoved (std::shared_ptr< Interest > interest, ObjectRemovalList removals) |
Friends | |
| class | kernel::impl::Runner |
Allows adding and receiving objects.
| using sen::ObjectSource::NativeObjectPtr = std::shared_ptr<NativeObject> |
|
inlineexplicit |
|
overridedefault |
|
pure virtual |
Registers an object (including its type). It does nothing if the object is already registered. Returns false if one or more objects could not be added. This method is thread-safe.
|
inline |
Registers an object (including its type). It does nothing if the objects are already present. Returns false if the objects could not be added. This method is thread-safe.
|
inline |
Convenience helper.
|
pure virtual |
Unregisters an object and notifies any registered listeners. Ignores objects that are not present. This method is thread-safe.
|
inline |
Unregisters an object. Does nothing if the object is not present. This method is thread-safe.
|
inline |
Convenience helper.
|
protectedpure virtual |
|
protectedpure virtual |
|
overridevirtualinherited |
Add a subscriber to the filter on a specific interest.
Implements sen::ObjectFilterBase.
|
overridevirtualinherited |
Removes a previously-added subscriber on a specific interest.
Implements sen::ObjectFilterBase.
|
overridevirtualinherited |
Removes all the instances of the listener.
Implements sen::ObjectFilterBase.
|
overridevirtualinherited |
Replaces an existing subscriber with a new one.
Implements sen::ObjectFilterBase.
|
nodiscardoverridevirtualinherited |
Returns true if there are still active listeners attached to this filter.
The default is conservative for filters that do not track listeners. This is not pure virtual so implementations outside the repository do not need to add an override immediately.
Reimplemented from sen::ObjectFilterBase.
|
inherited |
Creates a uniquely named provider for objects determined on a given interest. Returns any provider with the same name and interest.
|
inherited |
Deletes any provider with this name. Does nothing if none found.
|
protectedinherited |
|
nodiscardprotectednoexceptinherited |
|
protectedvirtualinherited |
|
protectedvirtualinherited |
|
protectedvirtualinherited |
|
protectedvirtualinherited |
|
protectedvirtualinherited |
|
friend |