Index: third_party/protobuf/src/google/protobuf/compiler/java/java_lazy_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_lazy_message_field_lite.h |
similarity index 53% |
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_lazy_message_field_lite.h |
index 90fae6394d6471c798bf2eba2fe2fef0f8a12532..e85ec0f35a8b43feb783c77aacf035e96e295ee6 100644 |
--- a/third_party/protobuf/src/google/protobuf/compiler/java/java_enum_field.h |
+++ b/third_party/protobuf/src/google/protobuf/compiler/java/java_lazy_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 |
@@ -28,91 +28,86 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-// Author: kenton@google.com (Kenton Varda) |
+// Author: niwasaki@google.com (Naoki Iwasaki) |
// 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_LAZY_MESSAGE_FIELD_LITE_H__ |
+#define GOOGLE_PROTOBUF_COMPILER_JAVA_LAZY_MESSAGE_FIELD_LITE_H__ |
-#include <map> |
-#include <string> |
#include <google/protobuf/compiler/java/java_field.h> |
+#include <google/protobuf/compiler/java/java_message_field_lite.h> |
namespace google { |
namespace protobuf { |
+ namespace compiler { |
+ namespace java { |
+ class Context; // context.h |
+ } |
+ } |
+} |
+ |
+namespace protobuf { |
namespace compiler { |
namespace java { |
-class EnumFieldGenerator : public FieldGenerator { |
+class ImmutableLazyMessageFieldLiteGenerator |
+ : public ImmutableMessageFieldLiteGenerator { |
public: |
- explicit EnumFieldGenerator(const FieldDescriptor* descriptor, |
- int messageBitIndex, int builderBitIndex); |
- ~EnumFieldGenerator(); |
- |
- // implements FieldGenerator --------------------------------------- |
- int GetNumBitsForMessage() const; |
- int GetNumBitsForBuilder() const; |
- void GenerateInterfaceMembers(io::Printer* printer) const; |
+ explicit ImmutableLazyMessageFieldLiteGenerator( |
+ const FieldDescriptor* descriptor, int messageBitIndex, |
+ int builderBitIndex, Context* context); |
+ ~ImmutableLazyMessageFieldLiteGenerator(); |
+ |
+ // overroads ImmutableMessageFieldLiteGenerator ------------------------------ |
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 GenerateParsingCode(io::Printer* printer) const; |
- void GenerateParsingDoneCode(io::Printer* printer) const; |
void GenerateSerializationCode(io::Printer* printer) const; |
void GenerateSerializedSizeCode(io::Printer* printer) const; |
- void GenerateFieldBuilderInitializationCode(io::Printer* printer) const; |
- void GenerateEqualsCode(io::Printer* printer) const; |
- void GenerateHashCode(io::Printer* printer) const; |
- |
- string GetBoxedType() const; |
private: |
- const FieldDescriptor* descriptor_; |
- map<string, string> variables_; |
- const int messageBitIndex_; |
- const int builderBitIndex_; |
- |
- GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumFieldGenerator); |
+ GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutableLazyMessageFieldLiteGenerator); |
}; |
-class RepeatedEnumFieldGenerator : public FieldGenerator { |
+class ImmutableLazyMessageOneofFieldLiteGenerator |
+ : public ImmutableLazyMessageFieldLiteGenerator { |
public: |
- explicit RepeatedEnumFieldGenerator(const FieldDescriptor* descriptor, |
- int messageBitIndex, int builderBitIndex); |
- ~RepeatedEnumFieldGenerator(); |
- |
- // implements FieldGenerator --------------------------------------- |
- int GetNumBitsForMessage() const; |
- int GetNumBitsForBuilder() const; |
- void GenerateInterfaceMembers(io::Printer* printer) const; |
+ ImmutableLazyMessageOneofFieldLiteGenerator( |
+ const FieldDescriptor* descriptor, int messageBitIndex, |
+ int builderBitIndex, Context* context); |
+ ~ImmutableLazyMessageOneofFieldLiteGenerator(); |
+ |
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 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; |
- void GenerateFieldBuilderInitializationCode(io::Printer* printer) const; |
- void GenerateEqualsCode(io::Printer* printer) const; |
- void GenerateHashCode(io::Printer* printer) const; |
- |
- string GetBoxedType() const; |
private: |
- const FieldDescriptor* descriptor_; |
- map<string, string> variables_; |
- const int messageBitIndex_; |
- const int builderBitIndex_; |
+ GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutableLazyMessageOneofFieldLiteGenerator); |
+}; |
- GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedEnumFieldGenerator); |
+class RepeatedImmutableLazyMessageFieldLiteGenerator |
+ : public RepeatedImmutableMessageFieldLiteGenerator { |
+ public: |
+ explicit RepeatedImmutableLazyMessageFieldLiteGenerator( |
+ const FieldDescriptor* descriptor, int messageBitIndex, |
+ int builderBitIndex, Context* context); |
+ ~RepeatedImmutableLazyMessageFieldLiteGenerator(); |
+ |
+ // overroads RepeatedImmutableMessageFieldLiteGenerator ---------------------- |
+ void GenerateMembers(io::Printer* printer) const; |
+ void GenerateBuilderMembers(io::Printer* printer) const; |
+ void GenerateParsingCode(io::Printer* printer) const; |
+ void GenerateSerializationCode(io::Printer* printer) const; |
+ void GenerateSerializedSizeCode(io::Printer* printer) const; |
+ |
+ private: |
+ GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedImmutableLazyMessageFieldLiteGenerator); |
}; |
} // namespace java |
@@ -120,4 +115,4 @@ class RepeatedEnumFieldGenerator : public FieldGenerator { |
} // namespace protobuf |
} // namespace google |
-#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_ENUM_FIELD_H__ |
+#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_LAZY_MESSAGE_FIELD_LITE_H__ |