521eaf898c9e323e3f9896c362cc712c220d58ea
[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          * Constructs a new Score which calls the relevant methods on this_arg.
20          * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
21          */
22         public Score as_Score() {
23                 long ret = bindings.MultiThreadedScoreLock_as_Score(this.ptr);
24                 GC.KeepAlive(this);
25                 if (ret >= 0 && ret <= 4096) { return null; }
26                 Score ret_hu_conv = new Score(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 MultiThreadedScoreLock object into a byte array which can be read by MultiThreadedScoreLock_read
33          */
34         public byte[] write() {
35                 byte[] ret = bindings.MultiThreadedScoreLock_write(this.ptr);
36                 GC.KeepAlive(this);
37                 return ret;
38         }
39
40 }
41 } } }