3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
8 export default class MessageHandler extends CommonBase {
9 constructor(_dummy: object, ptr: number) {
14 protected finalize() {
18 bindings.MessageHandler_free(this.ptr);
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);
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);
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);
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);
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);