Update auto-generated bindings
[ldk-java] / ts / structs / BackgroundProcessor.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 BackgroundProcessor 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.BackgroundProcessor_free(this.ptr);
19                     }
20                 }
21         public static BackgroundProcessor constructor_start(ChannelManagerPersister persister, EventHandler event_handler, ChainMonitor chain_monitor, ChannelManager channel_manager, PeerManager peer_manager, Logger logger) {
22                 number ret = bindings.BackgroundProcessor_start(persister == null ? 0 : persister.ptr, event_handler == null ? 0 : event_handler.ptr, chain_monitor == null ? 0 : chain_monitor.ptr & ~1, channel_manager == null ? 0 : channel_manager.ptr & ~1, peer_manager == null ? 0 : peer_manager.ptr & ~1, logger == null ? 0 : logger.ptr);
23                 const ret_hu_conv: BackgroundProcessor = new BackgroundProcessor(null, ret);
24                 ret_hu_conv.ptrs_to.add(ret_hu_conv);
25                 ret_hu_conv.ptrs_to.add(persister);
26                 ret_hu_conv.ptrs_to.add(event_handler);
27                 ret_hu_conv.ptrs_to.add(chain_monitor);
28                 ret_hu_conv.ptrs_to.add(channel_manager);
29                 ret_hu_conv.ptrs_to.add(peer_manager);
30                 ret_hu_conv.ptrs_to.add(logger);
31                 return ret_hu_conv;
32         }
33
34         public Result_NoneErrorZ stop() {
35                 number ret = bindings.BackgroundProcessor_stop(this.ptr);
36                 Result_NoneErrorZ ret_hu_conv = Result_NoneErrorZ.constr_from_ptr(ret);
37                 return ret_hu_conv;
38         }
39
40 }