X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.graph.compiler%2Fsrc%2Forg%2Fsimantics%2Fgraph%2Fcompiler%2Finternal%2Fprocedures%2FPropagateNewMarks.java;fp=bundles%2Forg.simantics.graph.compiler%2Fsrc%2Forg%2Fsimantics%2Fgraph%2Fcompiler%2Finternal%2Fprocedures%2FPropagateNewMarks.java;h=3fc6fe1c0d8a06390cf302423ef36de1269fcff1;hp=0000000000000000000000000000000000000000;hb=969bd23cab98a79ca9101af33334000879fb60c5;hpb=866dba5cd5a3929bbeae85991796acb212338a08 diff --git a/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/procedures/PropagateNewMarks.java b/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/procedures/PropagateNewMarks.java new file mode 100644 index 000000000..3fc6fe1c0 --- /dev/null +++ b/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/procedures/PropagateNewMarks.java @@ -0,0 +1,24 @@ +package org.simantics.graph.compiler.internal.procedures; + +import org.simantics.graph.store.GraphStore; +import org.simantics.graph.store.IdentityStore; + +public class PropagateNewMarks implements Runnable { + IdentityStore identities; + + public PropagateNewMarks(GraphStore store) { + this.identities = store.identities; + } + + private void propagateNewMarks(int resource) { + for(int child : identities.getChildren(resource)) + if(identities.markNew(child)) + propagateNewMarks(child); + } + + @Override + public void run() { + for(int resource : identities.getNewResources()) + propagateNewMarks(resource); + } +}