@@ -25,7 +25,7 @@ extension ProgressManager {
25
25
/// - Parameter key: A key path to the custom integer property type.
26
26
public subscript< P: Property > ( dynamicMember key: KeyPath < ProgressManager . Properties , P . Type > ) -> Int where P. Value == Int , P. Summary == Int {
27
27
get {
28
- accessObservation ( keyPath: ProgressManager . additionalPropertiesKeyPath. withLock { $0 } )
28
+ self . access ( keyPath: ProgressManager . additionalPropertiesKeyPath. withLock { $0 } )
29
29
return state. withLock { state in
30
30
if P . self == ProgressManager . Properties. TotalFileCount. self {
31
31
return state. totalFileCount
@@ -38,7 +38,7 @@ extension ProgressManager {
38
38
}
39
39
40
40
set {
41
- mutateObservation ( of : ProgressManager . additionalPropertiesKeyPath. withLock { $0 } ) {
41
+ self . withMutation ( keyPath : ProgressManager . additionalPropertiesKeyPath. withLock { $0 } ) {
42
42
let parents : [ ParentState ] ? = state. withLock { state in
43
43
if P . self == ProgressManager . Properties. TotalFileCount. self {
44
44
guard newValue != state. totalFileCount else {
@@ -83,7 +83,7 @@ extension ProgressManager {
83
83
/// - Parameter key: A key path to the custom unsigned integer property type.
84
84
public subscript< P: Property > ( dynamicMember key: KeyPath < ProgressManager . Properties , P . Type > ) -> UInt64 where P. Value == UInt64 , P. Summary == UInt64 {
85
85
get {
86
- accessObservation ( keyPath: ProgressManager . additionalPropertiesKeyPath. withLock { $0 } )
86
+ self . access ( keyPath: ProgressManager . additionalPropertiesKeyPath. withLock { $0 } )
87
87
return state. withLock { state in
88
88
if P . self == ProgressManager . Properties. TotalByteCount. self {
89
89
return state. totalByteCount
@@ -96,7 +96,7 @@ extension ProgressManager {
96
96
}
97
97
98
98
set {
99
- mutateObservation ( of : ProgressManager . additionalPropertiesKeyPath. withLock { $0 } ) {
99
+ self . withMutation ( keyPath : ProgressManager . additionalPropertiesKeyPath. withLock { $0 } ) {
100
100
let parents : [ ParentState ] ? = state. withLock { state in
101
101
if P . self == ProgressManager . Properties. TotalByteCount. self {
102
102
guard newValue != state. totalByteCount else {
@@ -140,14 +140,14 @@ extension ProgressManager {
140
140
/// - Parameter key: A key path to the custom double property type.
141
141
public subscript< P: Property > ( dynamicMember key: KeyPath < ProgressManager . Properties , P . Type > ) -> P . Value where P. Value == Double , P. Summary == Double {
142
142
get {
143
- accessObservation ( keyPath: ProgressManager . additionalPropertiesKeyPath. withLock { $0 } )
143
+ self . access ( keyPath: ProgressManager . additionalPropertiesKeyPath. withLock { $0 } )
144
144
return state. withLock { state in
145
145
return state. propertiesDouble [ MetatypeWrapper ( P . self) ] ?? P . defaultValue
146
146
}
147
147
}
148
148
149
149
set {
150
- mutateObservation ( of : ProgressManager . additionalPropertiesKeyPath. withLock { $0 } ) {
150
+ self . withMutation ( keyPath : ProgressManager . additionalPropertiesKeyPath. withLock { $0 } ) {
151
151
let parents : [ ParentState ] ? = state. withLock { state in
152
152
guard newValue != state. propertiesDouble [ MetatypeWrapper ( P . self) ] else {
153
153
return nil
@@ -171,14 +171,14 @@ extension ProgressManager {
171
171
/// - Parameter key: A key path to the custom string property type.
172
172
public subscript< P: Property > ( dynamicMember key: KeyPath < ProgressManager . Properties , P . Type > ) -> String ? where P. Value == String ? , P. Summary == [ String ? ] {
173
173
get {
174
- accessObservation ( keyPath: ProgressManager . additionalPropertiesKeyPath. withLock { $0 } )
174
+ self . access ( keyPath: ProgressManager . additionalPropertiesKeyPath. withLock { $0 } )
175
175
return state. withLock { state in
176
176
return state. propertiesString [ MetatypeWrapper ( P . self) ] ?? P . defaultValue
177
177
}
178
178
}
179
179
180
180
set {
181
- mutateObservation ( of : ProgressManager . additionalPropertiesKeyPath. withLock { $0 } ) {
181
+ self . withMutation ( keyPath : ProgressManager . additionalPropertiesKeyPath. withLock { $0 } ) {
182
182
let parents : [ ParentState ] ? = state. withLock { state in
183
183
guard newValue != state. propertiesString [ MetatypeWrapper ( P . self) ] else {
184
184
return nil
@@ -202,14 +202,14 @@ extension ProgressManager {
202
202
/// - Parameter key: A key path to the custom URL property type.
203
203
public subscript< P: Property > ( dynamicMember key: KeyPath < ProgressManager . Properties , P . Type > ) -> URL ? where P. Value == URL ? , P. Summary == [ URL ? ] {
204
204
get {
205
- accessObservation ( keyPath: ProgressManager . additionalPropertiesKeyPath. withLock { $0 } )
205
+ self . access ( keyPath: ProgressManager . additionalPropertiesKeyPath. withLock { $0 } )
206
206
return state. withLock { state in
207
207
return state. propertiesURL [ MetatypeWrapper ( P . self) ] ?? P . defaultValue
208
208
}
209
209
}
210
210
211
211
set {
212
- mutateObservation ( of : ProgressManager . additionalPropertiesKeyPath. withLock { $0 } ) {
212
+ self . withMutation ( keyPath : ProgressManager . additionalPropertiesKeyPath. withLock { $0 } ) {
213
213
let parents : [ ParentState ] ? = state. withLock { state in
214
214
guard newValue != state. propertiesURL [ MetatypeWrapper ( P . self) ] else {
215
215
return nil
@@ -233,7 +233,7 @@ extension ProgressManager {
233
233
/// - Parameter key: A key path to the custom unsigned integer property type.
234
234
public subscript< P: Property > ( dynamicMember key: KeyPath < ProgressManager . Properties , P . Type > ) -> UInt64 where P. Value == UInt64 , P. Summary == [ UInt64 ] {
235
235
get {
236
- accessObservation ( keyPath: ProgressManager . additionalPropertiesKeyPath. withLock { $0 } )
236
+ self . access ( keyPath: ProgressManager . additionalPropertiesKeyPath. withLock { $0 } )
237
237
return state. withLock { state in
238
238
if P . self == ProgressManager . Properties. Throughput. self {
239
239
return state. throughput
@@ -244,7 +244,7 @@ extension ProgressManager {
244
244
}
245
245
246
246
set {
247
- mutateObservation ( of : ProgressManager . additionalPropertiesKeyPath. withLock { $0 } ) {
247
+ self . withMutation ( keyPath : ProgressManager . additionalPropertiesKeyPath. withLock { $0 } ) {
248
248
let parents : [ ParentState ] ? = state. withLock { state in
249
249
if P . self == ProgressManager . Properties. Throughput. self {
250
250
guard newValue != state. throughput else {
@@ -280,7 +280,7 @@ extension ProgressManager {
280
280
/// - Parameter key: A key path to the custom duration property type.
281
281
public subscript< P: Property > ( dynamicMember key: KeyPath < ProgressManager . Properties , P . Type > ) -> Duration where P. Value == Duration , P. Summary == Duration {
282
282
get {
283
- accessObservation ( keyPath: ProgressManager . additionalPropertiesKeyPath. withLock { $0 } )
283
+ self . access ( keyPath: ProgressManager . additionalPropertiesKeyPath. withLock { $0 } )
284
284
return state. withLock { state in
285
285
if P . self == ProgressManager . Properties. EstimatedTimeRemaining. self {
286
286
return state. estimatedTimeRemaining
@@ -291,7 +291,7 @@ extension ProgressManager {
291
291
}
292
292
293
293
set {
294
- mutateObservation ( of : ProgressManager . additionalPropertiesKeyPath. withLock { $0 } ) {
294
+ self . withMutation ( keyPath : ProgressManager . additionalPropertiesKeyPath. withLock { $0 } ) {
295
295
let parents : [ ParentState ] ? = state. withLock { state in
296
296
if P . self == ProgressManager . Properties. EstimatedTimeRemaining. self {
297
297
guard newValue != state. estimatedTimeRemaining else {
@@ -329,7 +329,7 @@ extension ProgressManager {
329
329
/// where both the value and summary types are `Int`.
330
330
/// - Returns: An `Int` summary value for the specified property.
331
331
public func summary< P: Property > ( of property: P . Type ) -> P . Summary where P. Value == Int , P. Summary == Int {
332
- accessObservation ( keyPath: ProgressManager . additionalPropertiesKeyPath. withLock { $0 } )
332
+ self . access ( keyPath: ProgressManager . additionalPropertiesKeyPath. withLock { $0 } )
333
333
if property. self == ProgressManager . Properties. TotalFileCount. self {
334
334
return updatedFileCount ( type: . total)
335
335
} else if property. self == ProgressManager . Properties. CompletedFileCount. self {
@@ -348,7 +348,7 @@ extension ProgressManager {
348
348
/// where both the value and summary types are `UInt64`.
349
349
/// - Returns: An `UInt64` summary value for the specified property.
350
350
public func summary< P: Property > ( of property: P . Type ) -> P . Summary where P. Value == UInt64 , P. Summary == UInt64 {
351
- accessObservation ( keyPath: ProgressManager . additionalPropertiesKeyPath. withLock { $0 } )
351
+ self . access ( keyPath: ProgressManager . additionalPropertiesKeyPath. withLock { $0 } )
352
352
if property. self == ProgressManager . Properties. TotalByteCount. self {
353
353
return updatedByteCount ( type: . total)
354
354
} else if property. self == ProgressManager . Properties. CompletedByteCount. self {
@@ -367,7 +367,7 @@ extension ProgressManager {
367
367
/// where both the value and summary types are `Double`.
368
368
/// - Returns: A `Double` summary value for the specified property.
369
369
public func summary< P: Property > ( of property: P . Type ) -> P . Summary where P. Value == Double , P. Summary == Double {
370
- accessObservation ( keyPath: ProgressManager . additionalPropertiesKeyPath. withLock { $0 } )
370
+ self . access ( keyPath: ProgressManager . additionalPropertiesKeyPath. withLock { $0 } )
371
371
return updatedDoubleSummary ( property: MetatypeWrapper ( property) )
372
372
}
373
373
@@ -380,7 +380,7 @@ extension ProgressManager {
380
380
/// where both the value type is `String?` and the summary type is `[String?]`.
381
381
/// - Returns: A `[String?]` summary value for the specified property.
382
382
public func summary< P: Property > ( of property: P . Type ) -> P . Summary where P. Value == String ? , P. Summary == [ String ? ] {
383
- accessObservation ( keyPath: ProgressManager . additionalPropertiesKeyPath. withLock { $0 } )
383
+ self . access ( keyPath: ProgressManager . additionalPropertiesKeyPath. withLock { $0 } )
384
384
return updatedStringSummary ( property: MetatypeWrapper ( property) )
385
385
}
386
386
@@ -393,7 +393,7 @@ extension ProgressManager {
393
393
/// where the value type is `URL?` and the summary type is `[URL?]`.
394
394
/// - Returns: A `[URL?]` summary value for the specified property.
395
395
public func summary< P: Property > ( of property: P . Type ) -> P . Summary where P. Value == URL ? , P. Summary == [ URL ? ] {
396
- accessObservation ( keyPath: ProgressManager . additionalPropertiesKeyPath. withLock { $0 } )
396
+ self . access ( keyPath: ProgressManager . additionalPropertiesKeyPath. withLock { $0 } )
397
397
return updatedURLSummary ( property: MetatypeWrapper ( property) )
398
398
}
399
399
@@ -406,7 +406,7 @@ extension ProgressManager {
406
406
/// where the value type is `UInt64` and the summary type is `[UInt64]`.
407
407
/// - Returns: A `[UInt64]` summary value for the specified property.
408
408
public func summary< P: Property > ( of property: P . Type ) -> P . Summary where P. Value == UInt64 , P. Summary == [ UInt64 ] {
409
- accessObservation ( keyPath: ProgressManager . additionalPropertiesKeyPath. withLock { $0 } )
409
+ self . access ( keyPath: ProgressManager . additionalPropertiesKeyPath. withLock { $0 } )
410
410
if property. self == ProgressManager . Properties. Throughput. self {
411
411
return updatedThroughput ( )
412
412
} else {
@@ -423,7 +423,7 @@ extension ProgressManager {
423
423
/// where the value type is `Duration` and the summary type is `Duration`.
424
424
/// - Returns: A `Duration` summary value for the specified property.
425
425
public func summary< P: Property > ( of property: P . Type ) -> P . Summary where P. Value == Duration , P. Summary == Duration {
426
- accessObservation ( keyPath: ProgressManager . additionalPropertiesKeyPath. withLock { $0 } )
426
+ self . access ( keyPath: ProgressManager . additionalPropertiesKeyPath. withLock { $0 } )
427
427
if property. self == ProgressManager . Properties. EstimatedTimeRemaining. self {
428
428
return updatedEstimatedTimeRemaining ( )
429
429
} else {
0 commit comments