forked from sony/nmos-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnode_behaviour.h
51 lines (40 loc) · 2.08 KB
/
node_behaviour.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef NMOS_NODE_BEHAVIOUR_H
#define NMOS_NODE_BEHAVIOUR_H
#include <functional>
#include "nmos/certificate_handlers.h"
namespace web
{
class uri;
}
namespace slog
{
class base_gate;
}
namespace mdns
{
class service_advertiser;
class service_discovery;
}
// Node behaviour including both registered operation and peer to peer operation
// See https://specs.amwa.tv/is-04/releases/v1.2.0/docs/4.1._Behaviour_-_Registration.html
// and https://specs.amwa.tv/is-04/releases/v1.2.0/docs/3.1._Discovery_-_Registered_Operation.html
namespace nmos
{
struct model;
// a registration_handler is a notification that the current Registration API has changed
// registration uri should be like http://api.example.com/x-nmos/registration/{version}
// or empty if errors have been encountered when interacting with all discoverable Registration APIs
// this callback should not throw exceptions
typedef std::function<void(const web::uri& registration_uri)> registration_handler;
// uses the default DNS-SD implementation
// callbacks from this function are called with the model locked, and may read or write directly to the model
void node_behaviour_thread(nmos::model& model, load_ca_certificates_handler load_ca_certificates, registration_handler registration_changed, slog::base_gate& gate);
// uses the specified DNS-SD implementation
// callbacks from this function are called with the model locked, and may read or write directly to the model
void node_behaviour_thread(nmos::model& model, registration_handler registration_changed, mdns::service_advertiser& advertiser, mdns::service_discovery& discovery, slog::base_gate& gate);
// uses the default DNS-SD implementation
void node_behaviour_thread(nmos::model& model, load_ca_certificates_handler load_ca_certificates, slog::base_gate& gate);
// uses the specified DNS-SD implementation
void node_behaviour_thread(nmos::model& model, load_ca_certificates_handler load_ca_certificates, mdns::service_advertiser& advertiser, mdns::service_discovery& discovery, slog::base_gate& gate);
}
#endif