Commit Graph
7 Commits
Author SHA1 Message Date
Gil 60e37f32e2 Use three-way comparisons in C++ (#2884)
* Remove last traces of Objective-C from document_key.h

* Generalize empty base optimization into CompressedMember

Remove ComparatorHolder.

* Add Comparator<T>.Compare

This makes C++ more like the other platforms, where three-way comparison
is the default.

For now, don't remove the less-than definition of operator()--this
allows these comparators to be used in both circumstances.

* Remove KeyComparator

With the transition between less-than and three-way comparison adapting
this class isn't worth it.

While technically this is losing use of std::lower_bound, the
performance cost is negligible because these arrays are guaranteed to be
always small. This also makes ArraySortedMap work more like it does in
the other ports.

* Add Compare to the remaining Comparators

* Migrate remaining comparator usage in immuntable to three-way

* Use absl::bit_cast in comparison

* Make Comparable depend upon CompareTo.

* Use Comparable in more places

* Remove Comparator::operator()

* Move things around in comparison.h

Move:
  * Objective-C ComparisonResult functions nearer to others
  * DefaultComparator to above the first specializations

* Make Comparison on by default, delegating to CompareTo if available

* Move NSString Comparator into comparison.h

* Remove no longer required Comparator classes

* Make FieldValue support Comparable
2019-04-25 09:27:02 -07:00
Gil 7a7eced747 Don't use using statements in Objective-C headers ... (#2827)
use namespace aliases instead.

This makes the Objective-C code much more like what it's going to end up
being like when translated to C++: headers will include classes declared
in a namespace relative to firebase::firestore so everything else will
be named relative to firebase::firestore.

Meanwhile the using statements in the headers were causing us to miss
adding using statements in source files which was moving us away from
where we wanted to be.
2019-04-12 17:03:26 -07:00
Konstantin Varlamov 673b08592a C++: replace FSTMaybeDocumentDictionary with a C++ equivalent (#2139)
Also eliminate most usages of `FSTDocumentKey`, remove most methods from the Objective-C class and make it just a wrapper over `DocumentKey`. The only usage that cannot be directly replaced by C++ `DocumentKey` is in `FSTFieldValue`.
2018-12-10 11:57:08 -08:00
Konstantin Varlamov 0f0a1dab2d Eliminate unnecessary DocumentKey->FSTDocumentKey conversions (#1507) 2018-07-10 16:08:18 -04:00
Gil 0a66187053 Add lint checking for Objective-C++ sources (#1048)
* lint.sh now lints Objective-C++ too

* cpplint checks system-style includes that should be user-style

This prevents it from recognizing project sources as if they were C
system headers and then complaining that they're in the wrong place.

* cpplint checks #imports and #includes

* cpplint checks that C++ system headers aren't #imported

* cpplint checks for C system headers that could be C++ system headers

* cpplint checks that Objective-C sources include their headers
2018-04-09 11:54:39 -07:00
zxu 8311c6432e port paths to FSTDocumentKey (#877)
* replace path with C++ implementation in FSTDocumentKey.{h,mm} only

* address changes

* address changes
2018-03-06 14:28:04 -05:00
Gil bde743ed25 Release 4.3.0 (#327)
Initial release of Firestore at 0.8.0
Bump FirebaseCommunity to 0.1.3
2017-10-03 08:55:22 -07:00