OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef SYNC_SYNCABLE_PARENT_CHILD_INDEX_H_ | 5 #ifndef COMPONENTS_SYNC_SYNCABLE_PARENT_CHILD_INDEX_H_ |
6 #define SYNC_SYNCABLE_PARENT_CHILD_INDEX_H_ | 6 #define COMPONENTS_SYNC_SYNCABLE_PARENT_CHILD_INDEX_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <set> | 10 #include <set> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "sync/base/sync_export.h" | 14 #include "components/sync/base/model_type.h" |
15 #include "sync/internal_api/public/base/model_type.h" | 15 #include "components/sync/base/sync_export.h" |
16 #include "sync/syncable/syncable_id.h" | 16 #include "components/sync/syncable/syncable_id.h" |
17 | 17 |
18 namespace syncer { | 18 namespace syncer { |
19 namespace syncable { | 19 namespace syncable { |
20 | 20 |
21 struct EntryKernel; | 21 struct EntryKernel; |
22 class ParentChildIndex; | 22 class ParentChildIndex; |
23 | 23 |
24 // A node ordering function. | 24 // A node ordering function. |
25 struct SYNC_EXPORT ChildComparator { | 25 struct SYNC_EXPORT ChildComparator { |
26 bool operator() (const EntryKernel* a, const EntryKernel* b) const; | 26 bool operator()(const EntryKernel* a, const EntryKernel* b) const; |
27 }; | 27 }; |
28 | 28 |
29 // An ordered set of nodes. | 29 // An ordered set of nodes. |
30 typedef std::set<EntryKernel*, ChildComparator> OrderedChildSet; | 30 typedef std::set<EntryKernel*, ChildComparator> OrderedChildSet; |
31 typedef std::shared_ptr<OrderedChildSet> OrderedChildSetRef; | 31 typedef std::shared_ptr<OrderedChildSet> OrderedChildSetRef; |
32 | 32 |
33 // Container that tracks parent-child relationships. | 33 // Container that tracks parent-child relationships. |
34 // Provides fast lookup of all items under a given parent. | 34 // Provides fast lookup of all items under a given parent. |
35 class SYNC_EXPORT ParentChildIndex { | 35 class SYNC_EXPORT ParentChildIndex { |
36 public: | 36 public: |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 // non-hierarchical types (types with flat hierarchy) that support entries | 95 // non-hierarchical types (types with flat hierarchy) that support entries |
96 // with implicit parent. | 96 // with implicit parent. |
97 TypeRootChildSets type_root_child_sets_; | 97 TypeRootChildSets type_root_child_sets_; |
98 | 98 |
99 DISALLOW_COPY_AND_ASSIGN(ParentChildIndex); | 99 DISALLOW_COPY_AND_ASSIGN(ParentChildIndex); |
100 }; | 100 }; |
101 | 101 |
102 } // namespace syncable | 102 } // namespace syncable |
103 } // namespace syncer | 103 } // namespace syncer |
104 | 104 |
105 #endif // SYNC_SYNCABLE_PARENT_CHILD_INDEX_H_ | 105 #endif // COMPONENTS_SYNC_SYNCABLE_PARENT_CHILD_INDEX_H_ |
OLD | NEW |