Index: third_party/protobuf/src/google/protobuf/compiler/java/java_message_field_lite.h |
diff --git a/third_party/protobuf/src/google/protobuf/compiler/java/java_enum_field.h b/third_party/protobuf/src/google/protobuf/compiler/java/java_message_field_lite.h |
similarity index 62% |
copy from third_party/protobuf/src/google/protobuf/compiler/java/java_enum_field.h |
copy to third_party/protobuf/src/google/protobuf/compiler/java/java_message_field_lite.h |
index 90fae6394d6471c798bf2eba2fe2fef0f8a12532..ae26c06aaae38febed516a19987440f2ee4772ac 100644 |
--- a/third_party/protobuf/src/google/protobuf/compiler/java/java_enum_field.h |
+++ b/third_party/protobuf/src/google/protobuf/compiler/java/java_message_field_lite.h |
@@ -1,6 +1,6 @@ |
// Protocol Buffers - Google's data interchange format |
// Copyright 2008 Google Inc. All rights reserved. |
-// http://code.google.com/p/protobuf/ |
+// https://developers.google.com/protocol-buffers/ |
// |
// Redistribution and use in source and binary forms, with or without |
// modification, are permitted provided that the following conditions are |
@@ -32,8 +32,8 @@ |
// Based on original Protocol Buffers design by |
// Sanjay Ghemawat, Jeff Dean, and others. |
-#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_ENUM_FIELD_H__ |
-#define GOOGLE_PROTOBUF_COMPILER_JAVA_ENUM_FIELD_H__ |
+#ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_MESSAGE_FIELD_LITE_H__ |
+#define GOOGLE_PROTOBUF_COMPILER_JAVA_MESSAGE_FIELD_LITE_H__ |
#include <map> |
#include <string> |
@@ -41,25 +41,34 @@ |
namespace google { |
namespace protobuf { |
+ namespace compiler { |
+ namespace java { |
+ class Context; // context.h |
+ class ClassNameResolver; // name_resolver.h |
+ } |
+ } |
+} |
+ |
+namespace protobuf { |
namespace compiler { |
namespace java { |
-class EnumFieldGenerator : public FieldGenerator { |
+class ImmutableMessageFieldLiteGenerator : public ImmutableFieldLiteGenerator { |
public: |
- explicit EnumFieldGenerator(const FieldDescriptor* descriptor, |
- int messageBitIndex, int builderBitIndex); |
- ~EnumFieldGenerator(); |
+ explicit ImmutableMessageFieldLiteGenerator( |
+ const FieldDescriptor* descriptor, int messageBitIndex, |
+ int builderBitIndex, Context* context); |
+ ~ImmutableMessageFieldLiteGenerator(); |
- // implements FieldGenerator --------------------------------------- |
+ // implements ImmutableFieldLiteGenerator ------------------------------------ |
int GetNumBitsForMessage() const; |
int GetNumBitsForBuilder() const; |
void GenerateInterfaceMembers(io::Printer* printer) const; |
void GenerateMembers(io::Printer* printer) const; |
void GenerateBuilderMembers(io::Printer* printer) const; |
void GenerateInitializationCode(io::Printer* printer) const; |
- void GenerateBuilderClearCode(io::Printer* printer) const; |
void GenerateMergingCode(io::Printer* printer) const; |
- void GenerateBuildingCode(io::Printer* printer) const; |
+ void GenerateDynamicMethodMakeImmutableCode(io::Printer* printer) const; |
void GenerateParsingCode(io::Printer* printer) const; |
void GenerateParsingDoneCode(io::Printer* printer) const; |
void GenerateSerializationCode(io::Printer* printer) const; |
@@ -70,33 +79,55 @@ class EnumFieldGenerator : public FieldGenerator { |
string GetBoxedType() const; |
- private: |
+ protected: |
const FieldDescriptor* descriptor_; |
map<string, string> variables_; |
const int messageBitIndex_; |
const int builderBitIndex_; |
+ Context* context_; |
+ ClassNameResolver* name_resolver_; |
+ |
+ private: |
+ GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutableMessageFieldLiteGenerator); |
+}; |
+ |
+class ImmutableMessageOneofFieldLiteGenerator |
+ : public ImmutableMessageFieldLiteGenerator { |
+ public: |
+ ImmutableMessageOneofFieldLiteGenerator( |
+ const FieldDescriptor* descriptor, int messageBitIndex, |
+ int builderBitIndex, Context* context); |
+ ~ImmutableMessageOneofFieldLiteGenerator(); |
+ |
+ void GenerateMembers(io::Printer* printer) const; |
+ void GenerateBuilderMembers(io::Printer* printer) const; |
+ void GenerateMergingCode(io::Printer* printer) const; |
+ void GenerateParsingCode(io::Printer* printer) const; |
+ void GenerateSerializationCode(io::Printer* printer) const; |
+ void GenerateSerializedSizeCode(io::Printer* printer) const; |
- GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumFieldGenerator); |
+ private: |
+ GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutableMessageOneofFieldLiteGenerator); |
}; |
-class RepeatedEnumFieldGenerator : public FieldGenerator { |
+class RepeatedImmutableMessageFieldLiteGenerator |
+ : public ImmutableFieldLiteGenerator { |
public: |
- explicit RepeatedEnumFieldGenerator(const FieldDescriptor* descriptor, |
- int messageBitIndex, int builderBitIndex); |
- ~RepeatedEnumFieldGenerator(); |
+ explicit RepeatedImmutableMessageFieldLiteGenerator( |
+ const FieldDescriptor* descriptor, int messageBitIndex, |
+ int builderBitIndex, Context* context); |
+ ~RepeatedImmutableMessageFieldLiteGenerator(); |
- // implements FieldGenerator --------------------------------------- |
+ // implements ImmutableFieldLiteGenerator ------------------------------------ |
int GetNumBitsForMessage() const; |
int GetNumBitsForBuilder() const; |
void GenerateInterfaceMembers(io::Printer* printer) const; |
void GenerateMembers(io::Printer* printer) const; |
void GenerateBuilderMembers(io::Printer* printer) const; |
void GenerateInitializationCode(io::Printer* printer) const; |
- void GenerateBuilderClearCode(io::Printer* printer) const; |
void GenerateMergingCode(io::Printer* printer) const; |
- void GenerateBuildingCode(io::Printer* printer) const; |
+ void GenerateDynamicMethodMakeImmutableCode(io::Printer* printer) const; |
void GenerateParsingCode(io::Printer* printer) const; |
- void GenerateParsingCodeFromPacked(io::Printer* printer) const; |
void GenerateParsingDoneCode(io::Printer* printer) const; |
void GenerateSerializationCode(io::Printer* printer) const; |
void GenerateSerializedSizeCode(io::Printer* printer) const; |
@@ -106,13 +137,16 @@ class RepeatedEnumFieldGenerator : public FieldGenerator { |
string GetBoxedType() const; |
- private: |
+ protected: |
const FieldDescriptor* descriptor_; |
map<string, string> variables_; |
const int messageBitIndex_; |
const int builderBitIndex_; |
+ Context* context_; |
+ ClassNameResolver* name_resolver_; |
- GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedEnumFieldGenerator); |
+ private: |
+ GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedImmutableMessageFieldLiteGenerator); |
}; |
} // namespace java |
@@ -120,4 +154,4 @@ class RepeatedEnumFieldGenerator : public FieldGenerator { |
} // namespace protobuf |
} // namespace google |
-#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_ENUM_FIELD_H__ |
+#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_MESSAGE_FIELD_LITE_H__ |