Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Unified Diff: blimp/net/helium/syncable.cc

Issue 2382533002: Helium: Initial proto and Syncable interface definition (Closed)
Patch Set: Couple minor tweaks Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: blimp/net/helium/syncable.cc
diff --git a/blimp/net/helium/syncable.cc b/blimp/net/helium/syncable.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a6b8a7d4211f207010035db497eb57813fd5a671
--- /dev/null
+++ b/blimp/net/helium/syncable.cc
@@ -0,0 +1,27 @@
+// Copyright 2016 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.
+
+#include "blimp/net/helium/syncable.h"
+
+namespace blimp {
+
+SyncableObject::SyncableObject(const VectorClock& clock) : clock_(clock) {}
+
+template <class ChangesetType>
+SyncableMember<ChangesetType>::SyncableMember(SyncableObject* parent)
+ : parent_(parent) {}
+
+template <class ChangesetType>
+VectorClock SyncableMember<ChangesetType>::IncrementParentClock() {
+ parent_->get_clock().IncrementLocal();
+ return parent_->get_clock();
+}
+
+// Instantiate the template for int (Unit test uses it)
Kevin M 2016/09/30 18:34:36 This approach doesn't scale - unit tests need it f
scf 2016/09/30 22:13:23 Done.
+template class Syncable<int>;
+template class Syncable<helium::Changeset>;
+template class SyncableMember<helium::Changeset>;
+template class SyncableMember<int>;
+
+} // namespace blimp

Powered by Google App Engine
This is Rietveld 408576698