* Fix field initialization order
* Reduce dependencies in objc_compatibility_apple_test
This makes it possible to build and test util without having to build
everything
* Add a lint check for CMake files
* Find XCTest, if available
* Fix CMakeLists.txt to include all sources
* 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.
Replace all uses of `FSTSerializerBeta` in `remote_objc_bridge.{h,mm}` with the C++ `Serializer`. Also, make most of `remote/` sources pure C++ and remove no-longer-used methods in `FSTSerializerBeta`. All integration tests pass, under Address Sanitizer as well.
Unfortunately, pretty-printing is still delegated to Objective-C, so that `remote_objc_bridge.mm` still has to be an Objective-C++ source (and which prevents inlining `remote_objc_bridge` into the streams).
#no-changelog Will add a changelog entry when local serializer is ported, too.
* Rationalize input validation exceptions and assertions
... under a single ThrowHandler concept. This makes it possible to set
an alternative ThrowHandler in our C# bindings that properly translates
input validation exceptions to the correct .NET exception types.
* Rename api/input_validation.h to util/exception.h
* Reimplement util/hard_assert.h in terms of util/exception.h
This involved support for reference values and taking server timestamps into account (by crashing, because they are not supposed to ever be serialized).
The biggest change is from making every function that decodes a `FieldValue` a member function (as well as any function called by those functions). That is because decoding a reference requires comparing database IDs, and the database ID of this Firestore instance is stored on the `Serializer`.
* Remove references to removed classes
* Remove references to FSTSyncEngine
* Fix references to Objective-C names that are no longer valid.
* Remove forward declarations to classes that don't exist
* Remove FSTTypes.h
* Remove usages of headers that no longer apply
* Clean up header imports
* Remove traces of Objective-C from api/firestore.{h,mm}
* Strip NS_ASSUME_NONNULL directives that don't apply
* Remove FSTSyncEngine.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 support for building Objective-C protos in CMake
* Add support for building FSTLocalSerializer to CMake
* Build ProtoSizer with CMake
* Build memory components with CMake
* Build LevelDB components with CMake
* Use int64_t for CalculateSizeBytes
This avoids a bunch of nasty casting/checking in other parts of the code
* Use the Sizer for MutationBatches
* Don't double-count document key size.
* Clean up references to Firestore.pbrpc
We're no longer using Objective-C gRPC services and this is no longer generated.
* Remove no longer existing entries from xcgmock
* Annotate Transaction and WriteBatch methods as discardable
These methods exist to allow chaining if that's useful but chaining
isn't expected or required.
Note that Objective-C methods in these types are implicitly
@discardableResult and don't need any extra help.
* No need to explicitly discard results
* Fix typos in FIRCollectionReference docs
* Add support for CollectionReference.addDocument(from:)
* 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
Also, make ArrayTransform::elements work more like the other platforms,
where you check type and cast, rather than having a magic method that
does both.