Z3
 
Loading...
Searching...
No Matches
Probe.java
Go to the documentation of this file.
1
18package com.microsoft.z3;
19
20import java.lang.ref.ReferenceQueue;
21
30public class Probe extends Z3Object {
38 public double apply(Goal g)
39 {
40 getContext().checkContextMatch(g);
41 return Native.probeApply(getContext().nCtx(), getNativeObject(),
42 g.getNativeObject());
43 }
44
45 Probe(Context ctx, long obj)
46 {
47 super(ctx, obj);
48 }
49
50 Probe(Context ctx, String name) {
51 super(ctx, Native.mkProbe(ctx.nCtx(), name));
52 }
53
54 @Override
55 void incRef() {
56 Native.probeIncRef(getContext().nCtx(), getNativeObject());
57 }
58
59 @Override
60 void addToReferenceQueue() {
61 getContext().getReferenceQueue().storeReference(this, ProbeRef::new);
62 }
63
64 private static class ProbeRef extends Z3ReferenceQueue.Reference<Probe> {
65
66 private ProbeRef(Probe referent, ReferenceQueue<Z3Object> q) {
67 super(referent, q);
68 }
69
70 @Override
71 void decRef(Context ctx, long z3Obj) {
72 Native.probeDecRef(ctx.nCtx(), z3Obj);
73 }
74 }
75}
double apply(Goal g)
Definition Probe.java:38