OSSIA
Open Scenario System for Interactive Application
Loading...
Searching...
No Matches
local.hpp
1#pragma once
2
4#include <ossia/detail/audio_spin_mutex.hpp>
5#include <ossia/detail/mutex.hpp>
6#include <ossia/network/base/protocol.hpp>
7
8#include <vector>
9
10namespace ossia::net
11{
12class generic_device;
21class OSSIA_EXPORT multiplex_protocol final : public ossia::net::protocol_base
22{
23public:
27 multiplex_protocol& operator=(const multiplex_protocol&) = delete;
28 multiplex_protocol& operator=(multiplex_protocol&&) = delete;
29 virtual ~multiplex_protocol();
30
31 bool pull(ossia::net::parameter_base&) override;
32 bool push(const ossia::net::parameter_base& addr, const ossia::value& v) override;
33 bool push_raw(const full_parameter_data&) override;
34 bool observe(ossia::net::parameter_base&, bool) override;
35 bool update(ossia::net::node_base& node_base) override;
36
37 bool echo_incoming_message(
38 const message_origin_identifier&, const parameter_base&,
39 const ossia::value& v) override;
40
41 void stop() override;
42 void set_device(ossia::net::device_base& dev) override;
43
46 void expose_to(std::unique_ptr<ossia::net::protocol_base> p);
47
49 void stop_expose_to(const ossia::net::protocol_base& p);
50
51 void clear();
52
54 const auto& get_protocols() const { return m_protocols; }
55
56private:
57 std::vector<std::unique_ptr<ossia::net::protocol_base>>
58 m_protocols TS_GUARDED_BY(m_protocols_mutex);
59 std::vector<std::unique_ptr<ossia::net::protocol_base>>
60 m_protocols_to_register TS_GUARDED_BY(m_protocols_mutex);
61 ossia::audio_spin_mutex m_protocols_mutex;
62 ossia::net::device_base* m_device{};
63};
64
65using local_protocol = multiplex_protocol;
66}
Root of a device tree.
Definition ossia/network/base/device.hpp:58
A protocol used to expose a local application's data through multiple other protocols.
Definition local.hpp:22
const auto & get_protocols() const
The protocols we are currently exposing this device through.
Definition local.hpp:54
The node_base class.
Definition node.hpp:48
The parameter_base class.
Definition ossia/network/base/parameter.hpp:48
The protocol_base class.
Definition protocol.hpp:40
The value class.
Definition value.hpp:173
Full information about a parameter.
Definition parameter_data.hpp:61