OSSIA
Open Scenario System for Interactive Application
Loading...
Searching...
No Matches
generic_node.hpp
1#pragma once
3#include <ossia/network/base/node.hpp>
4#include <ossia/network/common/parameter_properties.hpp>
5
6#include <functional>
7namespace ossia::net
8{
9class protocol_base;
10
11class OSSIA_EXPORT generic_node_base : public ossia::net::node_base
12{
13protected:
15 ossia::net::node_base* const m_parent{};
16
17public:
18 generic_node_base() = delete;
19 generic_node_base(const generic_node_base&) = delete;
20 generic_node_base(generic_node_base&&) = delete;
21 generic_node_base& operator=(const generic_node_base&) = delete;
22 generic_node_base& operator=(generic_node_base&&) = delete;
23
24 generic_node_base(
25 std::string name, ossia::net::device_base& aDevice, node_base& aParent);
26
27 generic_node_base(std::string name, ossia::net::device_base& aDevice);
28
29 ossia::net::device_base& get_device() const final override;
30 ossia::net::node_base* get_parent() const final override;
31
32 ossia::net::node_base& set_name(std::string) final override;
33
34private:
35 void on_address_change() final override;
36};
37
38class OSSIA_EXPORT generic_node : public generic_node_base
39{
40public:
41 generic_node(std::string name, ossia::net::device_base& aDevice, node_base& aParent);
42 generic_node(std::string name, ossia::net::device_base& aDevice);
43
44 ~generic_node() override;
45
46 ossia::net::parameter_base* get_parameter() const final override;
47 ossia::net::parameter_base* create_parameter(ossia::val_type type) final override;
48 void set_parameter(std::unique_ptr<ossia::net::parameter_base> addr) final override;
49 bool remove_parameter() final override;
50
51protected:
52 std::unique_ptr<ossia::net::parameter_base> m_parameter;
53
54private:
55 std::unique_ptr<node_base> make_child(const std::string& name) final override;
56
57 void removing_child(node_base&) final override { }
58};
59}
Root of a device tree.
Definition ossia/network/base/device.hpp:58
The node_base class.
Definition node.hpp:48
The parameter_base class.
Definition ossia/network/base/parameter.hpp:48
Definition git_info.h:7