Index: third_party/protobuf/src/google/protobuf/compiler/javanano/javanano_message_field.h |
diff --git a/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_message_field.h b/third_party/protobuf/src/google/protobuf/compiler/javanano/javanano_message_field.h |
similarity index 56% |
copy from third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_message_field.h |
copy to third_party/protobuf/src/google/protobuf/compiler/javanano/javanano_message_field.h |
index a5ed68a5c4265d556281318cdcab6050d813aae3..e074735c7055403e38c12087e26fa85fcd2c6e89 100644 |
--- a/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_message_field.h |
+++ b/third_party/protobuf/src/google/protobuf/compiler/javanano/javanano_message_field.h |
@@ -32,36 +32,33 @@ |
// Based on original Protocol Buffers design by |
// Sanjay Ghemawat, Jeff Dean, and others. |
-#ifndef GOOGLE_PROTOBUF_COMPILER_CPP_MESSAGE_FIELD_H__ |
-#define GOOGLE_PROTOBUF_COMPILER_CPP_MESSAGE_FIELD_H__ |
+#ifndef GOOGLE_PROTOBUF_COMPILER_JAVANANO_MESSAGE_FIELD_H__ |
+#define GOOGLE_PROTOBUF_COMPILER_JAVANANO_MESSAGE_FIELD_H__ |
#include <map> |
#include <string> |
-#include <google/protobuf/compiler/cpp/cpp_field.h> |
+#include <google/protobuf/compiler/javanano/javanano_field.h> |
namespace google { |
namespace protobuf { |
namespace compiler { |
-namespace cpp { |
+namespace javanano { |
class MessageFieldGenerator : public FieldGenerator { |
public: |
- explicit MessageFieldGenerator(const FieldDescriptor* descriptor, |
- const Options& options); |
+ explicit MessageFieldGenerator( |
+ const FieldDescriptor* descriptor, const Params& params); |
~MessageFieldGenerator(); |
// implements FieldGenerator --------------------------------------- |
- void GeneratePrivateMembers(io::Printer* printer) const; |
- void GenerateAccessorDeclarations(io::Printer* printer) const; |
- void GenerateInlineAccessorDefinitions(io::Printer* printer) const; |
- void GenerateClearingCode(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 GenerateSwappingCode(io::Printer* printer) const; |
- void GenerateConstructorCode(io::Printer* printer) const; |
- void GenerateMergeFromCodedStream(io::Printer* printer) const; |
- void GenerateSerializeWithCachedSizes(io::Printer* printer) const; |
- void GenerateSerializeWithCachedSizesToArray(io::Printer* printer) const; |
- void GenerateByteSize(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; |
+ void GenerateFixClonedCode(io::Printer* printer) const; |
private: |
const FieldDescriptor* descriptor_; |
@@ -70,24 +67,44 @@ class MessageFieldGenerator : public FieldGenerator { |
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageFieldGenerator); |
}; |
+class MessageOneofFieldGenerator : public FieldGenerator { |
+ public: |
+ explicit MessageOneofFieldGenerator(const FieldDescriptor* descriptor, |
+ const Params& params); |
+ ~MessageOneofFieldGenerator(); |
+ |
+ // 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; |
+ void GenerateFixClonedCode(io::Printer* printer) const; |
+ |
+ private: |
+ const FieldDescriptor* descriptor_; |
+ map<string, string> variables_; |
+ |
+ GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageOneofFieldGenerator); |
+}; |
+ |
class RepeatedMessageFieldGenerator : public FieldGenerator { |
public: |
explicit RepeatedMessageFieldGenerator(const FieldDescriptor* descriptor, |
- const Options& options); |
+ const Params& params); |
~RepeatedMessageFieldGenerator(); |
// implements FieldGenerator --------------------------------------- |
- void GeneratePrivateMembers(io::Printer* printer) const; |
- void GenerateAccessorDeclarations(io::Printer* printer) const; |
- void GenerateInlineAccessorDefinitions(io::Printer* printer) const; |
- void GenerateClearingCode(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 GenerateSwappingCode(io::Printer* printer) const; |
- void GenerateConstructorCode(io::Printer* printer) const; |
- void GenerateMergeFromCodedStream(io::Printer* printer) const; |
- void GenerateSerializeWithCachedSizes(io::Printer* printer) const; |
- void GenerateSerializeWithCachedSizesToArray(io::Printer* printer) const; |
- void GenerateByteSize(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; |
+ void GenerateFixClonedCode(io::Printer* printer) const; |
private: |
const FieldDescriptor* descriptor_; |
@@ -96,9 +113,9 @@ class RepeatedMessageFieldGenerator : public FieldGenerator { |
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedMessageFieldGenerator); |
}; |
-} // namespace cpp |
+} // namespace javanano |
} // namespace compiler |
} // namespace protobuf |
} // namespace google |
-#endif // GOOGLE_PROTOBUF_COMPILER_CPP_MESSAGE_FIELD_H__ |
+#endif // GOOGLE_PROTOBUF_COMPILER_JAVANANO_MESSAGE_FIELD_H__ |