OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_INVALIDATION_PUBLIC_SINGLE_OBJECT_INVALIDATION_SET_H_ | 5 #ifndef COMPONENTS_INVALIDATION_PUBLIC_SINGLE_OBJECT_INVALIDATION_SET_H_ |
6 #define COMPONENTS_INVALIDATION_PUBLIC_SINGLE_OBJECT_INVALIDATION_SET_H_ | 6 #define COMPONENTS_INVALIDATION_PUBLIC_SINGLE_OBJECT_INVALIDATION_SET_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 14 matching lines...) Expand all Loading... |
25 // The list is kept sorted by version to make it easier to perform common | 25 // The list is kept sorted by version to make it easier to perform common |
26 // operations, like checking for an unknown version invalidation or fetching the | 26 // operations, like checking for an unknown version invalidation or fetching the |
27 // highest invalidation with the highest version number. | 27 // highest invalidation with the highest version number. |
28 class INVALIDATION_EXPORT SingleObjectInvalidationSet { | 28 class INVALIDATION_EXPORT SingleObjectInvalidationSet { |
29 public: | 29 public: |
30 typedef std::set<Invalidation, InvalidationVersionLessThan> InvalidationsSet; | 30 typedef std::set<Invalidation, InvalidationVersionLessThan> InvalidationsSet; |
31 typedef InvalidationsSet::const_iterator const_iterator; | 31 typedef InvalidationsSet::const_iterator const_iterator; |
32 typedef InvalidationsSet::const_reverse_iterator const_reverse_iterator; | 32 typedef InvalidationsSet::const_reverse_iterator const_reverse_iterator; |
33 | 33 |
34 SingleObjectInvalidationSet(); | 34 SingleObjectInvalidationSet(); |
| 35 SingleObjectInvalidationSet(const SingleObjectInvalidationSet& other); |
35 ~SingleObjectInvalidationSet(); | 36 ~SingleObjectInvalidationSet(); |
36 | 37 |
37 void Insert(const Invalidation& invalidation); | 38 void Insert(const Invalidation& invalidation); |
38 void InsertAll(const SingleObjectInvalidationSet& other); | 39 void InsertAll(const SingleObjectInvalidationSet& other); |
39 void Clear(); | 40 void Clear(); |
40 void Erase(const_iterator it); | 41 void Erase(const_iterator it); |
41 | 42 |
42 // Returns true if this list contains an unknown version. | 43 // Returns true if this list contains an unknown version. |
43 // | 44 // |
44 // Unknown version invalidations always end up at the start of the list, | 45 // Unknown version invalidations always end up at the start of the list, |
(...skipping 12 matching lines...) Expand all Loading... |
57 scoped_ptr<base::ListValue> ToValue() const; | 58 scoped_ptr<base::ListValue> ToValue() const; |
58 bool ResetFromValue(const base::ListValue& list); | 59 bool ResetFromValue(const base::ListValue& list); |
59 | 60 |
60 private: | 61 private: |
61 InvalidationsSet invalidations_; | 62 InvalidationsSet invalidations_; |
62 }; | 63 }; |
63 | 64 |
64 } // syncer | 65 } // syncer |
65 | 66 |
66 #endif // COMPONENTS_INVALIDATION_PUBLIC_SINGLE_OBJECT_INVALIDATION_SET_H_ | 67 #endif // COMPONENTS_INVALIDATION_PUBLIC_SINGLE_OBJECT_INVALIDATION_SET_H_ |
OLD | NEW |