macro_rules! node_ctor {
($registry:expr, $type_name:expr, $ctor:expr) => { ... };
}Expand description
Register a node constructor by type name.
Shorthand for NodeFactory::register_fn. Emits a call to
registry.register_fn(type_name, closure).
ยงExample
use rill_graph::{node_ctor, NodeFactory};
use rill_core::traits::{NodeId, Params, NodeVariant, Source, Node};
// Inside a function that has access to a &mut NodeFactory<f32, 64>:
fn register(registry: &mut NodeFactory<f32, 64>) {
node_ctor!(registry, "test/my_source", |id, params| {
// construct and return NodeVariant
todo!()
});
}