Index: third_party/protobuf/src/google/protobuf/compiler/java/java_primitive_field.h |
diff --git a/third_party/protobuf/src/google/protobuf/compiler/java/java_primitive_field.h b/third_party/protobuf/src/google/protobuf/compiler/java/java_primitive_field.h |
index 1b5b6d95d56a66a2bc07f03c11597e79d439c485..d0cd12d976d238ba9e5d01cbef58bdd4c645fa12 100644 |
--- a/third_party/protobuf/src/google/protobuf/compiler/java/java_primitive_field.h |
+++ b/third_party/protobuf/src/google/protobuf/compiler/java/java_primitive_field.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 |
@@ -41,16 +41,26 @@ |
namespace google { |
namespace protobuf { |
+ namespace compiler { |
+ namespace java { |
+ class Context; // context.h |
+ class ClassNameResolver; // name_resolver.h |
+ } |
+ } |
+} |
+ |
+namespace protobuf { |
namespace compiler { |
namespace java { |
-class PrimitiveFieldGenerator : public FieldGenerator { |
+class ImmutablePrimitiveFieldGenerator : public ImmutableFieldGenerator { |
public: |
- explicit PrimitiveFieldGenerator(const FieldDescriptor* descriptor, |
- int messageBitIndex, int builderBitIndex); |
- ~PrimitiveFieldGenerator(); |
+ explicit ImmutablePrimitiveFieldGenerator( |
+ const FieldDescriptor* descriptor, int messageBitIndex, |
+ int builderBitIndex, Context* context); |
+ ~ImmutablePrimitiveFieldGenerator(); |
- // implements FieldGenerator --------------------------------------- |
+ // implements ImmutableFieldGenerator --------------------------------------- |
int GetNumBitsForMessage() const; |
int GetNumBitsForBuilder() const; |
void GenerateInterfaceMembers(io::Printer* printer) const; |
@@ -70,22 +80,47 @@ class PrimitiveFieldGenerator : 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(PrimitiveFieldGenerator); |
+ private: |
+ GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutablePrimitiveFieldGenerator); |
+}; |
+ |
+class ImmutablePrimitiveOneofFieldGenerator |
+ : public ImmutablePrimitiveFieldGenerator { |
+ public: |
+ ImmutablePrimitiveOneofFieldGenerator( |
+ const FieldDescriptor* descriptor, int messageBitIndex, |
+ int builderBitIndex, Context* context); |
+ ~ImmutablePrimitiveOneofFieldGenerator(); |
+ |
+ void GenerateMembers(io::Printer* printer) const; |
+ void GenerateBuilderMembers(io::Printer* printer) const; |
+ void GenerateBuildingCode(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; |
+ |
+ private: |
+ GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ImmutablePrimitiveOneofFieldGenerator); |
}; |
-class RepeatedPrimitiveFieldGenerator : public FieldGenerator { |
+class RepeatedImmutablePrimitiveFieldGenerator |
+ : public ImmutableFieldGenerator { |
public: |
- explicit RepeatedPrimitiveFieldGenerator(const FieldDescriptor* descriptor, |
- int messageBitIndex, int builderBitIndex); |
- ~RepeatedPrimitiveFieldGenerator(); |
+ explicit RepeatedImmutablePrimitiveFieldGenerator( |
+ const FieldDescriptor* descriptor, int messageBitIndex, |
+ int builderBitIndex, Context* context); |
+ virtual ~RepeatedImmutablePrimitiveFieldGenerator(); |
- // implements FieldGenerator --------------------------------------- |
+ // implements ImmutableFieldGenerator --------------------------------------- |
int GetNumBitsForMessage() const; |
int GetNumBitsForBuilder() const; |
void GenerateInterfaceMembers(io::Printer* printer) const; |
@@ -111,8 +146,10 @@ class RepeatedPrimitiveFieldGenerator : public FieldGenerator { |
map<string, string> variables_; |
const int messageBitIndex_; |
const int builderBitIndex_; |
+ Context* context_; |
+ ClassNameResolver* name_resolver_; |
- GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedPrimitiveFieldGenerator); |
+ GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedImmutablePrimitiveFieldGenerator); |
}; |
} // namespace java |