OSSIA
Open Scenario System for Interactive Application
Node

Node creation, removal, finding. More...

Detailed Description

Node creation, removal, finding.

See also
ossia::net::node_base

Functions

OSSIA_EXPORT ossia_node_t ossia_node_find (ossia_node_t root, const char *path)
 Find a child node. More...
 
OSSIA_EXPORT void ossia_node_find_pattern (ossia_node_t root, const char *pattern, ossia_node_t **data, size_t *size)
 Find nodes matching a wildcard pattern. More...
 
OSSIA_EXPORT ossia_node_t ossia_node_create (ossia_node_t root, const char *path)
 Create a child node. More...
 
OSSIA_EXPORT void ossia_node_create_pattern (ossia_node_t root, const char *pattern, ossia_node_t **data, size_t *size)
 Create nodes matching a brace expansion pattern. More...
 
OSSIA_EXPORT void ossia_node_array_free (ossia_node_t *)
 Free an array of nodes allocated with ossia_node_find_pattern or ossia_node_create_pattern. More...
 
OSSIA_EXPORT ossia_node_t ossia_node_add_child (ossia_node_t node, const char *name)
 Create a direct child node. More...
 
OSSIA_EXPORT void ossia_node_remove_child (ossia_node_t node, ossia_node_t name)
 Removes a direct child node. More...
 
OSSIA_EXPORT const char * ossia_node_get_name (ossia_node_t node)
 Get the name of a node. More...
 
OSSIA_EXPORT ossia_device_t ossia_node_get_device (ossia_node_t node)
 Get the root device of a node. More...
 
OSSIA_EXPORT int ossia_node_child_size (ossia_node_t node)
 Get the number of children of a node. More...
 
OSSIA_EXPORT ossia_node_t ossia_node_get_child (ossia_node_t node, int child_n)
 Get a specific direct child of a node. More...
 
OSSIA_EXPORT ossia_node_t ossia_node_find_child (ossia_node_t node, const char *name)
 Find a direct child of a node by name. More...
 
OSSIA_EXPORT ossia_parameter_t ossia_node_create_parameter (ossia_node_t node, ossia_type type)
 Create a parameter in a node. More...
 
OSSIA_EXPORT ossia_parameter_t ossia_create_parameter (ossia_node_t node, const char *name, const char *type)
 Create a child parameter. More...
 
OSSIA_EXPORT ossia_parameter_t ossia_node_get_parameter (ossia_node_t node)
 Get the address contained in a node if any. More...
 
OSSIA_EXPORT void ossia_node_remove_parameter (ossia_node_t node)
 Remove the address contained in a node if any. More...
 
OSSIA_EXPORT ossia_node_callback_idx_t ossia_node_add_deleting_callback (ossia_node_t node, ossia_node_callback_t callback, void *ctx)
 Add a callback called when a node is about to be removed. More...
 
OSSIA_EXPORT void ossia_node_remove_deleting_callback (ossia_node_t node, ossia_node_callback_idx_t index)
 Remove a callback added with ossia_node_add_deleting_callback. More...
 
OSSIA_EXPORT void ossia_node_set_description (ossia_node_t node, const char *description)
 
OSSIA_EXPORT const char * ossia_node_get_description (ossia_node_t node)
 
OSSIA_EXPORT void ossia_node_set_extended_type (ossia_node_t node, const char *extended_type)
 
OSSIA_EXPORT const char * ossia_node_get_extended_type (ossia_node_t node)
 
OSSIA_EXPORT void ossia_node_set_tags (ossia_node_t node, const char **tags, size_t sz)
 
OSSIA_EXPORT void ossia_node_get_tags (ossia_node_t node, char ***tags, size_t *sz)
 
OSSIA_EXPORT void ossia_tags_free (char **tags, size_t sz)
 Free tags allocated with ossia_node_get_tags.
 
OSSIA_EXPORT void ossia_node_set_hidden (ossia_node_t node, int hidden)
 
OSSIA_EXPORT int ossia_node_get_hidden (ossia_node_t node)
 
OSSIA_EXPORT void ossia_node_set_refresh_rate (ossia_node_t node, int refresh_rate)
 
OSSIA_EXPORT void ossia_node_unset_refresh_rate (ossia_node_t node)
 
OSSIA_EXPORT int ossia_node_get_refresh_rate (ossia_node_t node, int *ok)
 
OSSIA_EXPORT void ossia_node_set_priority (ossia_node_t node, float priority)
 
OSSIA_EXPORT void ossia_node_unset_priority (ossia_node_t node)
 
OSSIA_EXPORT float ossia_node_get_priority (ossia_node_t node, int *ok)
 
