aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Source/Remote/FSTDatastore.h
diff options
context:
space:
mode:
authorGravatar zxu <zxu@google.com>2018-02-06 13:51:11 -0500
committerGravatar GitHub <noreply@github.com>2018-02-06 13:51:11 -0500
commita441190635d494f128cf02e07566ae2003af4e08 (patch)
tree618e6b0ecdb5d243f6e97f319f98f09dc9ca0a7e /Firestore/Source/Remote/FSTDatastore.h
parent7cac9dc47a8c6b7321ebf5fc13fa7140e784c8ca (diff)
Implement Firestore DatabaseInfo and port both Database{Id,Info} C++ to the iOS code (#738)
* implement Firestore DatabaseInfo in C++ * temporary stash changes; blocking on the massive renaming of .m to .mm * add database_info_test to project * finish port DatabaseId and fix style, modular fixing DatabaseInfo * port DatabaseInfo * remove FSTDatabase{ID,Info} and their tests from project * fix unit test * use namespace alias * use namespace alias, leftover * address more changes * refactoring to use raw pointer instead of value for property * address changes * remove self-> * fix style * remove the name suffix Alloc * fix a bug
Diffstat (limited to 'Firestore/Source/Remote/FSTDatastore.h')
-rw-r--r--Firestore/Source/Remote/FSTDatastore.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/Firestore/Source/Remote/FSTDatastore.h b/Firestore/Source/Remote/FSTDatastore.h
index 13d9eda..9edaf96 100644
--- a/Firestore/Source/Remote/FSTDatastore.h
+++ b/Firestore/Source/Remote/FSTDatastore.h
@@ -18,7 +18,9 @@
#import "Firestore/Source/Core/FSTTypes.h"
-@class FSTDatabaseInfo;
+#include "Firestore/core/src/firebase/firestore/core/database_info.h"
+#include "Firestore/core/src/firebase/firestore/model/database_id.h"
+
@class FSTDocumentKey;
@class FSTDispatchQueue;
@class FSTMutation;
@@ -33,7 +35,6 @@
@class GRXWriter;
@protocol FSTCredentialsProvider;
-@class FSTDatabaseID;
NS_ASSUME_NONNULL_BEGIN
@@ -52,13 +53,13 @@ NS_ASSUME_NONNULL_BEGIN
@interface FSTDatastore : NSObject
/** Creates a new Datastore instance with the given database info. */
-+ (instancetype)datastoreWithDatabase:(FSTDatabaseInfo *)database
++ (instancetype)datastoreWithDatabase:(const firebase::firestore::core::DatabaseInfo *)databaseInfo
workerDispatchQueue:(FSTDispatchQueue *)workerDispatchQueue
credentials:(id<FSTCredentialsProvider>)credentials;
- (instancetype)init __attribute__((unavailable("Use a static constructor method.")));
-- (instancetype)initWithDatabaseInfo:(FSTDatabaseInfo *)databaseInfo
+- (instancetype)initWithDatabaseInfo:(const firebase::firestore::core::DatabaseInfo *)databaseInfo
workerDispatchQueue:(FSTDispatchQueue *)workerDispatchQueue
credentials:(id<FSTCredentialsProvider>)credentials
NS_DESIGNATED_INITIALIZER;
@@ -81,7 +82,7 @@ NS_ASSUME_NONNULL_BEGIN
/** Adds headers to the RPC including any OAuth access token if provided .*/
+ (void)prepareHeadersForRPC:(GRPCCall *)rpc
- databaseID:(FSTDatabaseID *)databaseID
+ databaseID:(const firebase::firestore::model::DatabaseId *)databaseID
token:(nullable NSString *)token;
/** Looks up a list of documents in datastore. */
@@ -99,7 +100,8 @@ NS_ASSUME_NONNULL_BEGIN
- (FSTWriteStream *)createWriteStream;
/** The name of the database and the backend. */
-@property(nonatomic, strong, readonly) FSTDatabaseInfo *databaseInfo;
+// Does not own this DatabaseInfo.
+@property(nonatomic, assign, readonly) const firebase::firestore::core::DatabaseInfo *databaseInfo;
@end