23
23
#include < vector>
24
24
25
25
#include " Firestore/core/src/firebase/firestore/auth/user.h"
26
- #include " Firestore/core/src/firebase/firestore/core/event_listener.h"
27
26
#include " Firestore/core/src/firebase/firestore/core/query.h"
28
27
#include " Firestore/core/src/firebase/firestore/core/view_snapshot.h"
29
- #include " Firestore/core/src/firebase/firestore/local/target_data.h"
30
- #include " Firestore/core/src/firebase/firestore/model/document_key.h"
31
- #include " Firestore/core/src/firebase/firestore/model/document_key_set.h"
32
- #include " Firestore/core/src/firebase/firestore/model/mutation.h"
33
- #include " Firestore/core/src/firebase/firestore/model/snapshot_version.h"
34
- #include " Firestore/core/src/firebase/firestore/model/types.h"
28
+ #include " Firestore/core/src/firebase/firestore/model/model_fwd.h"
35
29
#include " Firestore/core/src/firebase/firestore/nanopb/byte_string.h"
36
30
#include " Firestore/core/src/firebase/firestore/nanopb/nanopb_util.h"
37
31
#include " Firestore/core/src/firebase/firestore/remote/watch_change.h"
@@ -43,15 +37,19 @@ namespace firestore {
43
37
namespace local {
44
38
45
39
class Persistence;
40
+ class TargetData;
46
41
47
42
} // namespace local
48
43
} // namespace firestore
49
44
} // namespace firebase
50
45
46
+ namespace auth = firebase::firestore::auth;
51
47
namespace core = firebase::firestore::core;
52
48
namespace local = firebase::firestore::local;
53
49
namespace model = firebase::firestore::model;
54
50
namespace nanopb = firebase::firestore::nanopb;
51
+ namespace remote = firebase::firestore::remote;
52
+ namespace util = firebase::firestore::util;
55
53
56
54
// A map holds expected information about currently active targets. The keys are
57
55
// target ID, and the values are a vector of `TargetData`s mapped to the target and
@@ -70,8 +68,8 @@ NS_ASSUME_NONNULL_BEGIN
70
68
@property (nonatomic , assign ) core::Query query;
71
69
@property (nonatomic , strong , nullable ) NSError *error;
72
70
73
- - (const absl::optional<firebase::firestore:: core::ViewSnapshot> &)viewSnapshot ;
74
- - (void )setViewSnapshot : (absl::optional<firebase::firestore:: core::ViewSnapshot>)snapshot ;
71
+ - (const absl::optional<core::ViewSnapshot> &)viewSnapshot ;
72
+ - (void )setViewSnapshot : (absl::optional<core::ViewSnapshot>)snapshot ;
75
73
76
74
@end
77
75
@@ -91,9 +89,7 @@ NS_ASSUME_NONNULL_BEGIN
91
89
@end
92
90
93
91
/* * Mapping of user => array of FSTMutations for that user. */
94
- typedef std::unordered_map<firebase::firestore::auth::User,
95
- NSMutableArray <FSTOutstandingWrite *> *,
96
- firebase::firestore::auth::HashUser>
92
+ typedef std::unordered_map<auth::User, NSMutableArray <FSTOutstandingWrite *> *, auth::HashUser>
97
93
FSTOutstandingWriteQueues;
98
94
99
95
/* *
@@ -131,7 +127,7 @@ typedef std::unordered_map<firebase::firestore::auth::User,
131
127
* mutation queues).
132
128
*/
133
129
- (instancetype )initWithPersistence : (std::unique_ptr<local::Persistence>)persistence
134
- initialUser : (const firebase::firestore:: auth::User &)initialUser
130
+ initialUser : (const auth::User &)initialUser
135
131
outstandingWrites : (const FSTOutstandingWriteQueues &)outstandingWrites
136
132
NS_DESIGNATED_INITIALIZER;
137
133
@@ -155,7 +151,7 @@ typedef std::unordered_map<firebase::firestore::auth::User,
155
151
* @param query A valid query to execute against the backend.
156
152
* @return The target ID assigned by the system to track the query.
157
153
*/
158
- - (firebase::firestore:: model::TargetId)addUserListenerWithQuery : (core::Query)query ;
154
+ - (model::TargetId)addUserListenerWithQuery : (core::Query)query ;
159
155
160
156
/* *
161
157
* Removes a listener from the FSTSyncEngine as if the user had removed a listener corresponding
@@ -178,8 +174,8 @@ typedef std::unordered_map<firebase::firestore::auth::User,
178
174
* @param snapshot A snapshot version to attach, if applicable. This should be sent when
179
175
* simulating the server having sent a complete snapshot.
180
176
*/
181
- - (void )receiveWatchChange : (const firebase::firestore:: remote::WatchChange &)change
182
- snapshotVersion : (const firebase::firestore:: model::SnapshotVersion &)snapshot ;
177
+ - (void )receiveWatchChange : (const remote::WatchChange &)change
178
+ snapshotVersion : (const model::SnapshotVersion &)snapshot ;
183
179
184
180
/* *
185
181
* Delivers a watch stream error as if the Streaming Watch backend has generated some kind of error.
@@ -226,9 +222,9 @@ typedef std::unordered_map<firebase::firestore::auth::User,
226
222
* the mutation. Snapshot versions must be monotonically increasing.
227
223
* @param mutationResults The mutation results for the write that is being acked.
228
224
*/
229
- - (FSTOutstandingWrite *)
230
- receiveWriteAckWithVersion:( const firebase::firestore::model::SnapshotVersion &) commitVersion
231
- mutationResults : (std::vector<model::MutationResult>)mutationResults ;
225
+ - (FSTOutstandingWrite *)receiveWriteAckWithVersion : ( const model::SnapshotVersion &) commitVersion
226
+ mutationResults :
227
+ (std::vector<model::MutationResult>)mutationResults ;
232
228
233
229
/* *
234
230
* A count of the mutations written to the write stream by the FSTSyncEngine, but not yet
@@ -261,14 +257,14 @@ typedef std::unordered_map<firebase::firestore::auth::User,
261
257
/* *
262
258
* Runs a pending timer callback on the worker queue.
263
259
*/
264
- - (void )runTimer : (firebase::firestore:: util::TimerId)timerID ;
260
+ - (void )runTimer : (util::TimerId)timerID ;
265
261
266
262
/* *
267
263
* Switches the FSTSyncEngine to a new user. The test driver tracks the outstanding mutations for
268
264
* each user, so future receiveWriteAck/Error operations will validate the write sent to the mock
269
265
* datastore matches the next outstanding write for that user.
270
266
*/
271
- - (void )changeUser : (const firebase::firestore:: auth::User &)user ;
267
+ - (void )changeUser : (const auth::User &)user ;
272
268
273
269
/* *
274
270
* Drains the client's dispatch queue.
@@ -294,14 +290,13 @@ typedef std::unordered_map<firebase::firestore::auth::User,
294
290
- (NSArray <NSString *> *)capturedRejectedWritesSinceLastCall ;
295
291
296
292
/* * The current set of documents in limbo. */
297
- - (std::map<firebase::firestore::model::DocumentKey, firebase::firestore::model::TargetId>)
298
- currentLimboDocuments;
293
+ - (std::map<model::DocumentKey, model::TargetId>)currentLimboDocuments ;
299
294
300
295
/* * The expected set of documents in limbo. */
301
- - (const firebase::firestore:: model::DocumentKeySet &)expectedLimboDocuments ;
296
+ - (const model::DocumentKeySet &)expectedLimboDocuments ;
302
297
303
298
/* * Sets the expected set of documents in limbo. */
304
- - (void )setExpectedLimboDocuments : (firebase::firestore:: model::DocumentKeySet)docs ;
299
+ - (void )setExpectedLimboDocuments : (model::DocumentKeySet)docs ;
305
300
306
301
/* *
307
302
* The writes that have been sent to the FSTSyncEngine via writeUserMutation: but not yet
@@ -322,7 +317,7 @@ typedef std::unordered_map<firebase::firestore::auth::User,
322
317
@property (nonatomic , assign , readonly ) const FSTOutstandingWriteQueues &outstandingWrites;
323
318
324
319
/* * The current user for the FSTSyncEngine; determines which mutation queue is active. */
325
- @property (nonatomic , assign , readonly ) const firebase::firestore:: auth::User ¤tUser;
320
+ @property (nonatomic , assign , readonly ) const auth::User ¤tUser;
326
321
327
322
/* *
328
323
* The number of snapshots-in-sync events that have been received.
@@ -345,8 +340,7 @@ typedef std::unordered_map<firebase::firestore::auth::User,
345
340
- (void )removeSnapshotsInSyncListener ;
346
341
347
342
/* * The set of active targets as observed on the watch stream. */
348
- - (const std::unordered_map<firebase::firestore::model::TargetId, local::TargetData> &)
349
- activeTargets;
343
+ - (const std::unordered_map<model::TargetId, local::TargetData> &)activeTargets ;
350
344
351
345
/* * The expected set of active targets, keyed by target ID. */
352
346
- (const ActiveTargetMap &)expectedActiveTargets ;
0 commit comments