6 namespace org { namespace ldk { namespace structs {
10 * A concrete implementation of [`LockableScore`] which supports multi-threading.
12 public class MultiThreadedLockableScore : CommonBase {
13 internal MultiThreadedLockableScore(object _dummy, long ptr) : base(ptr) { }
14 ~MultiThreadedLockableScore() {
15 if (ptr != 0) { bindings.MultiThreadedLockableScore_free(ptr); }
19 * Constructs a new LockableScore which calls the relevant methods on this_arg.
20 * This copies the `inner` pointer in this_arg and thus the returned LockableScore must be freed before this_arg is
22 public LockableScore as_LockableScore() {
23 long ret = bindings.MultiThreadedLockableScore_as_LockableScore(this.ptr);
25 if (ret >= 0 && ret <= 4096) { return null; }
26 LockableScore ret_hu_conv = new LockableScore(null, ret);
27 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
32 * Serialize the MultiThreadedLockableScore object into a byte array which can be read by MultiThreadedLockableScore_read
34 public byte[] write() {
35 long ret = bindings.MultiThreadedLockableScore_write(this.ptr);
37 if (ret >= 0 && ret <= 4096) { return null; }
38 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
43 * Constructs a new WriteableScore which calls the relevant methods on this_arg.
44 * This copies the `inner` pointer in this_arg and thus the returned WriteableScore must be freed before this_arg is
46 public WriteableScore as_WriteableScore() {
47 long ret = bindings.MultiThreadedLockableScore_as_WriteableScore(this.ptr);
49 if (ret >= 0 && ret <= 4096) { return null; }
50 WriteableScore ret_hu_conv = new WriteableScore(null, ret);
51 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
56 * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
58 public static MultiThreadedLockableScore of(org.ldk.structs.Score score) {
59 long ret = bindings.MultiThreadedLockableScore_new(score.ptr);
61 if (ret >= 0 && ret <= 4096) { return null; }
62 org.ldk.structs.MultiThreadedLockableScore ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.MultiThreadedLockableScore(null, ret); }
63 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
64 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(score); };