[C#] Update auto-generated C# bindings
[ldk-java] / c_sharp / src / org / ldk / structs / DefaultRouter.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 [`Router`] implemented using [`find_route`].
11  */
12 public class DefaultRouter : CommonBase {
13         internal DefaultRouter(object _dummy, long ptr) : base(ptr) { }
14         ~DefaultRouter() {
15                 if (ptr != 0) { bindings.DefaultRouter_free(ptr); }
16         }
17
18         /**
19          * Creates a new router.
20          */
21         public static DefaultRouter of(org.ldk.structs.NetworkGraph network_graph, org.ldk.structs.Logger logger, byte[] random_seed_bytes, org.ldk.structs.LockableScore scorer, org.ldk.structs.ProbabilisticScoringFeeParameters score_params) {
22                 long ret = bindings.DefaultRouter_new(network_graph == null ? 0 : network_graph.ptr, logger.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(random_seed_bytes, 32)), scorer.ptr, score_params == null ? 0 : score_params.ptr);
23                 GC.KeepAlive(network_graph);
24                 GC.KeepAlive(logger);
25                 GC.KeepAlive(random_seed_bytes);
26                 GC.KeepAlive(scorer);
27                 GC.KeepAlive(score_params);
28                 if (ret >= 0 && ret <= 4096) { return null; }
29                 org.ldk.structs.DefaultRouter ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.DefaultRouter(null, ret); }
30                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
31                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(network_graph); };
32                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(logger); };
33                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(scorer); };
34                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(score_params); };
35                 return ret_hu_conv;
36         }
37
38         /**
39          * Constructs a new Router which calls the relevant methods on this_arg.
40          * This copies the `inner` pointer in this_arg and thus the returned Router must be freed before this_arg is
41          */
42         public Router as_Router() {
43                 long ret = bindings.DefaultRouter_as_Router(this.ptr);
44                 GC.KeepAlive(this);
45                 if (ret >= 0 && ret <= 4096) { return null; }
46                 Router ret_hu_conv = new Router(null, ret);
47                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
48                 return ret_hu_conv;
49         }
50
51 }
52 } } }