OSSIA_EXPORT void ossia_node_set_value_step_size (ossia_node_t node, double value_step_size)
 
OSSIA_EXPORT void ossia_node_unset_value_step_size (ossia_node_t node)
 
OSSIA_EXPORT double ossia_node_get_value_step_size (ossia_node_t node, int *ok)
 
OSSIA_EXPORT void ossia_node_set_instance_bounds (ossia_node_t node, int min, int max)
 
OSSIA_EXPORT void ossia_node_unset_instance_bounds (ossia_node_t node)
 
OSSIA_EXPORT void ossia_node_get_instance_bounds (ossia_node_t node, int *min, int *max, int *ok)
 
OSSIA_EXPORT void ossia_node_set_default_value (ossia_node_t node, ossia_value_t default_value)
 
OSSIA_EXPORT ossia_value_t ossia_node_get_default_value (ossia_node_t node)
 

Function Documentation

◆ ossia_node_find()

OSSIA_EXPORT ossia_node_t ossia_node_find ( ossia_node_t  root,
const char *  path 
)

Find a child node.

Parameters
rootThe root node where the search starts from.
nameAn address such as "/foo/bar"
Returns
The node, or NULL if not found.
Note
Multithread guarantees: Data-Safe.
See also
ossia::net::find_node

◆ ossia_node_find_pattern()

OSSIA_EXPORT void ossia_node_find_pattern ( ossia_node_t  root,
const char *  pattern,
ossia_node_t **  data,
size_t *  size 
)

Find nodes matching a wildcard pattern.

Parameters
rootThe root node where the search starts from.
nameAn address such as /foo.[0-5]/{bar,baz}*
dataWhere the found nodes will be stored. Set to NULL if none were found.
sizePointer to the number of found nodes.

Usage:

ossia_node_t* data;
size_t sz;
ossia_node_find_pattern(root, "/foo/bar.*", &data, &sz);
...
ossia_node_array_free(data);
void ossia_node_find_pattern(ossia_node_t node, const char *pattern, ossia_node_t **data, size_t *size)
Find nodes matching a wildcard pattern.
Definition: ossia_node.cpp:80
Note
Multithread guarantees: Data-Safe.
See also
ossia::net::find_nodes

◆ ossia_node_create()

OSSIA_EXPORT ossia_node_t ossia_node_create ( ossia_node_t  root,
const char *  path 
)

Create a child node.

Parameters
rootThe root node where the search starts from.
nameAn address such as "/foo/bar"
Returns
The node, or NULL if not found.

Node creation follows the instance rules:

ossia_node_create(root, "/foo/bar");
ossia_node_create(root, "/foo/bar");
ossia_node_create(root, "/foo/bar");
ossia_node_t ossia_node_create(ossia_node_t node, const char *name)
Create a child node.
Definition: ossia_node.cpp:113

will create /foo/bar, /foo/bar.1, /foo/bar.2. *

Note
Multithread guarantees: MT-Safe.
See also
ossia::net::create_node

◆ ossia_node_create_pattern()

OSSIA_EXPORT void ossia_node_create_pattern ( ossia_node_t  root,
const char *  pattern,
ossia_node_t **  data,
size_t *  size 
)

Create nodes matching a brace expansion pattern.

Parameters
rootThe root node where the creation starts from.
nameAn address such as /foo.[0-5]/{bar,baz}
dataWhere the created nodes will be stored. Set to NULL if none were created.
sizePointer to the number of created nodes.

Usage:

ossia_node_t* data;
size_t sz;
ossia_node_create_pattern(root, "/foo.[0-5]/{bar,baz}", &data, &sz);
...
ossia_node_array_free(data);
void ossia_node_create_pattern(ossia_node_t node, const char *pattern, ossia_node_t **data, size_t *size)
Create nodes matching a brace expansion pattern.
Definition: ossia_node.cpp:127
Note
Multithread guarantees: MT-Safe.
See also
ossia::net::create_nodes

◆ ossia_node_array_free()

OSSIA_EXPORT void ossia_node_array_free ( ossia_node_t *  data)

Free an array of nodes allocated with ossia_node_find_pattern or ossia_node_create_pattern.

Note
Multithread guarantees: MT-Safe.

◆ ossia_node_add_child()

OSSIA_EXPORT ossia_node_t ossia_node_add_child ( ossia_node_t  node,
const char *  name 
)

Create a direct child node.

Parameters
nodeThe parent
nameThe name of the node, e.g. "foo"
Note
Multithread guarantees: MT-Safe.
See also
ossia::net::node_base::add_child.
ossia_node_create

◆ ossia_node_remove_child()

OSSIA_EXPORT void ossia_node_remove_child ( ossia_node_t  node,
ossia_node_t  name 
)

