From 564ba915e5471a9629e73cd8e9a33b390f5f8759 Mon Sep 17 00:00:00 2001 From: Agustin Borgna Date: Wed, 27 Sep 2023 13:58:18 +0100 Subject: [PATCH] feat: Add a `DataflowParentID` node handle corresponding to a `DataflowParent` tag --- src/ops/handle.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ops/handle.rs b/src/ops/handle.rs index beaff0a91..f62524f4e 100644 --- a/src/ops/handle.rs +++ b/src/ops/handle.rs @@ -118,6 +118,10 @@ pub struct TailLoopID(Node); /// Handle to a [Conditional](crate::ops::Conditional) node. pub struct ConditionalID(Node); +#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, DerFrom, Debug)] +/// Handle to a dataflow container node. +pub struct DataflowParentID(Node); + /// Implements the `NodeHandle` trait for a tuple struct that contains just a /// NodeIndex. Takes the name of the struct, and the corresponding OpTag. /// @@ -139,6 +143,7 @@ macro_rules! impl_nodehandle { }; } +impl_nodehandle!(DataflowParentID, OpTag::DataflowParent); impl_nodehandle!(DataflowOpID, OpTag::DataflowChild); impl_nodehandle!(ConditionalID, OpTag::Conditional); impl_nodehandle!(CaseID, OpTag::Case); @@ -185,6 +190,7 @@ macro_rules! impl_containerHandle { }; } +impl_containerHandle!(DataflowParentID, DataflowOpID); impl_containerHandle!(DfgID, DataflowOpID); impl_containerHandle!(TailLoopID, DataflowOpID); impl_containerHandle!(ConditionalID, CaseID);