Index: third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_map_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/cpp/cpp_map_field.h |
similarity index 57% |
copy from third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_message_field.h |
copy to third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_map_field.h |
index a5ed68a5c4265d556281318cdcab6050d813aae3..5e205623b808c624768d2ebd2368040f4cdd6b81 100644 |
--- a/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_message_field.h |
+++ b/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_map_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 |
@@ -28,58 +28,30 @@ |
// (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) |
-// 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_CPP_MAP_FIELD_H__ |
+#define GOOGLE_PROTOBUF_COMPILER_CPP_MAP_FIELD_H__ |
#include <map> |
#include <string> |
-#include <google/protobuf/compiler/cpp/cpp_field.h> |
+ |
+#include <google/protobuf/compiler/cpp/cpp_message_field.h> |
namespace google { |
namespace protobuf { |
namespace compiler { |
namespace cpp { |
-class MessageFieldGenerator : public FieldGenerator { |
- public: |
- explicit MessageFieldGenerator(const FieldDescriptor* descriptor, |
- const Options& options); |
- ~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 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; |
- |
- private: |
- const FieldDescriptor* descriptor_; |
- map<string, string> variables_; |
- |
- GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageFieldGenerator); |
-}; |
- |
-class RepeatedMessageFieldGenerator : public FieldGenerator { |
+class MapFieldGenerator : public FieldGenerator { |
public: |
- explicit RepeatedMessageFieldGenerator(const FieldDescriptor* descriptor, |
- const Options& options); |
- ~RepeatedMessageFieldGenerator(); |
+ explicit MapFieldGenerator(const FieldDescriptor* descriptor, |
+ const Options& options); |
+ ~MapFieldGenerator(); |
// implements FieldGenerator --------------------------------------- |
void GeneratePrivateMembers(io::Printer* printer) const; |
void GenerateAccessorDeclarations(io::Printer* printer) const; |
- void GenerateInlineAccessorDefinitions(io::Printer* printer) const; |
+ void GenerateInlineAccessorDefinitions(io::Printer* printer, |
+ bool is_inline) const; |
void GenerateClearingCode(io::Printer* printer) const; |
void GenerateMergingCode(io::Printer* printer) const; |
void GenerateSwappingCode(io::Printer* printer) const; |
@@ -91,9 +63,10 @@ class RepeatedMessageFieldGenerator : public FieldGenerator { |
private: |
const FieldDescriptor* descriptor_; |
+ const bool dependent_field_; |
map<string, string> variables_; |
- GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedMessageFieldGenerator); |
+ GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MapFieldGenerator); |
}; |
} // namespace cpp |
@@ -101,4 +74,4 @@ class RepeatedMessageFieldGenerator : public FieldGenerator { |
} // namespace protobuf |
} // namespace google |
-#endif // GOOGLE_PROTOBUF_COMPILER_CPP_MESSAGE_FIELD_H__ |
+#endif // GOOGLE_PROTOBUF_COMPILER_CPP_MAP_FIELD_H__ |