Scaffold C++20 screencast project with Meson, agent workflow, and phase plan
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
namespace sc {
|
||||
|
||||
struct DiscoveredPeer {
|
||||
std::string service_name;
|
||||
std::string host;
|
||||
uint16_t signaling_port = 0;
|
||||
};
|
||||
|
||||
class DiscoveryService {
|
||||
public:
|
||||
using PeerCallback = std::function<void ( const DiscoveredPeer & )>;
|
||||
|
||||
virtual ~DiscoveryService () = default;
|
||||
|
||||
// Announce this peer on the LAN.
|
||||
virtual bool announce ( const std::string &service_name, uint16_t signaling_port ) = 0;
|
||||
|
||||
// Browse for peers; callback is invoked for each newly found service.
|
||||
virtual bool browse ( PeerCallback on_peer ) = 0;
|
||||
|
||||
virtual void stop () = 0;
|
||||
};
|
||||
|
||||
class DiscoveryFactory {
|
||||
public:
|
||||
static std::unique_ptr<DiscoveryService> create_avahi ();
|
||||
};
|
||||
|
||||
} // namespace sc
|
||||
Reference in New Issue
Block a user