Skip to content

Commit 46d1876

Browse files
authored
Move firestore::model::mutation::Overlay into its parent namespace (#9422)
1 parent f452609 commit 46d1876

12 files changed

+35
-50
lines changed

Firestore/Example/Firestore.xcodeproj/project.pbxproj

Lines changed: 15 additions & 15 deletions
Large diffs are not rendered by default.

Firestore/core/src/local/document_overlay_cache.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
#include "Firestore/core/src/model/document_key.h"
2424
#include "Firestore/core/src/model/mutation.h"
25-
#include "Firestore/core/src/model/mutation/overlay.h"
25+
#include "Firestore/core/src/model/overlay.h"
2626
#include "Firestore/core/src/model/resource_path.h"
2727
#include "absl/strings/string_view.h"
2828
#include "absl/types/optional.h"
@@ -45,9 +45,8 @@ class DocumentOverlayCacheTestHelper;
4545
*/
4646
class DocumentOverlayCache {
4747
public:
48-
using OverlayByDocumentKeyMap = std::unordered_map<model::DocumentKey,
49-
model::mutation::Overlay,
50-
model::DocumentKeyHash>;
48+
using OverlayByDocumentKeyMap = std::
49+
unordered_map<model::DocumentKey, model::Overlay, model::DocumentKeyHash>;
5150
using MutationByDocumentKeyMap = std::unordered_map<model::DocumentKey,
5251
model::Mutation,
5352
model::DocumentKeyHash>;
@@ -59,7 +58,7 @@ class DocumentOverlayCache {
5958
*
6059
* Returns an empty optional if there is no overlay for that key.
6160
*/
62-
virtual absl::optional<model::mutation::Overlay> GetOverlay(
61+
virtual absl::optional<model::Overlay> GetOverlay(
6362
const model::DocumentKey& key) const = 0;
6463

6564
/**

Firestore/core/src/local/leveldb_document_overlay_cache.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ namespace local {
3737
using credentials::User;
3838
using model::DocumentKey;
3939
using model::Mutation;
40+
using model::Overlay;
41+
using model::OverlayHash;
4042
using model::ResourcePath;
41-
using model::mutation::Overlay;
42-
using model::mutation::OverlayHash;
4343
using nanopb::Message;
4444
using nanopb::StringReader;
4545

Firestore/core/src/local/leveldb_document_overlay_cache.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class LevelDbDocumentOverlayCache final : public DocumentOverlayCache {
5252
LevelDbDocumentOverlayCache& operator=(LevelDbDocumentOverlayCache&&) =
5353
delete;
5454

55-
absl::optional<model::mutation::Overlay> GetOverlay(
55+
absl::optional<model::Overlay> GetOverlay(
5656
const model::DocumentKey&) const override;
5757

5858
void SaveOverlays(int largest_batch_id,
@@ -84,9 +84,8 @@ class LevelDbDocumentOverlayCache final : public DocumentOverlayCache {
8484
kStop,
8585
};
8686

87-
model::mutation::Overlay ParseOverlay(
88-
const LevelDbDocumentOverlayKey& key,
89-
absl::string_view encoded_mutation) const;
87+
model::Overlay ParseOverlay(const LevelDbDocumentOverlayKey& key,
88+
absl::string_view encoded_mutation) const;
9089

9190
void SaveOverlay(int largest_batch_id,
9291
const model::DocumentKey& document_key,
@@ -110,7 +109,7 @@ class LevelDbDocumentOverlayCache final : public DocumentOverlayCache {
110109
int since_batch_id,
111110
std::function<ForEachKeyAction(LevelDbDocumentOverlayKey&&)>) const;
112111

113-
absl::optional<model::mutation::Overlay> GetOverlay(
112+
absl::optional<model::Overlay> GetOverlay(
114113
const LevelDbDocumentOverlayKey& decoded_key) const;
115114

116115
// The LevelDbDocumentOverlayCache instance is owned by LevelDbPersistence.

Firestore/core/src/local/local_serializer.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
#include "Firestore/core/src/local/target_data.h"
3636
#include "Firestore/core/src/model/field_path.h"
3737
#include "Firestore/core/src/model/mutable_document.h"
38-
#include "Firestore/core/src/model/mutation/overlay.h"
3938
#include "Firestore/core/src/model/mutation_batch.h"
4039
#include "Firestore/core/src/model/snapshot_version.h"
4140
#include "Firestore/core/src/nanopb/byte_string.h"
@@ -64,7 +63,6 @@ using model::MutationBatch;
6463
using model::ObjectValue;
6564
using model::Segment;
6665
using model::SnapshotVersion;
67-
using model::mutation::Overlay;
6866
using nanopb::ByteString;
6967
using nanopb::CheckedSize;
7068
using nanopb::CopyBytesArray;

Firestore/core/src/local/memory_document_overlay_cache.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ namespace local {
2828
using model::DocumentKey;
2929
using model::DocumentKeyHash;
3030
using model::Mutation;
31+
using model::Overlay;
3132
using model::ResourcePath;
32-
using model::mutation::Overlay;
3333

3434
absl::optional<Overlay> MemoryDocumentOverlayCache::GetOverlay(
3535
const DocumentKey& key) const {

Firestore/core/src/local/memory_document_overlay_cache.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class MemoryDocumentOverlayCache final : public DocumentOverlayCache {
3838
MemoryDocumentOverlayCache(MemoryDocumentOverlayCache&&) = delete;
3939
MemoryDocumentOverlayCache& operator=(MemoryDocumentOverlayCache&&) = delete;
4040

41-
absl::optional<model::mutation::Overlay> GetOverlay(
41+
absl::optional<model::Overlay> GetOverlay(
4242
const model::DocumentKey& key) const override;
4343

4444
void SaveOverlays(int largest_batch_id,
@@ -55,7 +55,7 @@ class MemoryDocumentOverlayCache final : public DocumentOverlayCache {
5555

5656
private:
5757
using OverlayByDocumentKeySortedMap =
58-
immutable::SortedMap<model::DocumentKey, model::mutation::Overlay>;
58+
immutable::SortedMap<model::DocumentKey, model::Overlay>;
5959
using DocumentKeySet =
6060
std::unordered_set<model::DocumentKey, model::DocumentKeyHash>;
6161
using DocumentKeysByBatchIdMap = std::unordered_map<int, DocumentKeySet>;

Firestore/core/src/model/model_fwd.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,6 @@ class Message;
5858

5959
namespace model {
6060

61-
namespace mutation {
62-
63-
class Overlay;
64-
65-
} // namespace mutation
66-
6761
class DatabaseId;
6862
class DeleteMutation;
6963
class Document;
@@ -80,6 +74,7 @@ class MutationBatch;
8074
class MutationBatchResult;
8175
class MutationResult;
8276
class ObjectValue;
77+
class Overlay;
8378
class PatchMutation;
8479
class Precondition;
8580
class SetMutation;

Firestore/core/src/model/mutation/overlay.cc renamed to Firestore/core/src/model/overlay.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
#include "Firestore/core/src/model/mutation/overlay.h"
17+
#include "Firestore/core/src/model/overlay.h"
1818

1919
#include <iostream>
2020

@@ -25,7 +25,6 @@
2525
namespace firebase {
2626
namespace firestore {
2727
namespace model {
28-
namespace mutation {
2928

3029
bool operator==(const Overlay& lhs, const Overlay& rhs) {
3130
return lhs.largest_batch_id_ == rhs.largest_batch_id_ &&
@@ -53,7 +52,6 @@ std::size_t OverlayHash::operator()(const Overlay& overlay) const {
5352
return overlay.Hash();
5453
}
5554

56-
} // namespace mutation
5755
} // namespace model
5856
} // namespace firestore
5957
} // namespace firebase

Firestore/core/src/model/mutation/overlay.h renamed to Firestore/core/src/model/overlay.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17-
#ifndef FIRESTORE_CORE_SRC_MODEL_MUTATION_OVERLAY_H_
18-
#define FIRESTORE_CORE_SRC_MODEL_MUTATION_OVERLAY_H_
17+
#ifndef FIRESTORE_CORE_SRC_MODEL_OVERLAY_H_
18+
#define FIRESTORE_CORE_SRC_MODEL_OVERLAY_H_
1919

2020
#include <cstdlib>
2121
#include <iosfwd>
@@ -28,7 +28,6 @@
2828
namespace firebase {
2929
namespace firestore {
3030
namespace model {
31-
namespace mutation {
3231

3332
/**
3433
* Representation of an overlay computed by Firestore.
@@ -80,9 +79,8 @@ struct OverlayHash {
8079
std::size_t operator()(const Overlay&) const;
8180
};
8281

83-
} // namespace mutation
8482
} // namespace model
8583
} // namespace firestore
8684
} // namespace firebase
8785

88-
#endif // FIRESTORE_CORE_SRC_MODEL_MUTATION_OVERLAY_H_
86+
#endif // FIRESTORE_CORE_SRC_MODEL_OVERLAY_H_

0 commit comments

Comments
 (0)