Update auto-updated Java files
[ldk-java] / ts / structs / LockableScore.ts
1
2             
3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
5
6
7
8             export class LockableScore extends CommonBase {
9
10                 bindings_instance?: bindings.LDKLockableScore;
11
12                 constructor(ptr?: number, arg?: bindings.LDKLockableScore) {
13                     if (Number.isFinite(ptr)) {
14                                         super(ptr);
15                                         this.bindings_instance = null;
16                                     } else {
17                                         // TODO: private constructor instantiation
18                                         super(bindings.LDKLockableScore_new(arg));
19                                         this.ptrs_to.push(arg);
20                                         
21                                     }
22                 }
23
24                 protected finalize() {
25                     if (this.ptr != 0) {
26                         bindings.LockableScore_free(this.ptr);
27                     }
28                     super.finalize();
29                 }
30
31                 static new_impl(arg: LockableScoreInterface): LockableScore {
32                     const impl_holder: LDKLockableScoreHolder = new LDKLockableScoreHolder();
33                     let structImplementation = <bindings.LDKLockableScore>{
34                         // todo: in-line interface filling
35                         lock (): number {
36                                                         Score ret = arg.lock();
37                                 result: number = ret == null ? 0 : ret.ptr;
38                                 impl_holder.held.ptrs_to.add(ret);
39                                 return result;
40                                                 },
41
42                                                 
43                     };
44                     impl_holder.held = new LockableScore (null, structImplementation);
45                 }
46             }
47
48             export interface LockableScoreInterface {
49                 lock(): Score;
50                                 
51             }
52
53             class LDKLockableScoreHolder {
54                 held: LockableScore;
55             }
56         public Score lock() {
57                 number ret = bindings.LockableScore_lock(this.ptr);
58                 Score ret_hu_conv = new Score(null, ret);
59                 ret_hu_conv.ptrs_to.add(this);
60                 return ret_hu_conv;
61         }
62
63 }