Skip to content

Commit 7870c73

Browse files
authored
Port FSTFirestoreClient to C++ 2/2 (#3657)
* firestore_client + FSTFirestoreClient becomes delegate. * fix comment * addressing comment * use new instead make_shared * reformat * Update references to firestore client * Addressing comments#2 * addressing comments #3 * add std::move * remove deleted header. * fix cmake build error.
1 parent 77b5181 commit 7870c73

File tree

13 files changed

+66
-411
lines changed

13 files changed

+66
-411
lines changed

Firestore/Example/Tests/Integration/API/FIRDatabaseTests.mm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
#import "Firestore/Example/Tests/Util/FSTEventAccumulator.h"
2323
#import "Firestore/Example/Tests/Util/FSTIntegrationTestCase.h"
2424
#import "Firestore/Source/API/FIRFirestore+Internal.h"
25-
#import "Firestore/Source/Core/FSTFirestoreClient.h"
25+
26+
#include "Firestore/core/src/firebase/firestore/core/firestore_client.h"
2627
#include "Firestore/core/test/firebase/firestore/testutil/app_testing.h"
2728

2829
namespace testutil = firebase::firestore::testutil;
@@ -1354,8 +1355,7 @@ - (void)testAppDeleteLeadsToFirestoreShutdown {
13541355

13551356
[self deleteApp:app];
13561357

1357-
FSTFirestoreClient *client = firestore.wrapped->client();
1358-
XCTAssertTrue([client isShutdown]);
1358+
XCTAssertTrue(firestore.wrapped->client()->is_shutdown());
13591359
}
13601360

13611361
- (void)testShutdownCanBeCalledMultipleTimes {

Firestore/Example/Tests/Integration/FSTTransactionTests.mm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
#import "Firestore/Example/Tests/Util/FSTIntegrationTestCase.h"
2323
#import "Firestore/Source/API/FIRFirestore+Internal.h"
24-
#import "Firestore/Source/Core/FSTFirestoreClient.h"
2524
#import "Firestore/Source/Util/FSTClasses.h"
2625

2726
using firebase::firestore::util::TimerId;

Firestore/Source/API/FIRQuery.mm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@
3333
#import "Firestore/Source/API/FIRQuerySnapshot+Internal.h"
3434
#import "Firestore/Source/API/FIRSnapshotMetadata+Internal.h"
3535
#import "Firestore/Source/API/FSTUserDataConverter.h"
36-
#import "Firestore/Source/Core/FSTFirestoreClient.h"
3736

3837
#include "Firestore/core/src/firebase/firestore/api/input_validation.h"
3938
#include "Firestore/core/src/firebase/firestore/api/query_core.h"
4039
#include "Firestore/core/src/firebase/firestore/core/bound.h"
4140
#include "Firestore/core/src/firebase/firestore/core/direction.h"
4241
#include "Firestore/core/src/firebase/firestore/core/filter.h"
42+
#include "Firestore/core/src/firebase/firestore/core/firestore_client.h"
4343
#include "Firestore/core/src/firebase/firestore/core/order_by.h"
4444
#include "Firestore/core/src/firebase/firestore/core/query.h"
4545
#include "Firestore/core/src/firebase/firestore/model/document_key.h"
@@ -178,11 +178,11 @@ - (void)getDocumentsWithSource:(FIRFirestoreSource)publicSource
178178
});
179179

180180
// Call the view_listener on the user Executor.
181-
auto async_listener = AsyncEventListener<ViewSnapshot>::Create(firestore->client().userExecutor,
182-
std::move(view_listener));
181+
auto async_listener = AsyncEventListener<ViewSnapshot>::Create(
182+
firestore->client()->user_executor(), std::move(view_listener));
183183

184184
std::shared_ptr<QueryListener> query_listener =
185-
[firestore->client() listenToQuery:query options:internalOptions listener:async_listener];
185+
firestore->client()->ListenToQuery(query, internalOptions, async_listener);
186186

187187
return [[FSTListenerRegistration alloc]
188188
initWithRegistration:ListenerRegistration(firestore->client(), std::move(async_listener),

Firestore/Source/Core/FSTFirestoreClient.h

Lines changed: 0 additions & 142 deletions
This file was deleted.

0 commit comments

Comments
 (0)