2 import CommonBase from './CommonBase';
3 import * as bindings from '../bindings' // TODO: figure out location
5 public class MessageHandler extends CommonBase {
6 MessageHandler(Object _dummy, long ptr) { super(ptr); }
7 @Override @SuppressWarnings("deprecation")
8 protected void finalize() throws Throwable {
10 if (ptr != 0) { bindings.MessageHandler_free(ptr); }
13 public ChannelMessageHandler get_chan_handler() {
14 uint32_t ret = bindings.MessageHandler_get_chan_handler(this.ptr);
15 ChannelMessageHandler ret_hu_conv = new ChannelMessageHandler(null, ret);
16 ret_hu_conv.ptrs_to.add(this);
20 public void set_chan_handler(ChannelMessageHandler val) {
21 bindings.MessageHandler_set_chan_handler(this.ptr, val == null ? 0 : val.ptr);
22 this.ptrs_to.add(val);
25 public RoutingMessageHandler get_route_handler() {
26 uint32_t ret = bindings.MessageHandler_get_route_handler(this.ptr);
27 RoutingMessageHandler ret_hu_conv = new RoutingMessageHandler(null, ret);
28 ret_hu_conv.ptrs_to.add(this);
32 public void set_route_handler(RoutingMessageHandler val) {
33 bindings.MessageHandler_set_route_handler(this.ptr, val == null ? 0 : val.ptr);
34 this.ptrs_to.add(val);
37 public static MessageHandler constructor_new(ChannelMessageHandler chan_handler_arg, RoutingMessageHandler route_handler_arg) {
38 uint32_t ret = bindings.MessageHandler_new(chan_handler_arg == null ? 0 : chan_handler_arg.ptr, route_handler_arg == null ? 0 : route_handler_arg.ptr);
39 MessageHandler ret_hu_conv = new MessageHandler(null, ret);
40 ret_hu_conv.ptrs_to.add(chan_handler_arg);
41 ret_hu_conv.ptrs_to.add(route_handler_arg);