Z3
 
Loading...
Searching...
No Matches
ConstructorList.java
Go to the documentation of this file.
1
18package com.microsoft.z3;
19
20import java.lang.ref.ReferenceQueue;
21
25public class ConstructorList<R> extends Z3Object {
26
27 ConstructorList(Context ctx, long obj)
28 {
29 super(ctx, obj);
30 }
31
32 @Override
33 void incRef() {
34 // Constructor lists are not reference counted.
35 }
36
37 @Override
38 void addToReferenceQueue() {
39 getContext().getReferenceQueue().storeReference(this, ConstructorListRef::new);
40 }
41
42 ConstructorList(Context ctx, Constructor<R>[] constructors)
43 {
44 super(ctx, Native.mkConstructorList(ctx.nCtx(),
45 constructors.length,
46 Constructor.arrayToNative(constructors)));
47 }
48
49 private static class ConstructorListRef extends Z3ReferenceQueue.Reference<ConstructorList<?>> {
50
51 private ConstructorListRef(ConstructorList<?> referent, ReferenceQueue<Z3Object> q) {
52 super(referent, q);
53 }
54
55 @Override
56 void decRef(Context ctx, long z3Obj) {
57 Native.delConstructorList(ctx.nCtx(), z3Obj);
58 }
59 }
60}
static long[] arrayToNative(Z3Object[] a)
Definition Z3Object.java:73