22
22
#import " Firestore/Source/Auth/FSTUser.h"
23
23
#import " Firestore/Source/Core/FSTQuery.h"
24
24
#import " Firestore/Source/Core/FSTSnapshotVersion.h"
25
- #import " Firestore/Source/Core/FSTTargetIDGenerator.h"
26
25
#import " Firestore/Source/Core/FSTTransaction.h"
27
26
#import " Firestore/Source/Core/FSTView.h"
28
27
#import " Firestore/Source/Core/FSTViewSnapshot.h"
41
40
#import " Firestore/Source/Util/FSTDispatchQueue.h"
42
41
#import " Firestore/Source/Util/FSTLogger.h"
43
42
43
+ #include " Firestore/core/src/firebase/firestore/core/target_id_generator.h"
44
+
44
45
NS_ASSUME_NONNULL_BEGIN
45
46
46
47
// Limbo documents don't use persistence, and are eagerly GC'd. So, listens for them don't need
@@ -141,14 +142,14 @@ @interface FSTSyncEngine ()
141
142
NSMutableDictionary <FSTUser *, NSMutableDictionary<NSNumber *, FSTVoidErrorBlock> *>
142
143
*mutationCompletionBlocks;
143
144
144
- /* * Used for creating the FSTTargetIDs for the listens used to resolve limbo documents. */
145
- @property (nonatomic , strong , readonly ) FSTTargetIDGenerator *targetIdGenerator;
146
-
147
145
@property (nonatomic , strong ) FSTUser *currentUser;
148
146
149
147
@end
150
148
151
- @implementation FSTSyncEngine
149
+ @implementation FSTSyncEngine {
150
+ /* * Used for creating the FSTTargetIDs for the listens used to resolve limbo documents. */
151
+ firebase::firestore::core::TargetIdGenerator _targetIdGenerator;
152
+ }
152
153
153
154
- (instancetype )initWithLocalStore : (FSTLocalStore *)localStore
154
155
remoteStore : (FSTRemoteStore *)remoteStore
@@ -167,7 +168,8 @@ - (instancetype)initWithLocalStore:(FSTLocalStore *)localStore
167
168
[_limboCollector addGarbageSource: _limboDocumentRefs];
168
169
169
170
_mutationCompletionBlocks = [NSMutableDictionary dictionary ];
170
- _targetIdGenerator = [FSTTargetIDGenerator generatorForSyncEngineStartingAfterID: 0 ];
171
+ _targetIdGenerator =
172
+ firebase::firestore::core::TargetIdGenerator::SyncEngineTargetIdGenerator (0 );
171
173
_currentUser = initialUser;
172
174
}
173
175
return self;
@@ -490,7 +492,7 @@ - (void)trackLimboChange:(FSTLimboDocumentChange *)limboChange {
490
492
491
493
if (!self.limboTargetsByKey [key]) {
492
494
FSTLog (@" New document in limbo: %@ " , key);
493
- FSTTargetID limboTargetID = [ self .targetIdGenerator nextID ] ;
495
+ FSTTargetID limboTargetID = _targetIdGenerator. NextId () ;
494
496
FSTQuery *query = [FSTQuery queryWithPath: key.path];
495
497
FSTQueryData *queryData = [[FSTQueryData alloc ] initWithQuery: query
496
498
targetID: limboTargetID
0 commit comments