[C#] Update auto-generated C# bindings
[ldk-java] / c_sharp / src / org / ldk / structs / MultiThreadedLockableScore.cs
1 using org.ldk.impl;
2 using org.ldk.enums;
3 using org.ldk.util;
4 using System;
5
6 namespace org { namespace ldk { namespace structs {
7
8
9 /**
10  * A concrete implementation of [`LockableScore`] which supports multi-threading.
11  */
12 public class MultiThreadedLockableScore : CommonBase {
13         internal MultiThreadedLockableScore(object _dummy, long ptr) : base(ptr) { }
14         ~MultiThreadedLockableScore() {
15                 if (ptr != 0) { bindings.MultiThreadedLockableScore_free(ptr); }
16         }
17
18         /**
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
21          */
22         public LockableScore as_LockableScore() {
23                 long ret = bindings.MultiThreadedLockableScore_as_LockableScore(this.ptr);
24                 GC.KeepAlive(this);
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); };
28                 return ret_hu_conv;
29         }
30
31         /**
32          * Serialize the MultiThreadedLockableScore object into a byte array which can be read by MultiThreadedLockableScore_read
33          */
34         public byte[] write() {
35                 long ret = bindings.MultiThreadedLockableScore_write(this.ptr);
36                 GC.KeepAlive(this);
37                 if (ret >= 0 && ret <= 4096) { return null; }
38                 byte[] ret_conv = InternalUtils.decodeUint8Array(ret);
39                 return ret_conv;
40         }
41
42         /**
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
45          */
46         public WriteableScore as_WriteableScore() {
47                 long ret = bindings.MultiThreadedLockableScore_as_WriteableScore(this.ptr);
48                 GC.KeepAlive(this);
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); };
52                 return ret_hu_conv;
53         }
54
55         /**
56          * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
57          */
58         public static MultiThreadedLockableScore of(org.ldk.structs.Score score) {
59                 long ret = bindings.MultiThreadedLockableScore_new(score.ptr);
60                 GC.KeepAlive(score);
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); };
65                 return ret_hu_conv;
66         }
67
68 }
69 } } }