Initial checkin
[ldk-swift-linux] / LDKSwift / Sources / LDKSwift / structs / ReplyChannelRange.swift
1 import LDKCHeaders
2
3 public class ReplyChannelRange {
4
5     public internal(set) var cOpaqueStruct: LDKReplyChannelRange?;
6
7         /* DEFAULT_CONSTRUCTOR_START */
8     public init(chain_hash_arg: [UInt8], first_blocknum_arg: UInt32, number_of_blocks_arg: UInt32, sync_complete_arg: Bool, short_channel_ids_arg: [UInt64]) {
9         
10         self.cOpaqueStruct = ReplyChannelRange_new(Bindings.new_LDKThirtyTwoBytes(array: chain_hash_arg), first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, Bindings.new_LDKCVec_u64Z(array: short_channel_ids_arg))
11     }
12     /* DEFAULT_CONSTRUCTOR_END */
13
14     public init(pointer: LDKReplyChannelRange){
15                 self.cOpaqueStruct = pointer
16         }
17
18     /* STRUCT_METHODS_START */
19
20     public func get_chain_hash() -> [UInt8] {
21         
22         return Bindings.tuple32_to_array(nativeType: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKReplyChannelRange>) in
23 ReplyChannelRange_get_chain_hash(this_ptrPointer)
24 }.pointee);
25     }
26
27     public func set_chain_hash(val: [UInt8]) -> Void {
28         
29                                                         let this_ptrPointer = UnsafeMutablePointer<LDKReplyChannelRange>.allocate(capacity: 1)
30                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
31                                                 
32         return ReplyChannelRange_set_chain_hash(this_ptrPointer, Bindings.new_LDKThirtyTwoBytes(array: val));
33     }
34
35     public func get_first_blocknum() -> UInt32 {
36         
37         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKReplyChannelRange>) in
38 ReplyChannelRange_get_first_blocknum(this_ptrPointer)
39 };
40     }
41
42     public func set_first_blocknum(val: UInt32) -> Void {
43         
44                                                         let this_ptrPointer = UnsafeMutablePointer<LDKReplyChannelRange>.allocate(capacity: 1)
45                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
46                                                 
47         return ReplyChannelRange_set_first_blocknum(this_ptrPointer, val);
48     }
49
50     public func get_number_of_blocks() -> UInt32 {
51         
52         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKReplyChannelRange>) in
53 ReplyChannelRange_get_number_of_blocks(this_ptrPointer)
54 };
55     }
56
57     public func set_number_of_blocks(val: UInt32) -> Void {
58         
59                                                         let this_ptrPointer = UnsafeMutablePointer<LDKReplyChannelRange>.allocate(capacity: 1)
60                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
61                                                 
62         return ReplyChannelRange_set_number_of_blocks(this_ptrPointer, val);
63     }
64
65     public func get_sync_complete() -> Bool {
66         
67         return withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKReplyChannelRange>) in
68 ReplyChannelRange_get_sync_complete(this_ptrPointer)
69 };
70     }
71
72     public func set_sync_complete(val: Bool) -> Void {
73         
74                                                         let this_ptrPointer = UnsafeMutablePointer<LDKReplyChannelRange>.allocate(capacity: 1)
75                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
76                                                 
77         return ReplyChannelRange_set_sync_complete(this_ptrPointer, val);
78     }
79
80     public func set_short_channel_ids(val: [UInt64]) -> Void {
81         
82                                                         let this_ptrPointer = UnsafeMutablePointer<LDKReplyChannelRange>.allocate(capacity: 1)
83                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
84                                                 
85         return ReplyChannelRange_set_short_channel_ids(this_ptrPointer, Bindings.new_LDKCVec_u64Z(array: val));
86     }
87
88     public func clone(orig: ReplyChannelRange) -> ReplyChannelRange {
89         
90         return withUnsafePointer(to: orig.cOpaqueStruct!) { (origPointer: UnsafePointer<LDKReplyChannelRange>) in
91 ReplyChannelRange(pointer: ReplyChannelRange_clone(origPointer))
92 };
93     }
94
95     public func read(ser: [UInt8]) -> Result_ReplyChannelRangeDecodeErrorZ {
96         
97         return Result_ReplyChannelRangeDecodeErrorZ(pointer: ReplyChannelRange_read(Bindings.new_LDKu8slice(array: ser)));
98     }
99
100     public func write(obj: ReplyChannelRange) -> [UInt8] {
101         
102         return Bindings.LDKCVec_u8Z_to_array(nativeType: withUnsafePointer(to: obj.cOpaqueStruct!) { (objPointer: UnsafePointer<LDKReplyChannelRange>) in
103 ReplyChannelRange_write(objPointer)
104 });
105     }
106
107                                 
108         deinit {
109                                         if self.cOpaqueStruct?.is_owned == false {
110
111                                         
112                                         
113                 ReplyChannelRange_free(self.cOpaqueStruct!)
114                                         
115 }
116                                 
117         }
118                         
119     /* STRUCT_METHODS_END */
120
121 }