2#include <ossia/detail/audio_spin_mutex.hpp>
3#include <ossia/detail/variant.hpp>
4#include <ossia/network/base/protocol.hpp>
5#include <ossia/network/context.hpp>
6#include <ossia/network/sockets/configuration.hpp>
8#include <boost/asio/cancellation_signal.hpp>
9#include <boost/asio/strand.hpp>
10#include <boost/unordered/concurrent_flat_map.hpp>
14 =
decltype(boost::asio::make_strand(std::declval<boost::asio::io_context&>()));
16struct mqtt5_configuration
18 ossia::variant<tcp_client_configuration, ws_client_configuration> transport;
21struct mqtt5_client_base;
23class OSSIA_EXPORT mqtt5_protocol
24 :
public ossia::net::can_learn<ossia::net::protocol_base>
25 ,
public Nano::Observer
28 explicit mqtt5_protocol(
29 ossia::net::network_context_ptr,
const mqtt5_configuration& conf);
32 bool pull(parameter_base&)
override;
33 bool push(
const parameter_base&,
const value& v)
override;
34 bool push_raw(
const full_parameter_data&)
override;
35 bool observe(parameter_base&,
bool)
override;
36 bool update(node_base& node_base)
override;
37 void set_device(device_base& dev)
override;
39 void set_learning(
bool);
40 void on_learn(
const std::string& topic,
const std::string& payload);
41 void on_message(
const std::string& topic,
const std::string& payload);
46 void on_new_param(
const parameter_base& param);
47 void on_removed_param(
const parameter_base& param);
48 void on_subscribe(parameter_base& param);
49 void on_unsubscribe(
const parameter_base& param);
51 ossia::net::network_context_ptr m_context;
53 mqtt5_configuration m_conf{};
54 std::unique_ptr<mqtt5_client_base> m_client;
56 struct subscribe_state;
57 boost::unordered::concurrent_flat_map<std::string, ossia::net::parameter_base*>
59 std::shared_ptr<subscribe_state> m_root;
Root of a device tree.
Definition ossia/network/base/device.hpp:58