OSSIA
Open Scenario System for Interactive Application
Loading...
Searching...
No Matches
alias_node.hpp
1#pragma once
2#include <ossia/network/base/parameter.hpp>
3#include <ossia/network/common/path.hpp>
5#include <ossia/network/generic/generic_node.hpp>
6
7namespace ossia::net
8{
9
15class alias_node final : public generic_node_base
16{
17public:
18 using generic_node_base::generic_node_base;
19
21
22 ossia::net::node_base* get_origin() const;
23 void set_origin(ossia::net::node_base* o);
24
26 bool remove_parameter() override;
27 parameter_base* get_parameter() const override;
28
29protected:
30 std::unique_ptr<node_base> make_child(const std::string& name) override;
31 void removing_child(node_base&) override;
32
33private:
34 void on_deletion(const ossia::net::node_base& orig);
35
36 ossia::net::node_base* m_origin{};
37};
38
39class OSSIA_EXPORT alias_path final
40 : public generic_node_base
42{
43public:
44 alias_path(
45 std::string name, ossia::net::device_base& aDevice, ossia::net::node_base& parent);
46
47 ~alias_path();
48
49 const std::vector<ossia::net::node_base*>& get_roots();
50 void set_roots(std::vector<ossia::net::node_base*> roots);
51
52 traversal::path get_path() const;
53 void set_path(traversal::path o);
54
55private:
56 parameter_base* create_parameter(val_type v) override;
57 bool remove_parameter() override;
58 parameter_base* get_parameter() const override;
59
60 std::unique_ptr<node_base> make_child(const std::string& name) override;
61 void removing_child(node_base&) override;
62
63 void pull_value() override;
64
65 std::future<void> pull_value_async() override;
66 void request_value() override;
67 ossia::value value() const override;
68 parameter_base& push_value(const ossia::value&) override;
70 parameter_base& push_value() override;
71 ossia::value set_value(const ossia::value&) override;
72 ossia::value set_value(ossia::value&&) override;
73 ossia::value set_value_quiet(const ossia::value& v) override;
74 ossia::value set_value_quiet(ossia::value&& v) override;
75 val_type get_value_type() const noexcept override;
76 parameter_base& set_value_type(val_type) override;
77 access_mode get_access() const noexcept override;
78 parameter_base& set_access(access_mode) override;
79 const domain& get_domain() const noexcept override;
80 parameter_base& set_domain(const domain&) override;
81 bounding_mode get_bounding() const noexcept override;
82 parameter_base& set_bounding(bounding_mode) override;
83
84 template <typename Fun>
85 void do_for_nodes(Fun f);
86
87 std::vector<ossia::net::node_base*> m_roots;
88 traversal::path m_path;
89};
90}
A type of node that refers to another node.
Definition alias_node.hpp:16
void removing_child(node_base &) override
Reimplement for a specific removal action.
Definition alias_node.cpp:59
parameter_base * create_parameter(val_type v) override
Allows a node to carry a value.
Definition alias_node.cpp:18
std::unique_ptr< node_base > make_child(const std::string &name) override
Should return nullptr if no child is to be added.
Definition alias_node.cpp:54
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
The value class.
Definition value.hpp:173
Definition git_info.h:7
val_type
Enum to represent the types that a value can take.
Definition parameter_properties.hpp:16
bounding_mode
Address behaviors at crossing domain boundaries.
Definition parameter_properties.hpp:56
access_mode
Address behaviors at crossing domain boundaries time.
Definition parameter_properties.hpp:46
Utilities to construct classes that will perform an action for nodes matching a path.
OSSIA_EXPORT void push_value(const ossia::destination &addr, const ossia::value_with_unit &)
Send a value to a given destination.
Definition ossia/network/base/parameter.cpp:151
domain A domain of values
Definition domain_base.hpp:23