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

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

Issue 2400303002: Add LwwRegister CRDT (Closed)
Patch Set: Add comment on max string length constant 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
« no previous file with comments | « blimp/helium/BUILD.gn ('k') | blimp/helium/coded_value_serializer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_CODED_VALUE_SERIALIZER_H_
6 #define BLIMP_HELIUM_CODED_VALUE_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 class VersionVector;
25
26 // Syncable CRDTs need to serialize their data into CodedOutputStreams. This
27 // helper class centralizes that logic into two overloaded functions, one for
28 // serialization and one for deserialization that can be called for any
29 // supported primitive type.
30 class BLIMP_HELIUM_EXPORT CodedValueSerializer {
31 public:
32 static void Serialize(const int32_t& value,
33 google::protobuf::io::CodedOutputStream* output_stream);
34 static bool Deserialize(google::protobuf::io::CodedInputStream* input_stream,
35 int32_t* value);
36
37 static void Serialize(const std::string& value,
38 google::protobuf::io::CodedOutputStream* output_stream);
39 static bool Deserialize(google::protobuf::io::CodedInputStream* input_stream,
40 std::string* value);
41
42 static void Serialize(const VersionVector& value,
43 google::protobuf::io::CodedOutputStream* output_stream);
44 static bool Deserialize(google::protobuf::io::CodedInputStream* input_stream,
45 VersionVector* value);
46 };
47
48 } // namespace helium
49 } // namespace blimp
50
51 #endif // BLIMP_HELIUM_CODED_VALUE_SERIALIZER_H_
OLDNEW
« no previous file with comments | « blimp/helium/BUILD.gn ('k') | blimp/helium/coded_value_serializer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698