3 import CommonBase from './CommonBase';
4 import * as bindings from '../bindings' // TODO: figure out location
8 export class LockableScore extends CommonBase {
10 bindings_instance?: bindings.LDKLockableScore;
12 constructor(ptr?: number, arg?: bindings.LDKLockableScore) {
13 if (Number.isFinite(ptr)) {
15 this.bindings_instance = null;
17 // TODO: private constructor instantiation
18 super(bindings.LDKLockableScore_new(arg));
19 this.ptrs_to.push(arg);
24 protected finalize() {
26 bindings.LockableScore_free(this.ptr);
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
36 Score ret = arg.lock();
37 result: number = ret == null ? 0 : ret.ptr;
38 impl_holder.held.ptrs_to.add(ret);
44 impl_holder.held = new LockableScore (null, structImplementation);
48 export interface LockableScoreInterface {
53 class LDKLockableScoreHolder {
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);