[C#] Drop reference to `assert` which makes building on Win hard
[ldk-java] / c_sharp / src / org / ldk / structs / Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.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 public class Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ : CommonBase {
9         Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ(object _dummy, long ptr) : base(ptr) { }
10         ~Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ() {
11                 if (ptr != 0) { bindings.CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(ptr); }
12         }
13
14         internal static Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ constr_from_ptr(long ptr) {
15                 if (bindings.CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(ptr)) {
16                         return new Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_OK(null, ptr);
17                 } else {
18                         return new Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_Err(null, ptr);
19                 }
20         }
21         public class Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_OK : Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ {
22                 public readonly TwoTuple_BlockHashChannelMonitorZ[] res;
23                 internal Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) {
24                         long[] res = bindings.CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_ok(ptr);
25                         int res_conv_35_len = res.Length;
26                         TwoTuple_BlockHashChannelMonitorZ[] res_conv_35_arr = new TwoTuple_BlockHashChannelMonitorZ[res_conv_35_len];
27                         for (int j = 0; j < res_conv_35_len; j++) {
28                                 long res_conv_35 = res[j];
29                                 TwoTuple_BlockHashChannelMonitorZ res_conv_35_hu_conv = new TwoTuple_BlockHashChannelMonitorZ(null, res_conv_35);
30                                 if (res_conv_35_hu_conv != null) { res_conv_35_hu_conv.ptrs_to.AddLast(this); };
31                                 res_conv_35_arr[j] = res_conv_35_hu_conv;
32                         }
33                         this.res = res_conv_35_arr;
34                 }
35         }
36
37         public class Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_Err : Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ {
38                 public readonly IOError err;
39                 internal Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) {
40                         this.err = bindings.CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_err(ptr);
41                 }
42         }
43
44         /**
45          * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the success state.
46          */
47         public static Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ ok(TwoTuple_BlockHashChannelMonitorZ[] o) {
48                 long ret = bindings.CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(o != null ? InternalUtils.mapArray(o, o_conv_35 => o_conv_35 != null ? o_conv_35.ptr : 0) : null);
49                 GC.KeepAlive(o);
50                 if (ret >= 0 && ret <= 4096) { return null; }
51                 Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ ret_hu_conv = Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.constr_from_ptr(ret);
52                 return ret_hu_conv;
53         }
54
55         /**
56          * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the error state.
57          */
58         public static Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ err(IOError e) {
59                 long ret = bindings.CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(e);
60                 GC.KeepAlive(e);
61                 if (ret >= 0 && ret <= 4096) { return null; }
62                 Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ ret_hu_conv = Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.constr_from_ptr(ret);
63                 return ret_hu_conv;
64         }
65
66         /**
67          * Checks if the given object is currently in the success state
68          */
69         public bool is_ok() {
70                 bool ret = bindings.CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(this.ptr);
71                 GC.KeepAlive(this);
72                 return ret;
73         }
74
75         internal long clone_ptr() {
76                 long ret = bindings.CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(this.ptr);
77                 GC.KeepAlive(this);
78                 return ret;
79         }
80
81         /**
82          * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ which has the same data as `orig`
83          * but with all dynamically-allocated buffers duplicated in new buffers.
84          */
85         public Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ clone() {
86                 long ret = bindings.CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(this.ptr);
87                 GC.KeepAlive(this);
88                 if (ret >= 0 && ret <= 4096) { return null; }
89                 Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ ret_hu_conv = Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.constr_from_ptr(ret);
90                 return ret_hu_conv;
91         }
92
93 }
94 } } }