Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::events::ServiceBrowser Class Reference

RAII service browser. More...

#include <service_discovery.hpp>

Public Types

using Callback

Public Member Functions

 ServiceBrowser (std::string_view service_type, Callback callback)
 ~ServiceBrowser ()
 ServiceBrowser (const ServiceBrowser &)=delete
ServiceBrowser & operator= (const ServiceBrowser &)=delete
bool is_browsing () const noexcept
NetworkServiceDiscovery & nsd () noexcept

Static Public Member Functions

static std::unique_ptr< ServiceBrowser > with_backend (std::unique_ptr< NetworkServiceDiscovery::Backend > backend, std::string_view service_type, Callback callback)
 Construct a browser that uses a caller-supplied backend instead of the platform default.

Detailed Description

RAII service browser.

Builds an internal NetworkServiceDiscovery configured with the platform's default backend, then starts a browse for service_type. Destructor stops browsing.

The callback receives ServiceFound and ServiceLost events for every (re)discovery and disappearance the backend reports.

Member Typedef Documentation

◆ Callback

Initial value:
std::function<void(ServiceDiscoveryAction,
ServiceDiscoveryAction
Action delivered to a ServiceBrowser callback.
Definition service_discovery.hpp:23
Definition volume_detector.hpp:74

Constructor & Destructor Documentation

◆ ServiceBrowser() [1/2]

pulp::events::ServiceBrowser::ServiceBrowser ( std::string_view service_type,
Callback callback )

◆ ~ServiceBrowser()

pulp::events::ServiceBrowser::~ServiceBrowser ( )

◆ ServiceBrowser() [2/2]

pulp::events::ServiceBrowser::ServiceBrowser ( const ServiceBrowser & )
delete

Member Function Documentation

◆ is_browsing()

bool pulp::events::ServiceBrowser::is_browsing ( ) const
inlinenoexcept

◆ nsd()

NetworkServiceDiscovery & pulp::events::ServiceBrowser::nsd ( )
inlinenoexcept

◆ operator=()

ServiceBrowser & pulp::events::ServiceBrowser::operator= ( const ServiceBrowser & )
delete

◆ with_backend()

std::unique_ptr< ServiceBrowser > pulp::events::ServiceBrowser::with_backend ( std::unique_ptr< NetworkServiceDiscovery::Backend > backend,
std::string_view service_type,
Callback callback )
static

Construct a browser that uses a caller-supplied backend instead of the platform default.

Primarily for tests.


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