Removes a direct child node.

Parameters
nodeThe parent.
nameThe name of the node, e.g. "foo"
Note
Multithread guarantees: MT-Safe.
See also
ossia::net::node_base::remove_child

◆ ossia_node_get_name()

OSSIA_EXPORT const char* ossia_node_get_name ( ossia_node_t  node)

Get the name of a node.

Note
Multithread guarantees: Data-Safe.
See also
ossia::net::node_base::get_name

◆ ossia_node_get_device()

OSSIA_EXPORT ossia_device_t ossia_node_get_device ( ossia_node_t  node)

Get the root device of a node.

Note
Don't free the device obtained from here
Multithread guarantees: Data-Safe.
See also
ossia::net::node_base::get_device

◆ ossia_node_child_size()

OSSIA_EXPORT int ossia_node_child_size ( ossia_node_t  node)

Get the number of children of a node.

Note
Multithread guarantees: Data-Safe.
See also
ossia::net::node_base::children

◆ ossia_node_get_child()

OSSIA_EXPORT ossia_node_t ossia_node_get_child ( ossia_node_t  node,
int  child_n 
)

Get a specific direct child of a node.

Note
Multithread guarantees: Data-Safe.
See also
ossia::net::node_base::children

◆ ossia_node_find_child()

OSSIA_EXPORT ossia_node_t ossia_node_find_child ( ossia_node_t  node,
const char *  name 
)

Find a direct child of a node by name.

Note
Multithread guarantees: Data-Safe.
See also
ossia::net::node_base::find_child

◆ ossia_node_create_parameter()

OSSIA_EXPORT ossia_parameter_t ossia_node_create_parameter ( ossia_node_t  node,
ossia_type  type 
)

Create a parameter in a node.

Parameters
typeType of the address
Note
Multithread guarantees: MT-Safe.
See also
ossia::net::node_base::create_parameter

◆ ossia_create_parameter()

OSSIA_EXPORT ossia_parameter_t ossia_create_parameter ( ossia_node_t  node,
const char *  name,
const char *  type 
)

Create a child parameter.

Parameters
typeType of the address ("color.rgba8", "float", "i32"...)
Note
Multithread guarantees: MT-Safe.
See also
ossia::net::create_parameter

◆ ossia_node_get_parameter()

OSSIA_EXPORT ossia_parameter_t ossia_node_get_parameter ( ossia_node_t  node)

Get the address contained in a node if any.

Note
Multithread guarantees: Data-Safe.
See also
ossia::net::node_base::get_parameter

◆ ossia_node_remove_parameter()

OSSIA_EXPORT void ossia_node_remove_parameter ( ossia_node_t  node)

Remove the address contained in a node if any.

Note
Multithread guarantees: MT-Safe.
See also
ossia::net::node_base::remove_parameter

◆ ossia_node_add_deleting_callback()

OSSIA_EXPORT ossia_node_callback_idx_t ossia_node_add_deleting_callback ( ossia_node_t  node,
ossia_node_callback_t  callback,
void *  ctx 
)

Add a callback called when a node is about to be removed.

Parameters
nodeNode on which the callback is added.
callbackFunction to be called.
ctxWill be passed to the callback.
Returns
An identifier to be able to remove the callback on a later date.
See also
ossia::net::node_base::about_to_be_deleted
Note
Multithread guarantees: MT-Safe. The callback is called from the thread where the node is being deleted

◆ ossia_node_remove_deleting_callback()

OSSIA_EXPORT void ossia_node_remove_deleting_callback ( ossia_node_t  node,
ossia_node_callback_idx_t  index 
)

Remove a callback added with ossia_node_add_deleting_callback.

Parameters
nodeNode on which the callback must be removed.
indexIndex of the callback to remove.
See also
ossia::net::node_base::about_to_be_deleted
Note
Multithread guarantees: MT-Safe.
The callback index must not be used afterwards

◆ ossia_node_set_description()

OSSIA_EXPORT void ossia_node_set_description ( ossia_node_t  node,
const char *  description 
)
See also
ossia::net::set_description
Note
Multithread guarantees: MT-Safe.

◆ ossia_node_get_description()

OSSIA_EXPORT const char* ossia_node_get_description ( ossia_node_t  node)
See also
ossia::net::get_description, ossia_string_free
Note
Multithread guarantees: Data-Safe.

◆ ossia_node_set_extended_type()

OSSIA_EXPORT void ossia_node_set_extended_type ( ossia_node_t  node,
const char *  extended_type 
)
See also
ossia::net::set_extended_type
Note
Multithread guarantees: MT-Safe.

◆ ossia_node_get_extended_type()

