6 namespace org { namespace ldk { namespace structs {
8 public class Result_ProbabilisticScorerDecodeErrorZ : CommonBase {
9 Result_ProbabilisticScorerDecodeErrorZ(object _dummy, long ptr) : base(ptr) { }
10 ~Result_ProbabilisticScorerDecodeErrorZ() {
11 if (ptr != 0) { bindings.CResult_ProbabilisticScorerDecodeErrorZ_free(ptr); }
14 internal static Result_ProbabilisticScorerDecodeErrorZ constr_from_ptr(long ptr) {
15 if (bindings.CResult_ProbabilisticScorerDecodeErrorZ_is_ok(ptr)) {
16 return new Result_ProbabilisticScorerDecodeErrorZ_OK(null, ptr);
18 return new Result_ProbabilisticScorerDecodeErrorZ_Err(null, ptr);
21 public class Result_ProbabilisticScorerDecodeErrorZ_OK : Result_ProbabilisticScorerDecodeErrorZ {
22 public readonly ProbabilisticScorer res;
23 internal Result_ProbabilisticScorerDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) {
24 long res = bindings.CResult_ProbabilisticScorerDecodeErrorZ_get_ok(ptr);
25 org.ldk.structs.ProbabilisticScorer res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.ProbabilisticScorer(null, res); }
26 if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); };
27 this.res = res_hu_conv;
31 public class Result_ProbabilisticScorerDecodeErrorZ_Err : Result_ProbabilisticScorerDecodeErrorZ {
32 public readonly DecodeError err;
33 internal Result_ProbabilisticScorerDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) {
34 long err = bindings.CResult_ProbabilisticScorerDecodeErrorZ_get_err(ptr);
35 org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
36 if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); };
37 this.err = err_hu_conv;
42 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the success state.
44 public static Result_ProbabilisticScorerDecodeErrorZ ok(ProbabilisticScoringDecayParameters o_decay_params, NetworkGraph o_network_graph, Logger o_logger) {
45 long ret = bindings.CResult_ProbabilisticScorerDecodeErrorZ_ok(bindings.ProbabilisticScorer_new(o_decay_params == null ? 0 : o_decay_params.ptr, o_network_graph == null ? 0 : o_network_graph.ptr, o_logger.ptr));
46 GC.KeepAlive(o_decay_params);
47 GC.KeepAlive(o_network_graph);
48 GC.KeepAlive(o_logger);
49 if (ret >= 0 && ret <= 4096) { return null; }
50 Result_ProbabilisticScorerDecodeErrorZ ret_hu_conv = Result_ProbabilisticScorerDecodeErrorZ.constr_from_ptr(ret);
51 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o_decay_params); };
52 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o_network_graph); };
53 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o_logger); };
58 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the error state.
60 public static Result_ProbabilisticScorerDecodeErrorZ err(org.ldk.structs.DecodeError e) {
61 long ret = bindings.CResult_ProbabilisticScorerDecodeErrorZ_err(e.ptr);
63 if (ret >= 0 && ret <= 4096) { return null; }
64 Result_ProbabilisticScorerDecodeErrorZ ret_hu_conv = Result_ProbabilisticScorerDecodeErrorZ.constr_from_ptr(ret);
65 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); };
70 * Checks if the given object is currently in the success state
73 bool ret = bindings.CResult_ProbabilisticScorerDecodeErrorZ_is_ok(this.ptr);