]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/planning/PrePlanItem.java
Merged changes from feature/scl to master.
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / elaboration / chr / planning / PrePlanItem.java
diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/planning/PrePlanItem.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/planning/PrePlanItem.java
new file mode 100644 (file)
index 0000000..bb85900
--- /dev/null
@@ -0,0 +1,31 @@
+package org.simantics.scl.compiler.elaboration.chr.planning;\r
+\r
+public abstract class PrePlanItem {\r
+    int queuePos;\r
+    /* Primary priorities:\r
+     *     0 = check\r
+     *     1 = functional calculation\r
+     *     2 = almost completely bound relation\r
+     *     3 = completely inbound relation\r
+     */\r
+    public double primaryPriority = Double.POSITIVE_INFINITY;\r
+    public int secondaryPriority;\r
+    public long location;\r
+        \r
+    public PrePlanItem(int secondaryPriority) {\r
+        this.secondaryPriority = secondaryPriority;\r
+    }\r
+\r
+    public int compare(PrePlanItem other) {\r
+        if(primaryPriority < other.primaryPriority)\r
+            return -1;\r
+        if(primaryPriority > other.primaryPriority)\r
+            return 1;\r
+        return Integer.compare(secondaryPriority, other.secondaryPriority);    \r
+    }\r
+\r
+    public abstract void initializeListeners(QueryPlanningContext context);\r
+    public abstract void variableSolved(QueryPlanningContext context, int variableId);\r
+\r
+    public abstract void generate(QueryPlanningContext context);\r
+}\r