macro_rules! graph {
($i:ident $op:tt $($tail:tt)*) => { ... };
($i:ident$(,)?) => { ... };
}Expand description
Constructs a Graph using an intuitive shorthand for node ordering
relationships.
ยงExample:
fn one(_: ()) -> Result<(), GraphError> {
log::trace!("one");
Ok(())
}
fn two(mut an_f32: ViewMut<f32>) -> Result<(), GraphError> {
log::trace!("two");
*an_f32 += 1.0;
Ok(())
}
fn three(_: ()) -> Result<(), GraphError> {
log::trace!("three");
Ok(())
}
let _a = graph!(one < two, three, three > two);
let _b = graph!(one, two);
let _c = graph!(one < two);
let _d = graph!(one);
let _e = graph!(one < two < three);
let mut g = graph!(one < two < three).with_resource(0.0f32);
g.reschedule().unwrap();
let schedule = g.get_schedule();
assert_eq!(vec![vec!["one"], vec!["two"], vec!["three"]], schedule);