aboutsummaryrefslogtreecommitdiffstats
path: root/src/google/protobuf/compiler/javanano/javanano_field.h
diff options
context:
space:
mode:
authorMax Cai <maxtroy@google.com>2013-11-13 18:21:28 +0000
committerMax Cai <maxtroy@google.com>2013-11-18 11:47:25 +0000
commitfea3fd5cb6ff88b51da60b1f33004944d93a9fce (patch)
tree9bcd9aeaf2ff8f459af7385cebe3b8cbfad191d8 /src/google/protobuf/compiler/javanano/javanano_field.h
parent3e0d99fab8c1da2a8f36637b7bf5e8581143e36a (diff)
downloadexternal_protobuf-fea3fd5cb6ff88b51da60b1f33004944d93a9fce.zip
external_protobuf-fea3fd5cb6ff88b51da60b1f33004944d93a9fce.tar.gz
external_protobuf-fea3fd5cb6ff88b51da60b1f33004944d93a9fce.tar.bz2
Align with main: two ways of parsing repeated packable fields.
It is a requirement for parsing code to handle packed and unpacked forms on the wire for repeated packable fields. This change aligns the javanano's behavior with the java's. Bonus: optimize array length calculation when parsing repeated fixed-size-element-type fields. Bonus 2: lose "xMemoizedSerializedSize" for repeated enum fields, and make the serialized size calculation match that for repeated int32 fields. Change-Id: I8a06103d9290234adb46b0971b5ed155544fe86a
Diffstat (limited to 'src/google/protobuf/compiler/javanano/javanano_field.h')
-rw-r--r--src/google/protobuf/compiler/javanano/javanano_field.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/google/protobuf/compiler/javanano/javanano_field.h b/src/google/protobuf/compiler/javanano/javanano_field.h
index 150ec19..14b6489 100644
--- a/src/google/protobuf/compiler/javanano/javanano_field.h
+++ b/src/google/protobuf/compiler/javanano/javanano_field.h
@@ -60,6 +60,12 @@ class FieldGenerator {
virtual void GenerateMembers(io::Printer* printer) const = 0;
virtual void GenerateClearCode(io::Printer* printer) const = 0;
virtual void GenerateMergingCode(io::Printer* printer) const = 0;
+
+ // Generates code to merge from packed serialized form. The default
+ // implementation will fail; subclasses which can handle packed serialized
+ // forms will override this and print appropriate code to the printer.
+ virtual void GenerateMergingCodeFromPacked(io::Printer* printer) const;
+
virtual void GenerateSerializationCode(io::Printer* printer) const = 0;
virtual void GenerateSerializedSizeCode(io::Printer* printer) const = 0;
virtual void GenerateEqualsCode(io::Printer* printer) const = 0;