TSDuck v3.46-4930
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::SubscriptionBase Class Reference

#include <tsSubscriptionBase.h>

Inheritance diagram for ts::SubscriptionBase:

Public Member Functions

 SubscriptionBase ()=default
virtual ~SubscriptionBase ()
void addSubscription (SubscriptionHandlerInterface *handler)
void cancelSubscription (SubscriptionHandlerInterface *handler)

Protected Member Functions

template<typename HANDLER, typename F>
requires std::derived_from<HANDLER, SubscriptionHandlerInterface>
void callSubscribers (F &&func)

Detailed Description

Base class for subscription to events. Used as base class in Socket and other socket wrappers which intercept socket events.

Constructor & Destructor Documentation

◆ SubscriptionBase()

ts::SubscriptionBase::SubscriptionBase ( )
default

Default constructor.

◆ ~SubscriptionBase()

virtual ts::SubscriptionBase::~SubscriptionBase ( )
virtual

Virtual destructor.

Member Function Documentation

◆ addSubscription()

void ts::SubscriptionBase::addSubscription ( SubscriptionHandlerInterface * handler)

Add a subscriber to open/close events.

Parameters
[in]handlerThe object to call on open() and close().

◆ cancelSubscription()

void ts::SubscriptionBase::cancelSubscription ( SubscriptionHandlerInterface * handler)

Remove a subscriber to open/close events.

Parameters
[in]handlerThe object to no longer call on open() and close().

◆ callSubscribers()

template<typename HANDLER, typename F>
requires std::derived_from<HANDLER, SubscriptionHandlerInterface>
void ts::SubscriptionBase::callSubscribers ( F && func)
inlineprotected

Call a handler on all subscribers, using a lambda expression.

Parameters
[in]funcFunction to call as lambda expression.

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