blob: 8a7c931af48cc780cde48ad13d2ad4cead8eb20c [file] [log] [blame]
[email protected]b5d1f3f322012-01-20 09:51:421// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]85164712010-06-23 01:13:562// 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]b7fe4b52012-04-19 14:21:097#ifndef SYNC_NOTIFIER_INVALIDATION_UTIL_H_
8#define SYNC_NOTIFIER_INVALIDATION_UTIL_H_
[email protected]32b76ef2010-07-26 23:08:249#pragma once
[email protected]85164712010-06-23 01:13:5610
[email protected]8e4c88872012-06-28 04:34:3511#include <set>
[email protected]85164712010-06-23 01:13:5612#include <string>
13
[email protected]3f8556a2012-06-07 17:50:1914#include "sync/internal_api/public/syncable/model_type.h"
[email protected]d49f46332011-07-15 21:31:0715
16namespace invalidation {
17
18class Invalidation;
19class ObjectId;
20
21} // namespace invalidation
[email protected]85164712010-06-23 01:13:5622
[email protected]da29bbd2012-06-20 02:14:5723namespace csync {
[email protected]85164712010-06-23 01:13:5624
[email protected]739cee32012-06-20 20:37:2825struct ObjectIdLessThan {
26 bool operator()(const invalidation::ObjectId& lhs,
27 const invalidation::ObjectId& rhs) const;
28};
[email protected]85164712010-06-23 01:13:5629
[email protected]8e4c88872012-06-28 04:34:3530typedef std::set<invalidation::ObjectId, ObjectIdLessThan> ObjectIdSet;
31
[email protected]6a1d0f52010-06-30 05:11:5332bool RealModelTypeToObjectId(syncable::ModelType model_type,
33 invalidation::ObjectId* object_id);
34
35bool ObjectIdToRealModelType(const invalidation::ObjectId& object_id,
36 syncable::ModelType* model_type);
37
[email protected]85164712010-06-23 01:13:5638std::string ObjectIdToString(const invalidation::ObjectId& object_id);
39
[email protected]85164712010-06-23 01:13:5640std::string InvalidationToString(
41 const invalidation::Invalidation& invalidation);
42
[email protected]da29bbd2012-06-20 02:14:5743} // namespace csync
[email protected]85164712010-06-23 01:13:5644
[email protected]b7fe4b52012-04-19 14:21:0945#endif // SYNC_NOTIFIER_INVALIDATION_UTIL_H_