#ifndef SYNC_NOTIFIER_INVALIDATION_UTIL_H_
#define SYNC_NOTIFIER_INVALIDATION_UTIL_H_
#include <iosfwd>
#include <map>
#include <set>
#include <string>
#include "base/memory/scoped_ptr.h"
#include "sync/base/sync_export.h"
#include "sync/internal_api/public/base/model_type.h"
namespace base {
class DictionaryValue;
}
namespace invalidation {
class Invalidation;
class ObjectId;
SYNC_EXPORT_PRIVATE void PrintTo(const invalidation::ObjectId& id,
std::ostream* os);
}
namespace syncer {
class Invalidation;
struct SYNC_EXPORT ObjectIdLessThan {
bool operator()(const invalidation::ObjectId& lhs,
const invalidation::ObjectId& rhs) const;
};
struct InvalidationVersionLessThan {
bool operator()(const syncer::Invalidation& a,
const syncer::Invalidation& b) const;
};
typedef std::set<invalidation::ObjectId, ObjectIdLessThan> ObjectIdSet;
typedef std::map<invalidation::ObjectId, int, ObjectIdLessThan>
ObjectIdCountMap;
SYNC_EXPORT bool RealModelTypeToObjectId(ModelType model_type,
invalidation::ObjectId* object_id);
bool ObjectIdToRealModelType(const invalidation::ObjectId& object_id,
ModelType* model_type);
scoped_ptr<base::DictionaryValue> ObjectIdToValue(
const invalidation::ObjectId& object_id);
bool ObjectIdFromValue(const base::DictionaryValue& value,
invalidation::ObjectId* out);
SYNC_EXPORT_PRIVATE std::string ObjectIdToString(
const invalidation::ObjectId& object_id);
SYNC_EXPORT_PRIVATE ObjectIdSet ModelTypeSetToObjectIdSet(ModelTypeSet models);
ModelTypeSet ObjectIdSetToModelTypeSet(const ObjectIdSet& ids);
std::string InvalidationToString(
const invalidation::Invalidation& invalidation);
}
#endif