1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
7 import java.lang.ref.Reference;
8 import javax.annotation.Nullable;
12 * A concrete implementation of [`LockableScore`] which supports multi-threading.
14 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
15 public class MultiThreadedLockableScore extends CommonBase {
16 MultiThreadedLockableScore(Object _dummy, long ptr) { super(ptr); }
17 @Override @SuppressWarnings("deprecation")
18 protected void finalize() throws Throwable {
20 if (ptr != 0) { bindings.MultiThreadedLockableScore_free(ptr); }
24 * Serialize the MultiThreadedLockableScore object into a byte array which can be read by MultiThreadedLockableScore_read
26 public byte[] write() {
27 byte[] ret = bindings.MultiThreadedLockableScore_write(this.ptr);
28 Reference.reachabilityFence(this);
33 * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
35 public static MultiThreadedLockableScore of(Score score) {
36 long ret = bindings.MultiThreadedLockableScore_new(score == null ? 0 : score.ptr);
37 Reference.reachabilityFence(score);
38 if (ret >= 0 && ret <= 4096) { return null; }
39 org.ldk.structs.MultiThreadedLockableScore ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.MultiThreadedLockableScore(null, ret); }
40 ret_hu_conv.ptrs_to.add(ret_hu_conv);
41 ret_hu_conv.ptrs_to.add(score);