Sen API
Sen Libraries
Loading...
Searching...
No Matches
sen::Subscription< T > Struct Template Reference

A list of objects and a reference to its source (to keep it alive). More...

#include <subscription.h>

Public Member Functions

 Subscription (Subscription &&other) noexcept
Subscriptionoperator= (Subscription &&other) noexcept
 Subscription ()=default
 ~Subscription ()
void attachTo (std::shared_ptr< ObjectSource > src, std::shared_ptr< Interest > interest, bool notifyAboutExisting)
 Attaches this subscription to a source and registers the given interest. Objects matching the interest will start populating the list.
void release (bool notifyAboutExisting=true)
 Detaches from the source, unregistering the list as a subscriber. Called automatically on destruction. Pass notifyAboutExisting=false to suppress removal callbacks during explicit teardown.
std::shared_ptr< ObjectSourcegetSource () const
 Returns the source currently attached to this subscription, or nullptr if none.

Public Attributes

ObjectList< T > list

Detailed Description

template<typename T>
struct sen::Subscription< T >

A list of objects and a reference to its source (to keep it alive).

Constructor & Destructor Documentation

◆ Subscription()

template<typename T>
sen::Subscription< T >::Subscription ( )
default

Member Function Documentation

◆ getSource()

template<typename T>
std::shared_ptr< ObjectSource > sen::Subscription< T >::getSource ( ) const
inlinenodiscard

Returns the source currently attached to this subscription, or nullptr if none.

Member Data Documentation

◆ list

template<typename T>
ObjectList<T> sen::Subscription< T >::list

The documentation for this struct was generated from the following file: