* Move FSTQueryCacheTests files to Firestore/core
* Rewrite QueryCache tests in C++
* Fix test flake in local store tests
This doesn't affect production because we always set the additional
references pointer there, but it's technically optional and some tests
don't do this.
There are more sources that can be `.cc` now (e.g., in API); these are left for a follow-up PR.
The dependency on Objective-C proto library cannot be removed just yet due to current lack of pretty-printing support for Nanopb.
After this PR is merged, the Objective-C serializers can be completely removed from the project. Also, this PR changes the `Message` class quite a bit; it's probably in its final form now.
I did some performance testing locally and came to the conclusion that replacing Objective-C serializers with their C++ versions brings no performance downgrade; actually, there seems to be a very slight improvement. I tested writing large batches and reading large collections:
* both are network-dominated; wall time is about twice longer than CPU time;
* serialization represents a pretty small percentage of the total CPU time;
* for writing, C++ serialization is a little more efficient, taking ~6% of total CPU time, compared to ~8% in the Objective-C version. I've seen similar results for reading.
All integration tests pass, under Address Sanitizer as well.
* Move FSTPersistenceHelpers to core/test/.../local
* Rewrite persistence_testing in C++
* Migrate from FSTPersistenceTestHelpers to C++ persistence_testing
* Rename .mm to .cc where possible in IndexManager tests
* Remove Objective-C gunk from index_manager_test.h
* Port FSTMemoryPersistence to C++ (#3754)
* Add local::Persistence
* Add MemoryPersistence
* Add MemoryEagerReferenceDelegate
* Make LruDelegate extend ReferenceDelegate
This enables downcasting to LruDelegate in tests that need to do so.
* Add MemoryLruReferenceDelegate
* Don't double-count document key size.
* Port FSTLevelDB to C++ (#3755)
* Add LevelDbPersistence
Note that Apple-specific initialization has been partitioned off in
anticipation of being able to run this code on non-Apple platforms.
* Add LevelDbLruReferenceDelegate
* Migrate to C++ Persistence (1/2) (#3756)
* Use C++ Persistence classes in FSTLocalStore
* Remove ReferenceDelegateBridge
* Cut src over to C++ persistence types
* Remove Objective-C requirement from some classes
... that no longer require it.
* Migrate to C++ Persistence (2/2) (#3757)
* Remove LruDelegateBridge
* Update test initialization of persistence components
In particular, ensure that there's always an owner for the Persistence
instance, which wasn't always handled explicitly in the Objective-C
version of the tests.
* Largely mechanical changes to tests
* Remove Objective-C persistence classes
* Forward declare util::Status when possible (#3761)
* Add a header dedicated to forward declarations for util::Status
* Use status_fwd.h wherever possible
* Add ReferenceDelegate
* Remove Objective-C crutches from model/types.h and query_cache.h
* Add C++ LruGarbageCollector
* Add delegate bridges for LruDelegate and ReferenceDelegate
* Migrate from FSTLRUGarbageCollector to C++ LruGarbageCollector
* Convert stream tokens from NSData to ByteString
Note that this persists in using protobuf's conflation of empty and null
strings.
* Rename remote_event.mm to .cc
* Rewrite Document-related classes as a polymorphic value type
* Pass ObjectValue without rvalue references
* Rename HasLocalMutations
* Port C++ users to new Documents
* Port FSTDocumentTests to C++
* Port FSTDocumentSetTests to C++
* Migrate DocumentMap and DocumentSet to C++ Document
* Migrate test helpers
* Delete FSTDocumentSetTests
* Delete FSTDocumentTests
* Mechanical changes to use C++ Document
* Updates to the project file
* Nontrivial test updates
* Remove FSTTestDeletedDoc
* Remove FSTTestUnknownDoc
* Remove FSTDocument
* Convert usage of FSTDocument to C++ Document
* Fix Serializer usage of Documents
* unique_ptr test failure
* Hopefully working?
* address comment and remove OC class
* remove compile commands and reformat
* reformat
* no using in header
* Use C++ Filters in FSTQuery without changing interface
* Remove FSTQuery initWithPath
* sync_project.rb generated changes
* Implement Filter equality
* Consistently use testutil:: helpers unqualified
* Use C++ Filters in FSTQuery
* Remove stale references to DatabaseId
* Have Firestore take the DatabaseId directly
* Allow tests to default the database implicitly
* Have FSTSerializerBeta take DatabaseId by value
* Have FSTUserDataConverter take DatabaseId by value
* Make FIRFirestore.databaseID a const reference
* Make FSTFirestoreClient.databaseID a const reference
* Have FSTReferenceValue take DatabaseId by value
* Have DatabaseInfo take DatabaseId by value
* Have Serializer take DatabaseId by value
* Fix C++ ReferenceValue
* Take DatabaseId by value
* Reverse order to match Android
* Rename `reference` to `key`
* Replace FSTDocumentSet's guts with immutable::SortedSet.
* Port FSTDocumentSet to C++ DocumentSet.
* Replace implementation of FSTDocumentSet with C++ DocumentSet
* Update all usages of FSTDocumentSet
* Remove FSTDocumentSet
* Add Objective-C++ guard
* Use absl::c_equal instead of hand-rolling it.
* Split SortedContainer out of SortedMapBase
... and use it
* Fix NSNotFound -> npos
* Remove = default constructors that aren't true.
These are implicitly deleted because DocumentSet is a member and isn't
default constructible.
* Fix usage of FSTQuery.limit
* Add objc::EqualTo and objc::Hash
These make it possible to use std::unordered_map with Objective-C object
keys.
* Use std::unordered_map in MemoryQueryCache
* Fix objective-C library detection
This ensures that .mm files are compiled with -fobjc-arc (among other
things).
* Remove BOOL in FSTDocument to eliminate static_cast<bool>
* Implement QueryCache interface and port tests
* Port production usages of QueryCache (#2211)
* Remove FSTQueryCache and implementations
* Switch size() to size_t
* Migrate FSTDocumentReference to C++
* Change SortedSet template parameter ordering
Makes it easier to specify a comparator without specifying what the
empty member of the underlying map is.
* Migrate MemoryMutationQueue to C++ references by key
* migrate.py
* CMake
* Finish porting ReferenceSet
* Swap reference set implementation
* Port MemoryQueryCache to use ported ReferenceSet
* Port FSTReferenceSetTest
* Port usage for limbo document refs
* Port LRU and LocalStore usages
* Remove FSTReferenceSet and FSTDocumentReference
* Style
* Add newline
* Use python executable directly
* python2 is not guaranteed to exist
* scripts aren't directly executable on Windows
* Add Firestore v1 protos
* Point cmake at Firestore v1 protos
* Regenerate protobuf-related sources
* Make local protos refer to v1 protos
* fixup! Regenerate protobuf-related sources
* Remove v1beta1 protos
* s/v1beta1/v1/g in source.
* s/v1beta1/v1/ in the Xcode project
* Remove stale bug comments.
This was fixed by adding an explicit FieldPath API rather than exposing
escaping to the end user.