Initial checkin
[ldk-swift-linux] / LDKSwift / Sources / LDKSwift / structs / ChannelManagerReadArgs.swift
1 import LDKCHeaders
2
3 public class ChannelManagerReadArgs {
4
5     public internal(set) var cOpaqueStruct: LDKChannelManagerReadArgs?;
6
7         /* DEFAULT_CONSTRUCTOR_START */
8     public init(keys_manager: KeysInterface, fee_estimator: FeeEstimator, chain_monitor: Watch, tx_broadcaster: BroadcasterInterface, logger: Logger, default_config: UserConfig, channel_monitors: [LDKChannelMonitor]) {
9         
10         self.cOpaqueStruct = ChannelManagerReadArgs_new(keys_manager.cOpaqueStruct!, fee_estimator.cOpaqueStruct!, chain_monitor.cOpaqueStruct!, tx_broadcaster.cOpaqueStruct!, logger.cOpaqueStruct!, default_config.cOpaqueStruct!, Bindings.new_LDKCVec_ChannelMonitorZ(array: channel_monitors))
11     }
12     /* DEFAULT_CONSTRUCTOR_END */
13
14     public init(pointer: LDKChannelManagerReadArgs){
15                 self.cOpaqueStruct = pointer
16         }
17
18     /* STRUCT_METHODS_START */
19
20     public func get_keys_manager() -> KeysInterface {
21         
22         return NativelyImplementedKeysInterface(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelManagerReadArgs>) in
23 ChannelManagerReadArgs_get_keys_manager(this_ptrPointer)
24 }.pointee);
25     }
26
27     public func set_keys_manager(val: KeysInterface) -> Void {
28         
29                                                         let this_ptrPointer = UnsafeMutablePointer<LDKChannelManagerReadArgs>.allocate(capacity: 1)
30                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
31                                                 
32         return ChannelManagerReadArgs_set_keys_manager(this_ptrPointer, val.cOpaqueStruct!);
33     }
34
35     public func get_fee_estimator() -> FeeEstimator {
36         
37         return NativelyImplementedFeeEstimator(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelManagerReadArgs>) in
38 ChannelManagerReadArgs_get_fee_estimator(this_ptrPointer)
39 }.pointee);
40     }
41
42     public func set_fee_estimator(val: FeeEstimator) -> Void {
43         
44                                                         let this_ptrPointer = UnsafeMutablePointer<LDKChannelManagerReadArgs>.allocate(capacity: 1)
45                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
46                                                 
47         return ChannelManagerReadArgs_set_fee_estimator(this_ptrPointer, val.cOpaqueStruct!);
48     }
49
50     public func get_chain_monitor() -> Watch {
51         
52         return NativelyImplementedWatch(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelManagerReadArgs>) in
53 ChannelManagerReadArgs_get_chain_monitor(this_ptrPointer)
54 }.pointee);
55     }
56
57     public func set_chain_monitor(val: Watch) -> Void {
58         
59                                                         let this_ptrPointer = UnsafeMutablePointer<LDKChannelManagerReadArgs>.allocate(capacity: 1)
60                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
61                                                 
62         return ChannelManagerReadArgs_set_chain_monitor(this_ptrPointer, val.cOpaqueStruct!);
63     }
64
65     public func get_tx_broadcaster() -> BroadcasterInterface {
66         
67         return NativelyImplementedBroadcasterInterface(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelManagerReadArgs>) in
68 ChannelManagerReadArgs_get_tx_broadcaster(this_ptrPointer)
69 }.pointee);
70     }
71
72     public func set_tx_broadcaster(val: BroadcasterInterface) -> Void {
73         
74                                                         let this_ptrPointer = UnsafeMutablePointer<LDKChannelManagerReadArgs>.allocate(capacity: 1)
75                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
76                                                 
77         return ChannelManagerReadArgs_set_tx_broadcaster(this_ptrPointer, val.cOpaqueStruct!);
78     }
79
80     public func get_logger() -> Logger {
81         
82         return NativelyImplementedLogger(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelManagerReadArgs>) in
83 ChannelManagerReadArgs_get_logger(this_ptrPointer)
84 }.pointee);
85     }
86
87     public func set_logger(val: Logger) -> Void {
88         
89                                                         let this_ptrPointer = UnsafeMutablePointer<LDKChannelManagerReadArgs>.allocate(capacity: 1)
90                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
91                                                 
92         return ChannelManagerReadArgs_set_logger(this_ptrPointer, val.cOpaqueStruct!);
93     }
94
95     public func get_default_config() -> UserConfig {
96         
97         return UserConfig(pointer: withUnsafePointer(to: self.cOpaqueStruct!) { (this_ptrPointer: UnsafePointer<LDKChannelManagerReadArgs>) in
98 ChannelManagerReadArgs_get_default_config(this_ptrPointer)
99 });
100     }
101
102     public func set_default_config(val: UserConfig) -> Void {
103         
104                                                         let this_ptrPointer = UnsafeMutablePointer<LDKChannelManagerReadArgs>.allocate(capacity: 1)
105                                                         this_ptrPointer.initialize(to: self.cOpaqueStruct!)
106                                                 
107         return ChannelManagerReadArgs_set_default_config(this_ptrPointer, val.cOpaqueStruct!);
108     }
109
110                                 
111         deinit {
112                                         if self.cOpaqueStruct?.is_owned == false {
113
114                                         
115                                         
116                 ChannelManagerReadArgs_free(self.cOpaqueStruct!)
117                                         
118 }
119                                 
120         }
121                         
122     /* STRUCT_METHODS_END */
123
124 }