OSSIA
Open Scenario System for Interactive Application
Loading...
Searching...
No Matches
phidgets_node.hpp
1#pragma once
2#include <ossia/network/base/node.hpp>
3#include <ossia/network/phidgets/phidgets_parameter_data.hpp>
4namespace ossia
5{
6class phidget_device;
7class phidget_node : public ossia::net::node_base
8{
9protected:
10 PhidgetHandle m_hdl{};
11 net::device_base& m_device;
12 node_base& m_parent;
13 std::unique_ptr<ossia::net::parameter_base> m_parameter;
14
15public:
16 phidget_id id;
17 using iterator = ossia::ptr_container<ossia::net::node_base>::iterator;
18 using const_iterator = ossia::ptr_container<ossia::net::node_base>::const_iterator;
19
20 ~phidget_node();
21
22 auto phidget() const { return m_hdl; }
23 void set_parameter(std::unique_ptr<ossia::net::parameter_base> a) override;
24
25 phidget_node(PhidgetHandle hdl, ossia::net::device_base& d, ossia::net::node_base& p);
26
27 ossia::net::device_base& get_device() const final override;
28 ossia::net::node_base* get_parent() const override;
29
30 ossia::net::node_base& set_name(std::string n) override;
31
32 ossia::net::parameter_base* get_parameter() const final override;
33 ossia::net::parameter_base* create_parameter(val_type) final override;
34 bool remove_parameter() final override;
35
36 std::unique_ptr<ossia::net::node_base>
37 make_child(const std::string& name) final override;
38 void removing_child(ossia::net::node_base& node_base) final override;
39 void add_child_simple(std::unique_ptr<ossia::net::node_base>);
40};
41
42class phidget_hub_port_node : public ossia::net::node_base
43{
44protected:
45 PhidgetHandle m_hdl{};
46 net::device_base& m_device;
47 node_base& m_parent;
48
49public:
50 using iterator = ossia::ptr_container<ossia::net::node_base>::iterator;
51 using const_iterator = ossia::ptr_container<ossia::net::node_base>::const_iterator;
52
53 ~phidget_hub_port_node();
54
55 auto phidget() const { return m_hdl; }
56
57 phidget_hub_port_node(
58 PhidgetHandle hdl, int num, ossia::net::device_base& d, ossia::net::node_base& p);
59
60 ossia::net::device_base& get_device() const final override;
61 ossia::net::node_base* get_parent() const override;
62
63 ossia::net::node_base& set_name(std::string n) override;
64
65 ossia::net::parameter_base* get_parameter() const final override;
66 ossia::net::parameter_base* create_parameter(val_type) final override;
67 bool remove_parameter() final override;
68
69 std::unique_ptr<ossia::net::node_base>
70 make_child(const std::string& name) final override;
71 void removing_child(ossia::net::node_base& node_base) final override;
72 void add_child_simple(std::unique_ptr<ossia::net::node_base>);
73};
74}
Root of a device tree.
Definition ossia/network/base/device.hpp:58
The node_base class.
Definition node.hpp:48
virtual void set_parameter(std::unique_ptr< ossia::net::parameter_base >)
Default implementation does nothing.
Definition node.cpp:31
Definition git_info.h:7
val_type
Enum to represent the types that a value can take.
Definition parameter_properties.hpp:16