]> git.bitcoin.ninja Git - ldk-java/blob - ts/structs/MessageHandler.ts
Update auto-updated Java files
[ldk-java] / ts / structs / MessageHandler.ts
1
2             
3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
5
6
7
8             export default class MessageHandler extends CommonBase {
9                 constructor(_dummy: object, ptr: number) {
10                     super(ptr);
11                 }
12
13                 
14                 protected finalize() {
15                     super.finalize();
16
17                     if (this.ptr != 0) {
18                         bindings.MessageHandler_free(this.ptr);
19                     }
20                 }
21         public ChannelMessageHandler get_chan_handler() {
22                 number ret = bindings.MessageHandler_get_chan_handler(this.ptr);
23                 ChannelMessageHandler ret_hu_conv = new ChannelMessageHandler(null, ret);
24                 ret_hu_conv.ptrs_to.add(this);
25                 return ret_hu_conv;
26         }
27
28         public void set_chan_handler(ChannelMessageHandler val) {
29                 bindings.MessageHandler_set_chan_handler(this.ptr, val == null ? 0 : val.ptr);
30                 this.ptrs_to.add(val);
31         }
32
33         public RoutingMessageHandler get_route_handler() {
34                 number ret = bindings.MessageHandler_get_route_handler(this.ptr);
35                 RoutingMessageHandler ret_hu_conv = new RoutingMessageHandler(null, ret);
36                 ret_hu_conv.ptrs_to.add(this);
37                 return ret_hu_conv;
38         }
39
40         public void set_route_handler(RoutingMessageHandler val) {
41                 bindings.MessageHandler_set_route_handler(this.ptr, val == null ? 0 : val.ptr);
42                 this.ptrs_to.add(val);
43         }
44
45         public static MessageHandler constructor_new(ChannelMessageHandler chan_handler_arg, RoutingMessageHandler route_handler_arg) {
46                 number ret = bindings.MessageHandler_new(chan_handler_arg == null ? 0 : chan_handler_arg.ptr, route_handler_arg == null ? 0 : route_handler_arg.ptr);
47                 const ret_hu_conv: MessageHandler = new MessageHandler(null, ret);
48                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
49                 ret_hu_conv.ptrs_to.add(chan_handler_arg);
50                 ret_hu_conv.ptrs_to.add(route_handler_arg);
51                 return ret_hu_conv;
52         }
53
54 }