diff options
Diffstat (limited to 'sync/sessions/ordered_commit_set.h')
-rw-r--r-- | sync/sessions/ordered_commit_set.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sync/sessions/ordered_commit_set.h b/sync/sessions/ordered_commit_set.h index 8551c07..f8e6938 100644 --- a/sync/sessions/ordered_commit_set.h +++ b/sync/sessions/ordered_commit_set.h @@ -64,14 +64,17 @@ class OrderedCommitSet { // belonging to |group|. This is useful when you need to process a commit // response one ModelSafeGroup at a time. See GetCommitIdAt for how the // indices contained in the returned Projection can be used. - const Projection& GetCommitIdProjection(browser_sync::ModelSafeGroup group) { - return projections_[group]; - } + const Projection& GetCommitIdProjection( + browser_sync::ModelSafeGroup group) const; - int Size() const { + size_t Size() const { return commit_ids_.size(); } + bool Empty() const { + return Size() == 0; + } + // Returns true iff any of the commit ids added to this set have model type // BOOKMARKS. bool HasBookmarkCommitId() const; @@ -80,6 +83,9 @@ class OrderedCommitSet { void AppendReverse(const OrderedCommitSet& other); void Truncate(size_t max_size); + // Removes all entries from this set. + void Clear(); + void operator=(const OrderedCommitSet& other); private: // A set of CommitIdProjections associated with particular ModelSafeGroups. @@ -92,7 +98,7 @@ class OrderedCommitSet { syncable::ModelType group; }; - CommitItem GetCommitItemAt(const int position) const; + CommitItem GetCommitItemAt(const size_t position) const; // These lists are different views of the same items; e.g they are // isomorphic. |