Index: third_party/protobuf/src/google/protobuf/compiler/javanano/javanano_enum_field.h |
diff --git a/third_party/protobuf/src/google/protobuf/compiler/java/java_enum_field.h b/third_party/protobuf/src/google/protobuf/compiler/javanano/javanano_enum_field.h |
similarity index 59% |
copy from third_party/protobuf/src/google/protobuf/compiler/java/java_enum_field.h |
copy to third_party/protobuf/src/google/protobuf/compiler/javanano/javanano_enum_field.h |
index 90fae6394d6471c798bf2eba2fe2fef0f8a12532..b94790d6bd1b6839274bbd1a98e3030f6d879c17 100644 |
--- a/third_party/protobuf/src/google/protobuf/compiler/java/java_enum_field.h |
+++ b/third_party/protobuf/src/google/protobuf/compiler/javanano/javanano_enum_field.h |
@@ -32,92 +32,95 @@ |
// 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_JAVANANO_ENUM_FIELD_H__ |
+#define GOOGLE_PROTOBUF_COMPILER_JAVANANO_ENUM_FIELD_H__ |
#include <map> |
#include <string> |
-#include <google/protobuf/compiler/java/java_field.h> |
+#include <vector> |
+#include <google/protobuf/compiler/javanano/javanano_field.h> |
namespace google { |
namespace protobuf { |
namespace compiler { |
-namespace java { |
+namespace javanano { |
class EnumFieldGenerator : public FieldGenerator { |
public: |
- explicit EnumFieldGenerator(const FieldDescriptor* descriptor, |
- int messageBitIndex, int builderBitIndex); |
+ explicit EnumFieldGenerator( |
+ const FieldDescriptor* descriptor, const Params& params); |
~EnumFieldGenerator(); |
// implements FieldGenerator --------------------------------------- |
- 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 GenerateMembers(io::Printer* printer, bool lazy_init) const; |
+ void GenerateClearCode(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; |
+ void GenerateHashCodeCode(io::Printer* printer) const; |
private: |
const FieldDescriptor* descriptor_; |
map<string, string> variables_; |
- const int messageBitIndex_; |
- const int builderBitIndex_; |
+ vector<string> canonical_values_; |
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumFieldGenerator); |
}; |
+class AccessorEnumFieldGenerator : public FieldGenerator { |
+ public: |
+ explicit AccessorEnumFieldGenerator(const FieldDescriptor* descriptor, |
+ const Params& params, int has_bit_index); |
+ ~AccessorEnumFieldGenerator(); |
+ |
+ // implements FieldGenerator --------------------------------------- |
+ void GenerateMembers(io::Printer* printer, bool lazy_init) const; |
+ void GenerateClearCode(io::Printer* printer) const; |
+ void GenerateMergingCode(io::Printer* printer) const; |
+ void GenerateSerializationCode(io::Printer* printer) const; |
+ void GenerateSerializedSizeCode(io::Printer* printer) const; |
+ void GenerateEqualsCode(io::Printer* printer) const; |
+ void GenerateHashCodeCode(io::Printer* printer) const; |
+ |
+ private: |
+ const FieldDescriptor* descriptor_; |
+ map<string, string> variables_; |
+ vector<string> canonical_values_; |
+ |
+ GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(AccessorEnumFieldGenerator); |
+}; |
+ |
class RepeatedEnumFieldGenerator : public FieldGenerator { |
public: |
- explicit RepeatedEnumFieldGenerator(const FieldDescriptor* descriptor, |
- int messageBitIndex, int builderBitIndex); |
+ explicit RepeatedEnumFieldGenerator( |
+ const FieldDescriptor* descriptor, const Params& params); |
~RepeatedEnumFieldGenerator(); |
// implements FieldGenerator --------------------------------------- |
- 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 GenerateMembers(io::Printer* printer, bool lazy_init) const; |
+ void GenerateClearCode(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 GenerateMergingCodeFromPacked(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; |
+ void GenerateHashCodeCode(io::Printer* printer) const; |
+ void GenerateFixClonedCode(io::Printer* printer) const; |
private: |
+ void GenerateRepeatedDataSizeCode(io::Printer* printer) const; |
+ |
const FieldDescriptor* descriptor_; |
map<string, string> variables_; |
- const int messageBitIndex_; |
- const int builderBitIndex_; |
+ vector<string> canonical_values_; |
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedEnumFieldGenerator); |
}; |
-} // namespace java |
+} // namespace javanano |
} // namespace compiler |
} // namespace protobuf |
} // namespace google |
-#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_ENUM_FIELD_H__ |
+#endif // GOOGLE_PROTOBUF_COMPILER_JAVANANO_ENUM_FIELD_H__ |