6 namespace org { namespace ldk { namespace structs {
9 * An enum which can either contain a crate::c_types::derived::CVec_NetAddressZ or not
11 public class Option_CVec_NetAddressZZ : CommonBase {
12 protected Option_CVec_NetAddressZZ(object _dummy, long ptr) : base(ptr) { }
13 ~Option_CVec_NetAddressZZ() {
14 if (ptr != 0) { bindings.COption_CVec_NetAddressZZ_free(ptr); }
17 internal static Option_CVec_NetAddressZZ constr_from_ptr(long ptr) {
18 long raw_ty = bindings.LDKCOption_CVec_NetAddressZZ_ty_from_ptr(ptr);
20 case 0: return new Option_CVec_NetAddressZZ_Some(ptr);
21 case 1: return new Option_CVec_NetAddressZZ_None(ptr);
23 throw new ArgumentException("Impossible enum variant");
27 /** A Option_CVec_NetAddressZZ of type Some */
28 public class Option_CVec_NetAddressZZ_Some : Option_CVec_NetAddressZZ {
29 public NetAddress[] some;
30 internal Option_CVec_NetAddressZZ_Some(long ptr) : base(null, ptr) {
31 long[] some = bindings.LDKCOption_CVec_NetAddressZZ_Some_get_some(ptr);
32 int some_conv_12_len = some.Length;
33 NetAddress[] some_conv_12_arr = new NetAddress[some_conv_12_len];
34 for (int m = 0; m < some_conv_12_len; m++) {
35 long some_conv_12 = some[m];
36 org.ldk.structs.NetAddress some_conv_12_hu_conv = org.ldk.structs.NetAddress.constr_from_ptr(some_conv_12);
37 if (some_conv_12_hu_conv != null) { some_conv_12_hu_conv.ptrs_to.AddLast(this); };
38 some_conv_12_arr[m] = some_conv_12_hu_conv;
40 this.some = some_conv_12_arr;
43 /** A Option_CVec_NetAddressZZ of type None */
44 public class Option_CVec_NetAddressZZ_None : Option_CVec_NetAddressZZ {
45 internal Option_CVec_NetAddressZZ_None(long ptr) : base(null, ptr) {
49 * Constructs a new COption_CVec_NetAddressZZ containing a crate::c_types::derived::CVec_NetAddressZ
51 public static Option_CVec_NetAddressZZ some(NetAddress[] o) {
52 long ret = bindings.COption_CVec_NetAddressZZ_some(o != null ? InternalUtils.mapArray(o, o_conv_12 => o_conv_12.ptr) : null);
54 if (ret >= 0 && ret <= 4096) { return null; }
55 org.ldk.structs.Option_CVec_NetAddressZZ ret_hu_conv = org.ldk.structs.Option_CVec_NetAddressZZ.constr_from_ptr(ret);
56 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
57 foreach (NetAddress o_conv_12 in o) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o_conv_12); }; };
62 * Constructs a new COption_CVec_NetAddressZZ containing nothing
64 public static Option_CVec_NetAddressZZ none() {
65 long ret = bindings.COption_CVec_NetAddressZZ_none();
66 if (ret >= 0 && ret <= 4096) { return null; }
67 org.ldk.structs.Option_CVec_NetAddressZZ ret_hu_conv = org.ldk.structs.Option_CVec_NetAddressZZ.constr_from_ptr(ret);
68 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
72 internal long clone_ptr() {
73 long ret = bindings.COption_CVec_NetAddressZZ_clone_ptr(this.ptr);
79 * Creates a new COption_CVec_NetAddressZZ which has the same data as `orig`
80 * but with all dynamically-allocated buffers duplicated in new buffers.
82 public Option_CVec_NetAddressZZ clone() {
83 long ret = bindings.COption_CVec_NetAddressZZ_clone(this.ptr);
85 if (ret >= 0 && ret <= 4096) { return null; }
86 org.ldk.structs.Option_CVec_NetAddressZZ ret_hu_conv = org.ldk.structs.Option_CVec_NetAddressZZ.constr_from_ptr(ret);
87 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };