Index: sync/api/entity_change.h |
diff --git a/sync/api/entity_change.h b/sync/api/entity_change.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..cd572a01329e8ca369b2574a6747840081530a27 |
--- /dev/null |
+++ b/sync/api/entity_change.h |
@@ -0,0 +1,45 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef SYNC_API_ENTITY_CHANGE_H_ |
+#define SYNC_API_ENTITY_CHANGE_H_ |
+ |
+#include <string> |
+ |
+#include "sync/api/entity_data.h" |
+#include "sync/base/sync_export.h" |
+ |
+namespace syncer_v2 { |
+ |
+class SYNC_EXPORT EntityChange { |
+ public: |
+ enum ChangeType { |
+ ACTION_ADD, |
+ ACTION_UPDATE, |
+ ACTION_DELETE |
+ }; |
+ |
+ static EntityChange CreateAdd(std::string client_tag, EntityDataPtr data); |
+ static EntityChange CreateUpdate(std::string client_tag, EntityDataPtr data); |
+ static EntityChange CreateDelete(std::string client_tag); |
+ |
+ virtual ~EntityChange(); |
+ |
+ std::string client_tag() const { return client_tag_; } |
skym
2015/11/23 16:57:16
My understanding was that we were trying to use cl
maxbogue
2015/11/23 17:00:46
Done.
|
+ ChangeType type() const { return type_; } |
+ const EntityData& data() const { return data_.value(); } |
+ |
+ private: |
+ EntityChange(std::string client_tag, ChangeType type, EntityDataPtr data); |
+ |
+ const std::string client_tag_; |
+ const ChangeType type_; |
+ const EntityDataPtr data_; |
+}; |
+ |
+typedef std::vector<EntityChange> EntityChangeList; |
skym
2015/11/23 16:57:16
Should you have #include <vector> for this?
maxbogue
2015/11/23 17:00:46
Done.
|
+ |
+} // namespace syncer_v2 |
+ |
+#endif // SYNC_API_ENTITY_CHANGE_H_ |