[C#] Drop reference to `assert` which makes building on Win hard
[ldk-java] / c_sharp / src / org / ldk / structs / MultiThreadedScoreLock.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 locked `MultiThreadedLockableScore`.
11  */
12 public class MultiThreadedScoreLock : CommonBase {
13         internal MultiThreadedScoreLock(object _dummy, long ptr) : base(ptr) { }
14         ~MultiThreadedScoreLock() {
15                 if (ptr != 0) { bindings.MultiThreadedScoreLock_free(ptr); }
16         }
17
18         /**
19          * Serialize the MultiThreadedScoreLock object into a byte array which can be read by MultiThreadedScoreLock_read
20          */
21         public byte[] write() {
22                 byte[] ret = bindings.MultiThreadedScoreLock_write(this.ptr);
23                 GC.KeepAlive(this);
24                 return ret;
25         }
26
27         /**
28          * Constructs a new Score which calls the relevant methods on this_arg.
29          * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
30          */
31         public Score as_Score() {
32                 long ret = bindings.MultiThreadedScoreLock_as_Score(this.ptr);
33                 GC.KeepAlive(this);
34                 if (ret >= 0 && ret <= 4096) { return null; }
35                 Score ret_hu_conv = new Score(null, ret);
36                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
37                 return ret_hu_conv;
38         }
39
40 }
41 } } }