| OLD | NEW |
| 1 // Protocol Buffers - Google's data interchange format | 1 // Protocol Buffers - Google's data interchange format |
| 2 // Copyright 2008 Google Inc. All rights reserved. | 2 // Copyright 2008 Google Inc. All rights reserved. |
| 3 // https://developers.google.com/protocol-buffers/ | 3 // https://developers.google.com/protocol-buffers/ |
| 4 // | 4 // |
| 5 // Redistribution and use in source and binary forms, with or without | 5 // Redistribution and use in source and binary forms, with or without |
| 6 // modification, are permitted provided that the following conditions are | 6 // modification, are permitted provided that the following conditions are |
| 7 // met: | 7 // met: |
| 8 // | 8 // |
| 9 // * Redistributions of source code must retain the above copyright | 9 // * Redistributions of source code must retain the above copyright |
| 10 // notice, this list of conditions and the following disclaimer. | 10 // notice, this list of conditions and the following disclaimer. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 #include <string> | 39 #include <string> |
| 40 #include <google/protobuf/compiler/cpp/cpp_field.h> | 40 #include <google/protobuf/compiler/cpp/cpp_field.h> |
| 41 | 41 |
| 42 namespace google { | 42 namespace google { |
| 43 namespace protobuf { | 43 namespace protobuf { |
| 44 namespace compiler { | 44 namespace compiler { |
| 45 namespace cpp { | 45 namespace cpp { |
| 46 | 46 |
| 47 class MessageFieldGenerator : public FieldGenerator { | 47 class MessageFieldGenerator : public FieldGenerator { |
| 48 public: | 48 public: |
| 49 explicit MessageFieldGenerator(const FieldDescriptor* descriptor, | 49 MessageFieldGenerator(const FieldDescriptor* descriptor, |
| 50 const Options& options); | 50 const Options& options); |
| 51 ~MessageFieldGenerator(); | 51 ~MessageFieldGenerator(); |
| 52 | 52 |
| 53 // implements FieldGenerator --------------------------------------- | 53 // implements FieldGenerator --------------------------------------- |
| 54 void GeneratePrivateMembers(io::Printer* printer) const; | 54 void GeneratePrivateMembers(io::Printer* printer) const; |
| 55 void GenerateDependentAccessorDeclarations(io::Printer* printer) const; | 55 void GenerateDependentAccessorDeclarations(io::Printer* printer) const; |
| 56 void GenerateAccessorDeclarations(io::Printer* printer) const; | 56 void GenerateAccessorDeclarations(io::Printer* printer) const; |
| 57 void GenerateDependentInlineAccessorDefinitions(io::Printer* printer) const; | 57 void GenerateDependentInlineAccessorDefinitions(io::Printer* printer) const; |
| 58 void GenerateInlineAccessorDefinitions(io::Printer* printer, | 58 void GenerateInlineAccessorDefinitions(io::Printer* printer, |
| 59 bool is_inline) const; | 59 bool is_inline) const; |
| 60 void GenerateNonInlineAccessorDefinitions(io::Printer* printer) const; | 60 void GenerateNonInlineAccessorDefinitions(io::Printer* printer) const; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 76 const FieldDescriptor* descriptor_; | 76 const FieldDescriptor* descriptor_; |
| 77 const bool dependent_field_; | 77 const bool dependent_field_; |
| 78 map<string, string> variables_; | 78 map<string, string> variables_; |
| 79 | 79 |
| 80 private: | 80 private: |
| 81 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageFieldGenerator); | 81 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageFieldGenerator); |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 class MessageOneofFieldGenerator : public MessageFieldGenerator { | 84 class MessageOneofFieldGenerator : public MessageFieldGenerator { |
| 85 public: | 85 public: |
| 86 explicit MessageOneofFieldGenerator(const FieldDescriptor* descriptor, | 86 MessageOneofFieldGenerator(const FieldDescriptor* descriptor, |
| 87 const Options& options); | 87 const Options& options); |
| 88 ~MessageOneofFieldGenerator(); | 88 ~MessageOneofFieldGenerator(); |
| 89 | 89 |
| 90 // implements FieldGenerator --------------------------------------- | 90 // implements FieldGenerator --------------------------------------- |
| 91 void GenerateDependentAccessorDeclarations(io::Printer* printer) const; | 91 void GenerateDependentAccessorDeclarations(io::Printer* printer) const; |
| 92 void GenerateDependentInlineAccessorDefinitions(io::Printer* printer) const; | 92 void GenerateDependentInlineAccessorDefinitions(io::Printer* printer) const; |
| 93 void GenerateInlineAccessorDefinitions(io::Printer* printer, | 93 void GenerateInlineAccessorDefinitions(io::Printer* printer, |
| 94 bool is_inline) const; | 94 bool is_inline) const; |
| 95 void GenerateNonInlineAccessorDefinitions(io::Printer* printer) const; | 95 void GenerateNonInlineAccessorDefinitions(io::Printer* printer) const; |
| 96 void GenerateClearingCode(io::Printer* printer) const; | 96 void GenerateClearingCode(io::Printer* printer) const; |
| 97 void GenerateSwappingCode(io::Printer* printer) const; | 97 void GenerateSwappingCode(io::Printer* printer) const; |
| 98 void GenerateConstructorCode(io::Printer* printer) const; | 98 void GenerateConstructorCode(io::Printer* printer) const; |
| 99 | 99 |
| 100 protected: | 100 protected: |
| 101 void GenerateGetterDeclaration(io::Printer* printer) const; | 101 void GenerateGetterDeclaration(io::Printer* printer) const; |
| 102 | 102 |
| 103 private: | 103 private: |
| 104 void InternalGenerateInlineAccessorDefinitions( | 104 void InternalGenerateInlineAccessorDefinitions( |
| 105 const map<string, string>& variables, io::Printer* printer) const; | 105 const map<string, string>& variables, io::Printer* printer) const; |
| 106 | 106 |
| 107 const bool dependent_base_; | 107 const bool dependent_base_; |
| 108 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageOneofFieldGenerator); | 108 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageOneofFieldGenerator); |
| 109 }; | 109 }; |
| 110 | 110 |
| 111 class RepeatedMessageFieldGenerator : public FieldGenerator { | 111 class RepeatedMessageFieldGenerator : public FieldGenerator { |
| 112 public: | 112 public: |
| 113 explicit RepeatedMessageFieldGenerator(const FieldDescriptor* descriptor, | 113 RepeatedMessageFieldGenerator(const FieldDescriptor* descriptor, |
| 114 const Options& options); | 114 const Options& options); |
| 115 ~RepeatedMessageFieldGenerator(); | 115 ~RepeatedMessageFieldGenerator(); |
| 116 | 116 |
| 117 // implements FieldGenerator --------------------------------------- | 117 // implements FieldGenerator --------------------------------------- |
| 118 void GeneratePrivateMembers(io::Printer* printer) const; | 118 void GeneratePrivateMembers(io::Printer* printer) const; |
| 119 void GenerateDependentAccessorDeclarations(io::Printer* printer) const; | 119 void GenerateDependentAccessorDeclarations(io::Printer* printer) const; |
| 120 void GenerateAccessorDeclarations(io::Printer* printer) const; | 120 void GenerateAccessorDeclarations(io::Printer* printer) const; |
| 121 void GenerateDependentInlineAccessorDefinitions(io::Printer* printer) const; | 121 void GenerateDependentInlineAccessorDefinitions(io::Printer* printer) const; |
| 122 void GenerateInlineAccessorDefinitions(io::Printer* printer, | 122 void GenerateInlineAccessorDefinitions(io::Printer* printer, |
| 123 bool is_inline) const; | 123 bool is_inline) const; |
| 124 void GenerateClearingCode(io::Printer* printer) const; | 124 void GenerateClearingCode(io::Printer* printer) const; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 141 | 141 |
| 142 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedMessageFieldGenerator); | 142 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedMessageFieldGenerator); |
| 143 }; | 143 }; |
| 144 | 144 |
| 145 } // namespace cpp | 145 } // namespace cpp |
| 146 } // namespace compiler | 146 } // namespace compiler |
| 147 } // namespace protobuf | 147 } // namespace protobuf |
| 148 | 148 |
| 149 } // namespace google | 149 } // namespace google |
| 150 #endif // GOOGLE_PROTOBUF_COMPILER_CPP_MESSAGE_FIELD_H__ | 150 #endif // GOOGLE_PROTOBUF_COMPILER_CPP_MESSAGE_FIELD_H__ |
| OLD | NEW |