|
OSSIA
Open Scenario System for Interactive Application
|
Various utilities to work with a node hierarchy.
Go to the source code of this file.
Namespaces | |
| namespace | ossia |
Functions | |
| node_base * | ossia::net::find_node (node_base &dev, std::string_view parameter_base) |
| Find a node in a device. | |
| std::vector< node_base * > | ossia::net::find_nodes (node_base &dev, std::string_view pattern) |
| Find all nodes matching a pattern in a device. | |
| node_base & | ossia::net::create_node (node_base &dev, std::string_view parameter_base) |
| Create a node in a device. | |
| std::vector< node_base * > | ossia::net::create_nodes (node_base &dev, std::string_view pattern) |
| Create nodes according to a brace-expansion-like mechanism. | |
| node_base & | ossia::net::find_or_create_node (node_base &dev, std::string_view parameter_base) |
| Find a node and create it if it does not exist. | |
| parameter_base * | ossia::net::find_or_create_parameter (node_base &node, std::string_view address, std::string_view type) |
| std::vector< parameter_base * > | ossia::net::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. | |
| node_base * | ossia::net::find_or_create_node (node_base &dev, std::string_view parameter_base, bool create) |
Calls find_node or create_node according to the value create | |
| void | ossia::net::sanitize_name (std::string &name, const node_base::children_t &brethren) |
| Get a valid name for a given node. | |
| OSSIA_EXPORT ossia::value_with_unit | ossia::net::get_value (const ossia::destination &addr) |
| Get the value associated with a destination. | |
| OSSIA_EXPORT void | ossia::net::push_value (const ossia::destination &addr, const ossia::value_with_unit &) |
| Send a value to a given destination. | |
| template<typename Address > | |
| auto | ossia::net::create_parameter (ossia::net::node_base &root, std::string name) |
| template<typename Address > | |
| auto | ossia::net::find_parameter_or_create_node (ossia::net::node_base &root, std::string_view name) |
| OSSIA_EXPORT std::ostream & | ossia::net::operator<< (std::ostream &, const ossia::net::parameter_base &) |
| void | ossia::net::expand_ranges (std::string &str) |
| std::pair< std::vector< std::string >, bool > | ossia::net::expand_address (std::string address) |
| std::vector< ossia::net::node_base * > | ossia::net::list_all_children (ossia::net::node_base *node, unsigned int depth=0, bool sort=true) |
| list_all_children : list all child nodes recursively | |
| void | ossia::net::list_all_children (ossia::net::node_base *node, std::vector< ossia::net::node_base * > &list, unsigned int depth, bool sort) |
| void | ossia::net::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. | |
| void | ossia::net::fuzzysearch (const std::vector< ossia::net::node_base * > &nodes, const std::vector< std::string > &patterns, std::vector< fuzzysearch_result > &results, fuzzysearch_options opt) |
| fuzzysearch: search for nodes that match the pattern string | |
| value_map_type | ossia::net::to_map (const ossia::net::node_base &n) noexcept |
| Converts a node in a map of values. | |
| OSSIA_EXPORT ossia::net::node_base * ossia::net::find_node | ( | node_base & | dev, |
| std::string_view | parameter_base | ||
| ) |
Find a node in a device.
The address is in OSC format, e.g. /foo/bar.
| OSSIA_EXPORT std::vector< ossia::net::node_base * > ossia::net::find_nodes | ( | node_base & | dev, |
| std::string_view | pattern | ||
| ) |
Find all nodes matching a pattern in a device.
The address is in OSC pattern match format, e.g. /foo.[0-5]/bar*
| OSSIA_EXPORT node_base & ossia::net::create_node | ( | node_base & | dev, |
| std::string_view | parameter_base | ||
| ) |
Create a node in a device.
If the node already exists, a new instance will be created. Hence there is no guarantee that the created node name is the same than the one requested; the output should be checked.
| OSSIA_EXPORT std::vector< ossia::net::node_base * > ossia::net::create_nodes | ( | node_base & | dev, |
| std::string_view | pattern | ||
| ) |
Create nodes according to a brace-expansion-like mechanism.
Only [] and { } are possible. e.g. /foo/{bar,baz}.[0-9][0-9].
| OSSIA_EXPORT node_base & ossia::net::find_or_create_node | ( | node_base & | dev, |
| std::string_view | parameter_base | ||
| ) |
Find a node and create it if it does not exist.
If the node exists, it will be returned, else a new node will be created.
| OSSIA_EXPORT std::vector< parameter_base * > ossia::net::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.
Find a node matching the address, if it already has a parameter create a new one (with name incremented by 1), if not create parameter It some matching nodes does not exist, they will be created with a parameter
| node | |
| address | |
| type | of the parameter |
| OSSIA_EXPORT std::vector< ossia::net::node_base * > ossia::net::list_all_children | ( | ossia::net::node_base * | node, |
| unsigned int | depth = 0, |
||
| bool | sort = true |
||
| ) |
list_all_children : list all child nodes recursively
| node | : starting point |
| OSSIA_EXPORT void ossia::net::fuzzysearch | ( | const std::vector< ossia::net::node_base * > & | nodes, |
| const std::vector< std::string > & | patterns, | ||
| std::vector< fuzzysearch_result > & | results, | ||
| fuzzysearch_options | opt | ||
| ) |
fuzzysearch: search for nodes that match the pattern string
| nodes | vector of nodes from where to start |
| pattern | strings to search |
|
noexcept |
Converts a node in a map of values.
e.g. given the tree
then to_map(foo) gives something more or less like:
map{ { "bar", 10 }, { "baz", map{ { "bux", vector{1.3, 5} } } } }