[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, org.ldk.structs.EntropySource entropy_source, 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, entropy_source.ptr, scorer.ptr, score_params == null ? 0 : score_params.ptr);
23                 GC.KeepAlive(network_graph);
24                 GC.KeepAlive(logger);
25                 GC.KeepAlive(entropy_source);
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(entropy_source); };
34                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(scorer); };
35                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(score_params); };
36                 return ret_hu_conv;
37         }
38
39         /**
40          * Constructs a new Router which calls the relevant methods on this_arg.
41          * This copies the `inner` pointer in this_arg and thus the returned Router must be freed before this_arg is
42          */
43         public Router as_Router() {
44                 long ret = bindings.DefaultRouter_as_Router(this.ptr);
45                 GC.KeepAlive(this);
46                 if (ret >= 0 && ret <= 4096) { return null; }
47                 Router ret_hu_conv = new Router(null, ret);
48                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
49                 return ret_hu_conv;
50         }
51
52         /**
53          * Constructs a new MessageRouter which calls the relevant methods on this_arg.
54          * This copies the `inner` pointer in this_arg and thus the returned MessageRouter must be freed before this_arg is
55          */
56         public MessageRouter as_MessageRouter() {
57                 long ret = bindings.DefaultRouter_as_MessageRouter(this.ptr);
58                 GC.KeepAlive(this);
59                 if (ret >= 0 && ret <= 4096) { return null; }
60                 MessageRouter ret_hu_conv = new MessageRouter(null, ret);
61                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
62                 return ret_hu_conv;
63         }
64
65 }
66 } } }