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_INTERNAL_API_PUBLIC_BASE_ORDINAL_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_BASE_ORDINAL_H_ |
6 #define SYNC_INTERNAL_API_PUBLIC_BASE_ORDINAL_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_BASE_ORDINAL_H_ |
7 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <cstddef> | 9 #include <cstddef> |
10 #include <string> | 10 #include <string> |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
71 EqualsFn(); | 71 EqualsFn(); |
72 | 72 |
73 bool operator()(const Ordinal<Traits>& lhs, | 73 bool operator()(const Ordinal<Traits>& lhs, |
74 const Ordinal<Traits>& rhs) const; | 74 const Ordinal<Traits>& rhs) const; |
75 }; | 75 }; |
76 | 76 |
77 // Creates an Ordinal from the given string of bytes. The Ordinal | 77 // Creates an Ordinal from the given string of bytes. The Ordinal |
78 // may be valid or invalid. | 78 // may be valid or invalid. |
79 explicit Ordinal(const std::string& bytes); | 79 explicit Ordinal(const std::string& bytes); |
80 | 80 |
81 // Creates an invalid Ordinal. | 81 // Creates an invalid Ordinal |
akalin
2012/10/08 21:09:46
revert diff (add the period back in)
| |
82 Ordinal(); | 82 Ordinal(); |
83 | 83 |
84 // Creates a valid initial Ordinal. This is called to create the first | 84 // Creates a valid initial Ordinal. This is called to create the first |
85 // element of Ordinal list (i.e. before we have any other values we can | 85 // element of Ordinal list (i.e. before we have any other values we can |
86 // generate from). | 86 // generate from). |
87 static Ordinal CreateInitialOrdinal(); | 87 static Ordinal CreateInitialOrdinal(); |
88 | 88 |
89 // Returns true iff this Ordinal is valid. This takes constant | 89 // Returns true iff this Ordinal is valid. This takes constant |
90 // time. | 90 // time. |
91 bool IsValid() const; | 91 bool IsValid() const; |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
477 DCHECK_LT(midpoint, end_bytes); | 477 DCHECK_LT(midpoint, end_bytes); |
478 | 478 |
479 Ordinal<Traits> midpoint_ordinal(midpoint); | 479 Ordinal<Traits> midpoint_ordinal(midpoint); |
480 DCHECK(midpoint_ordinal.IsValid()); | 480 DCHECK(midpoint_ordinal.IsValid()); |
481 return midpoint_ordinal; | 481 return midpoint_ordinal; |
482 } | 482 } |
483 | 483 |
484 } // namespace syncer | 484 } // namespace syncer |
485 | 485 |
486 #endif // SYNC_INTERNAL_API_PUBLIC_BASE_ORDINAL_H_ | 486 #endif // SYNC_INTERNAL_API_PUBLIC_BASE_ORDINAL_H_ |
OLD | NEW |