@@ -21,7 +21,7 @@ internal final class DefaultLiveMap: LiveMap {
2121
2222 internal var testsOnly_objectID : String {
2323 mutex. withLock {
24- mutableState. objectID
24+ mutableState. liveObject . objectID
2525 }
2626 }
2727
@@ -33,13 +33,13 @@ internal final class DefaultLiveMap: LiveMap {
3333
3434 internal var testsOnly_siteTimeserials : [ String : String ] {
3535 mutex. withLock {
36- mutableState. siteTimeserials
36+ mutableState. liveObject . siteTimeserials
3737 }
3838 }
3939
4040 internal var testsOnly_createOperationIsMerged : Bool {
4141 mutex. withLock {
42- mutableState. createOperationIsMerged
42+ mutableState. liveObject . createOperationIsMerged
4343 }
4444 }
4545
@@ -76,15 +76,15 @@ internal final class DefaultLiveMap: LiveMap {
7676 delegate: LiveMapObjectPoolDelegate ? ,
7777 coreSDK: CoreSDK
7878 ) {
79- mutableState = . init( data : data , objectID: objectID, semantics: semantics)
79+ mutableState = . init( liveObject : . init ( objectID: objectID) , data : data , semantics: semantics)
8080 self . delegate = . init( referenced: delegate)
8181 self . coreSDK = coreSDK
8282 }
8383
8484 /// Creates a "zero-value LiveMap", per RTLM4.
8585 ///
8686 /// - Parameters:
87- /// - objectID: The value to use for the "private `objectId` field" of RTO5c1b1b .
87+ /// - objectID: The value to use for the RTLO3a `objectID` property .
8888 /// - semantics: The value to use for the "private `semantics` field" of RTO5c1b1b.
8989 internal static func createZeroValued(
9090 objectID: String ,
@@ -271,21 +271,15 @@ internal final class DefaultLiveMap: LiveMap {
271271 // MARK: - Mutable state and the operations that affect it
272272
273273 private struct MutableState {
274+ /// The mutable state common to all LiveObjects.
275+ internal var liveObject : LiveObjectMutableState
276+
274277 /// The internal data that this map holds, per RTLM3.
275278 internal var data : [ String : ObjectsMapEntry ]
276279
277- /// The "private `objectId` field" of RTO5c1b1b.
278- internal var objectID : String
279-
280280 /// The "private `semantics` field" of RTO5c1b1b.
281281 internal var semantics : WireEnum < ObjectsMapSemantics > ?
282282
283- /// The site timeserials for this map, per RTLM6a.
284- internal var siteTimeserials : [ String : String ] = [ : ]
285-
286- /// Whether the create operation has been merged, per RTLM6b and RTLM6d2.
287- internal var createOperationIsMerged = false
288-
289283 /// Replaces the internal data of this map with the provided ObjectState, per RTLM6.
290284 ///
291285 /// - Parameters:
@@ -297,10 +291,10 @@ internal final class DefaultLiveMap: LiveMap {
297291 coreSDK: CoreSDK ,
298292 ) {
299293 // RTLM6a: Replace the private siteTimeserials with the value from ObjectState.siteTimeserials
300- siteTimeserials = state. siteTimeserials
294+ liveObject . siteTimeserials = state. siteTimeserials
301295
302296 // RTLM6b: Set the private flag createOperationIsMerged to false
303- createOperationIsMerged = false
297+ liveObject . createOperationIsMerged = false
304298
305299 // RTLM6c: Set data to ObjectState.map.entries, or to an empty map if it does not exist
306300 data = state. map? . entries ?? [ : ]
@@ -332,7 +326,7 @@ internal final class DefaultLiveMap: LiveMap {
332326 }
333327 }
334328 // RTLM6d2: Set the private flag createOperationIsMerged to true
335- createOperationIsMerged = true
329+ liveObject . createOperationIsMerged = true
336330 }
337331 }
338332
0 commit comments