OSSIA_EXPORT const char* ossia_node_get_extended_type ( ossia_node_t  node)
See also
ossia::net::get_extended_type, ossia_string_free
Note
Multithread guarantees: Data-Safe.

◆ ossia_node_set_tags()

OSSIA_EXPORT void ossia_node_set_tags ( ossia_node_t  node,
const char **  tags,
size_t  sz 
)
See also
ossia::net::set_tags
Note
Multithread guarantees: MT-Safe.

◆ ossia_node_get_tags()

OSSIA_EXPORT void ossia_node_get_tags ( ossia_node_t  node,
char ***  tags,
size_t *  sz 
)
See also
ossia::net::get_tags, ossia_tags_free
Note
Multithread guarantees: Data-Safe.

◆ ossia_node_set_hidden()

OSSIA_EXPORT void ossia_node_set_hidden ( ossia_node_t  node,
int  hidden 
)
See also
ossia::net::set_hidden
Note
Multithread guarantees: MT-Safe.

hidden is a boolean value.

◆ ossia_node_get_hidden()

OSSIA_EXPORT int ossia_node_get_hidden ( ossia_node_t  node)
See also
ossia::net::get_hidden
Note
Multithread guarantees: Data-Safe.

◆ ossia_node_set_refresh_rate()

OSSIA_EXPORT void ossia_node_set_refresh_rate ( ossia_node_t  node,
int  refresh_rate 
)
See also
ossia::net::set_refresh_rate
Note
Multithread guarantees: MT-Safe.

◆ ossia_node_unset_refresh_rate()

OSSIA_EXPORT void ossia_node_unset_refresh_rate ( ossia_node_t  node)
See also
ossia::net::set_refresh_rate
Note
Multithread guarantees: MT-Safe.

◆ ossia_node_get_refresh_rate()

OSSIA_EXPORT int ossia_node_get_refresh_rate ( ossia_node_t  node,
int *  ok 
)
See also
ossia::net::get_refresh_rate
Note
Multithread guarantees: Data-Safe.

◆ ossia_node_set_priority()

OSSIA_EXPORT void ossia_node_set_priority ( ossia_node_t  node,
float  priority 
)
See also
ossia::net::set_priority
Note
Multithread guarantees: MT-Safe.

◆ ossia_node_unset_priority()

OSSIA_EXPORT void ossia_node_unset_priority ( ossia_node_t  node)
See also
ossia::net::set_priority
Note
Multithread guarantees: MT-Safe.

◆ ossia_node_get_priority()

OSSIA_EXPORT float ossia_node_get_priority ( ossia_node_t  node,
int *  ok 
)
See also
ossia::net::get_priority
Note
Multithread guarantees: Data-Safe.

◆ ossia_node_set_value_step_size()

OSSIA_EXPORT void ossia_node_set_value_step_size ( ossia_node_t  node,
double  value_step_size 
)
See also
ossia::net::set_value_step_size
Note
Multithread guarantees: MT-Safe.

◆ ossia_node_unset_value_step_size()

OSSIA_EXPORT void ossia_node_unset_value_step_size ( ossia_node_t  node)
See also
ossia::net::set_value_step_size
Note
Multithread guarantees: MT-Safe.

◆ ossia_node_get_value_step_size()

OSSIA_EXPORT double ossia_node_get_value_step_size ( ossia_node_t  node,
int *  ok 
)
See also
ossia::net::get_value_step_size
Note
Multithread guarantees: Data-Safe.

◆ ossia_node_set_instance_bounds()

OSSIA_EXPORT void ossia_node_set_instance_bounds ( ossia_node_t  node,
int  min,
int  max 
)
See also
ossia::net::set_instance_bounds
Note
Multithread guarantees: MT-Safe.

◆ ossia_node_unset_instance_bounds()

OSSIA_EXPORT void ossia_node_unset_instance_bounds ( ossia_node_t  node)
See also
ossia::net::set_instance_bounds
Note
Multithread guarantees: MT-Safe.

◆ ossia_node_get_instance_bounds()

OSSIA_EXPORT void ossia_node_get_instance_bounds ( ossia_node_t  node,
int *  min,
int *  max,
int *  ok 
)
See also
ossia::net::get_instance_bounds
Note
Multithread guarantees: Data-Safe.

◆ ossia_node_set_default_value()

OSSIA_EXPORT void ossia_node_set_default_value ( ossia_node_t  node,
ossia_value_t  default_value 
)
See also
ossia::net::set_default_value
Note
Multithread guarantees: MT-Safe.

◆ ossia_node_get_default_value()

OSSIA_EXPORT ossia_value_t ossia_node_get_default_value ( ossia_node_t  node)
See also
ossia::net::get_default_value
Note
Multithread guarantees: Data-Safe.