RAVENNAKIT
Loading...
Searching...
No Matches
rav::RavennaBrowser Class Reference

Convenience class which contains a dnssd browser for nodes and sessions. More...

#include <ravenna_browser.hpp>

Classes

class  Subscriber
 Baseclass for other classes which need updates on discovered nodes and sessions. More...

Public Member Functions

 RavennaBrowser (boost::asio::io_context &io_context)
const dnssd::ServiceDescription * find_session (const std::string &session_name) const
 Finds a node by its name.
const dnssd::ServiceDescription * find_node (const std::string &node_name) const
 Finds a node by its name.
bool subscribe (Subscriber *subscriber_to_add)
 Adds a subscriber to the browser.
bool unsubscribe (const Subscriber *subscriber_to_remove)
 Removes a subscriber from the browser.
tl::expected< void, const char * > set_node_browsing_enabled (bool enabled)
 Enables or disables browsing for nodes.
tl::expected< void, const char * > set_session_browsing_enabled (bool enabled)
 Enables or disables browsing for nodes.

Detailed Description

Convenience class which contains a dnssd browser for nodes and sessions.

Definition at line 36 of file ravenna_browser.hpp.

Constructor & Destructor Documentation

◆ RavennaBrowser()

rav::RavennaBrowser::RavennaBrowser ( boost::asio::io_context & io_context)
explicit

Member Function Documentation

◆ find_node()

const dnssd::ServiceDescription * rav::RavennaBrowser::find_node ( const std::string & node_name) const
nodiscard

Finds a node by its name.

Parameters
node_nameThe name of the node to find.
Returns
The service description of the node, or nullptr if not found.

◆ find_session()

const dnssd::ServiceDescription * rav::RavennaBrowser::find_session ( const std::string & session_name) const
nodiscard

Finds a node by its name.

Parameters
session_nameThe name of the node to find.
Returns
The service description of the node, or nullptr if not found.

◆ set_node_browsing_enabled()

tl::expected< void, const char * > rav::RavennaBrowser::set_node_browsing_enabled ( bool enabled)

Enables or disables browsing for nodes.

Parameters
enabledTrue to enable browsing, false to disable browsing.

◆ set_session_browsing_enabled()

tl::expected< void, const char * > rav::RavennaBrowser::set_session_browsing_enabled ( bool enabled)

Enables or disables browsing for nodes.

Parameters
enabledTrue to enable browsing, false to disable browsing.

◆ subscribe()

bool rav::RavennaBrowser::subscribe ( Subscriber * subscriber_to_add)
nodiscard

Adds a subscriber to the browser.

Parameters
subscriber_to_addThe subscriber to add.
Returns
true if the subscriber was added, or false if it was already in the list.

◆ unsubscribe()

bool rav::RavennaBrowser::unsubscribe ( const Subscriber * subscriber_to_remove)
nodiscard

Removes a subscriber from the browser.

Parameters
subscriber_to_removeThe subscriber to remove.
Returns
true if the subscriber was removed, or false if it wasn't found.

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