TSDuck v3.45-4733
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::SocketSubscriptionBase Class Reference

Base class for subscription to socket events. More...

#include <tsSocketSubscriptionBase.h>

Inheritance diagram for ts::SocketSubscriptionBase:

Public Member Functions

 SocketSubscriptionBase ()=default
 Default constructor.
 
virtual ~SocketSubscriptionBase ()
 Virtual destructor.
 
void addSubscription (SocketHandlerInterface *handler)
 Add a subscriber to open/close events.
 
void cancelSubscription (SocketHandlerInterface *handler)
 Remove a subscriber to open/close events.
 

Protected Member Functions

template<typename F >
void callSubscribers (F &&func)
 Call a handler on all subscribers, using a lambda expression.
 

Detailed Description

Base class for subscription to socket events.

Used as base class in Socket and other socket wrappers which intercept socket events.

Member Function Documentation

◆ addSubscription()

void ts::SocketSubscriptionBase::addSubscription ( SocketHandlerInterface handler)

Add a subscriber to open/close events.

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

◆ cancelSubscription()

void ts::SocketSubscriptionBase::cancelSubscription ( SocketHandlerInterface handler)

Remove a subscriber to open/close events.

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

◆ callSubscribers()

template<typename F >
void ts::SocketSubscriptionBase::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: