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

Side by Side Diff: blimp/helium/syncable_primitive_serializer.h

Issue 2400303002: Add LwwRegister CRDT (Closed)
Patch Set: Refactor SyncablePrimitiveSerializer tests and other code review feedback. Created 4 years, 2 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef BLIMP_HELIUM_SYNCABLE_PRIMITIVE_SERIALIZER_H_
6 #define BLIMP_HELIUM_SYNCABLE_PRIMITIVE_SERIALIZER_H_
7
8 #include <string>
9
10 #include "blimp/helium/blimp_helium_export.h"
11
12 namespace google {
13 namespace protobuf {
14 namespace io {
15 class CodedInputStream;
16 class CodedOutputStream;
17 } // namespace io
18 } // namespace protobuf
19 } // namespace google
20
21 namespace blimp {
22 namespace helium {
23
24 // Syncable CRDTs need to serialize their data into CodedOutputStreams. This
25 // helper class centralizes that logic into two overloaded functions, one for
26 // serialization and one for deserialization that can be called for any
Kevin M 2016/10/19 00:27:08 "Any" doesn't seem accurate here, as we only suppo
steimel 2016/10/19 16:40:50 Done.
27 // primitive type.
28 class BLIMP_HELIUM_EXPORT SyncablePrimitiveSerializer {
29 public:
30 static void Serialize(const int32_t& value,
31 google::protobuf::io::CodedOutputStream* output_stream);
32 static bool Deserialize(google::protobuf::io::CodedInputStream* input_stream,
33 int32_t* value);
34
35 static void Serialize(const std::string& value,
36 google::protobuf::io::CodedOutputStream* output_stream);
37 static bool Deserialize(google::protobuf::io::CodedInputStream* input_stream,
38 std::string* value);
39 };
40
41 } // namespace helium
42 } // namespace blimp
43
44 #endif // BLIMP_HELIUM_SYNCABLE_PRIMITIVE_SERIALIZER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698