[email protected] | b5d1f3f32 | 2012-01-20 09:51:42 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | 8516471 | 2010-06-23 01:13:56 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | // | ||||
5 | // Various utilities for dealing with invalidation data types. | ||||
6 | |||||
[email protected] | b7fe4b5 | 2012-04-19 14:21:09 | [diff] [blame] | 7 | #ifndef SYNC_NOTIFIER_INVALIDATION_UTIL_H_ |
8 | #define SYNC_NOTIFIER_INVALIDATION_UTIL_H_ | ||||
[email protected] | 32b76ef | 2010-07-26 23:08:24 | [diff] [blame] | 9 | #pragma once |
[email protected] | 8516471 | 2010-06-23 01:13:56 | [diff] [blame] | 10 | |
[email protected] | 8e4c8887 | 2012-06-28 04:34:35 | [diff] [blame^] | 11 | #include <set> |
[email protected] | 8516471 | 2010-06-23 01:13:56 | [diff] [blame] | 12 | #include <string> |
13 | |||||
[email protected] | 3f8556a | 2012-06-07 17:50:19 | [diff] [blame] | 14 | #include "sync/internal_api/public/syncable/model_type.h" |
[email protected] | d49f4633 | 2011-07-15 21:31:07 | [diff] [blame] | 15 | |
16 | namespace invalidation { | ||||
17 | |||||
18 | class Invalidation; | ||||
19 | class ObjectId; | ||||
20 | |||||
21 | } // namespace invalidation | ||||
[email protected] | 8516471 | 2010-06-23 01:13:56 | [diff] [blame] | 22 | |
[email protected] | da29bbd | 2012-06-20 02:14:57 | [diff] [blame] | 23 | namespace csync { |
[email protected] | 8516471 | 2010-06-23 01:13:56 | [diff] [blame] | 24 | |
[email protected] | 739cee3 | 2012-06-20 20:37:28 | [diff] [blame] | 25 | struct ObjectIdLessThan { |
26 | bool operator()(const invalidation::ObjectId& lhs, | ||||
27 | const invalidation::ObjectId& rhs) const; | ||||
28 | }; | ||||
[email protected] | 8516471 | 2010-06-23 01:13:56 | [diff] [blame] | 29 | |
[email protected] | 8e4c8887 | 2012-06-28 04:34:35 | [diff] [blame^] | 30 | typedef std::set<invalidation::ObjectId, ObjectIdLessThan> ObjectIdSet; |
31 | |||||
[email protected] | 6a1d0f5 | 2010-06-30 05:11:53 | [diff] [blame] | 32 | bool RealModelTypeToObjectId(syncable::ModelType model_type, |
33 | invalidation::ObjectId* object_id); | ||||
34 | |||||
35 | bool ObjectIdToRealModelType(const invalidation::ObjectId& object_id, | ||||
36 | syncable::ModelType* model_type); | ||||
37 | |||||
[email protected] | 8516471 | 2010-06-23 01:13:56 | [diff] [blame] | 38 | std::string ObjectIdToString(const invalidation::ObjectId& object_id); |
39 | |||||
[email protected] | 8516471 | 2010-06-23 01:13:56 | [diff] [blame] | 40 | std::string InvalidationToString( |
41 | const invalidation::Invalidation& invalidation); | ||||
42 | |||||
[email protected] | da29bbd | 2012-06-20 02:14:57 | [diff] [blame] | 43 | } // namespace csync |
[email protected] | 8516471 | 2010-06-23 01:13:56 | [diff] [blame] | 44 | |
[email protected] | b7fe4b5 | 2012-04-19 14:21:09 | [diff] [blame] | 45 | #endif // SYNC_NOTIFIER_INVALIDATION_UTIL_H_ |