2 #include <ossia/network/base/address_scope.hpp>
3 #include <ossia/network/base/node.hpp>
36 OSSIA_EXPORT std::vector<ossia::net::node_base*>
56 OSSIA_EXPORT std::vector<ossia::net::node_base*>
68 node_base& node, std::string_view address, std::string_view type);
80 node_base& node, std::string_view address, std::string_view type);
89 void sanitize_name(std::string& name,
const node_base::children_t& brethren);
102 template <
typename Address>
106 auto addr =
new Address(node);
107 node.set_parameter(std::unique_ptr<Address>(addr));
111 template <
typename Address>
114 auto& node = ossia::net::find_or_create_node(root, std::move(name));
115 if(
auto p =
dynamic_cast<Address*
>(node.get_parameter()))
121 auto addr =
new Address{node};
122 node.set_parameter(std::unique_ptr<Address>(addr));
129 void expand_ranges(std::string& str);
132 std::pair<std::vector<std::string>,
bool> expand_address(std::string address);
140 std::vector<ossia::net::node_base*>
147 std::vector<ossia::net::node_base*>&out,
159 struct OSSIA_EXPORT fuzzysearch_result
166 operator==(
const fuzzysearch_result& lhs,
const fuzzysearch_result& rhs) noexcept
168 return lhs.score == rhs.score && lhs.oscname == rhs.oscname && lhs.node == rhs.node;
172 struct fuzzysearch_options
174 bool case_sensitive{
true};
179 const std::vector<ossia::net::node_base*>& node,
180 const std::vector<std::string>& patterns, std::vector<fuzzysearch_result>& results,
181 fuzzysearch_options = {});
The node_base class.
Definition: node.hpp:48
The parameter_base class.
Definition: ossia/network/base/parameter.hpp:48
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
OSSIA_EXPORT ossia::value_map_type to_map(const ossia::net::node_base &n) noexcept
Converts a node in a map of values.
OSSIA_EXPORT std::vector< ossia::net::node_base * > list_all_children(ossia::net::node_base *node, unsigned int depth=0, bool sort=true)
list_all_children : list all child nodes recursively
OSSIA_EXPORT std::vector< ossia::net::node_base * > create_nodes(node_base &dev, std::string_view pattern)
Create nodes according to a brace-expansion-like mechanism.
OSSIA_EXPORT node_base & find_or_create_node(node_base &dev, std::string_view parameter_base)
Find a node and create it if it does not exist.
OSSIA_EXPORT ossia::net::node_base * find_node(node_base &dev, std::string_view parameter_base)
Find a node in a device.
OSSIA_EXPORT ossia::value_with_unit get_value(const ossia::destination &addr)
Get the value associated with a destination.
Definition: ossia/network/base/parameter.cpp:144
OSSIA_EXPORT std::vector< parameter_base * > find_parameter_or_create_node(node_base &node, std::string_view address, std::string_view type)
Find a parameter and create it if it does not exist.
OSSIA_EXPORT void iterate_all_children(ossia::net::node_base *node, const std::function< void(ossia::net::parameter_base &)> &)
Iterates all the child parameters given a base node.
OSSIA_EXPORT std::vector< ossia::net::node_base * > find_nodes(node_base &dev, std::string_view pattern)
Find all nodes matching a pattern in a device.
OSSIA_EXPORT node_base & create_node(node_base &dev, std::string_view parameter_base)
Create a node in a device.
Definition: value_with_unit.hpp:13