ActiveLib
Loading...
Searching...
No Matches
Public Member Functions | List of all members
active::event::Publisher::SubscriberList Class Reference

Public Member Functions

 SubscriberList ()
 
 SubscriberList (const SubscriberList &source)
 
 ~SubscriberList ()
 
bool add (std::shared_ptr< Subscriber > subscriber)
 
bool add (std::weak_ptr< Subscriber > subscriber)
 
bool remove (const Subscriber &subscriber)
 
bool remove (const utility::Guid &id)
 
std::vector< std::shared_ptr< Subscriber > > filter (const utility::NameID::Option eventID=std::nullopt)
 

Constructor & Destructor Documentation

◆ SubscriberList() [1/2]

active::event::Publisher::SubscriberList::SubscriberList ( )
inline

Default constructor

◆ SubscriberList() [2/2]

active::event::Publisher::SubscriberList::SubscriberList ( const SubscriberList & source)
inline

Copy constructor source: The object to copy

◆ ~SubscriberList()

active::event::Publisher::SubscriberList::~SubscriberList ( )
inline

Destructor

Member Function Documentation

◆ add() [1/2]

bool active::event::Publisher::SubscriberList::add ( std::shared_ptr< Subscriber > subscriber)
inline

Add a managed subscriber, i.e. the subscription continues until the publisher is explicitly instructed to end it

Parameters
subscriberThe new subscriber
Returns
True if subscriber was added
Here is the caller graph for this function:

◆ add() [2/2]

bool active::event::Publisher::SubscriberList::add ( std::weak_ptr< Subscriber > subscriber)
inline

Add a casual subscriber, i.e. the subscription ends as soon as the subscriber disappears

Parameters
subscriberThe new subscriber
Returns
True if subscriber was added

◆ filter()

std::vector< std::shared_ptr< Subscriber > > active::event::Publisher::SubscriberList::filter ( const utility::NameID::Option eventID = std::nullopt)
inline

Filter the subscribers to remove redundant items and optionally find subscriptions to a specified event (from the remainder)

Parameters
eventIDAn event identifier to filter the subscribers by (nullopt = pool all active subscribers)
Returns
The filtered subscribers
Here is the call graph for this function:

◆ remove() [1/2]

bool active::event::Publisher::SubscriberList::remove ( const Subscriber & subscriber)
inline

Remove a subscriber (by memory address)

Parameters
subscriberA reference to the subscriber to remove
Returns
True if subscriber was removed

◆ remove() [2/2]

bool active::event::Publisher::SubscriberList::remove ( const utility::Guid & id)
inline

Remove a subscriber by ID

Parameters
idThe ID of the subscriber to remove
Returns
True if subscriber was removed

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