[C#] Update auto-generated C# bindings
[ldk-java] / c_sharp / src / org / ldk / structs / ScorerAccountingForInFlightHtlcs.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  * [`ScoreLookUp`] implementation that factors in in-flight HTLC liquidity.
11  * 
12  * Useful for custom [`Router`] implementations to wrap their [`ScoreLookUp`] on-the-fly when calling
13  * [`find_route`].
14  * 
15  * [`ScoreLookUp`]: crate::routing::scoring::ScoreLookUp
16  */
17 public class ScorerAccountingForInFlightHtlcs : CommonBase {
18         internal ScorerAccountingForInFlightHtlcs(object _dummy, long ptr) : base(ptr) { }
19         ~ScorerAccountingForInFlightHtlcs() {
20                 if (ptr != 0) { bindings.ScorerAccountingForInFlightHtlcs_free(ptr); }
21         }
22
23         /**
24          * Initialize a new `ScorerAccountingForInFlightHtlcs`.
25          */
26         public static ScorerAccountingForInFlightHtlcs of(org.ldk.structs.ScoreLookUp scorer, org.ldk.structs.InFlightHtlcs inflight_htlcs) {
27                 long ret = bindings.ScorerAccountingForInFlightHtlcs_new(scorer.ptr, inflight_htlcs == null ? 0 : inflight_htlcs.ptr);
28                 GC.KeepAlive(scorer);
29                 GC.KeepAlive(inflight_htlcs);
30                 if (ret >= 0 && ret <= 4096) { return null; }
31                 org.ldk.structs.ScorerAccountingForInFlightHtlcs ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ScorerAccountingForInFlightHtlcs(null, ret); }
32                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
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(inflight_htlcs); };
35                 return ret_hu_conv;
36         }
37
38         /**
39          * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
40          * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
41          */
42         public ScoreLookUp as_ScoreLookUp() {
43                 long ret = bindings.ScorerAccountingForInFlightHtlcs_as_ScoreLookUp(this.ptr);
44                 GC.KeepAlive(this);
45                 if (ret >= 0 && ret <= 4096) { return null; }
46                 ScoreLookUp ret_hu_conv = new ScoreLookUp(null, ret);
47                 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
48                 return ret_hu_conv;
49         }
50
51 }
52 } } }