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 byte[] ret = bindings.MultiThreadedLockableScore_write(this.ptr);
41 * Constructs a new WriteableScore which calls the relevant methods on this_arg.
42 * This copies the `inner` pointer in this_arg and thus the returned WriteableScore must be freed before this_arg is
44 public WriteableScore as_WriteableScore() {
45 long ret = bindings.MultiThreadedLockableScore_as_WriteableScore(this.ptr);
47 if (ret >= 0 && ret <= 4096) { return null; }
48 WriteableScore ret_hu_conv = new WriteableScore(null, ret);
49 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
54 * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
56 public static MultiThreadedLockableScore of(org.ldk.structs.Score score) {
57 long ret = bindings.MultiThreadedLockableScore_new(score == null ? 0 : score.ptr);
59 if (ret >= 0 && ret <= 4096) { return null; }
60 org.ldk.structs.MultiThreadedLockableScore ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.MultiThreadedLockableScore(null, ret); }
61 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
62 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(score); };