Index: third_party/protobuf/src/google/protobuf/compiler/javanano/javanano_map_field.h |
diff --git a/third_party/protobuf/src/google/protobuf/compiler/java/java_extension.h b/third_party/protobuf/src/google/protobuf/compiler/javanano/javanano_map_field.h |
similarity index 63% |
copy from third_party/protobuf/src/google/protobuf/compiler/java/java_extension.h |
copy to third_party/protobuf/src/google/protobuf/compiler/javanano/javanano_map_field.h |
index 009ed9ffacaf207d4fb6322dca43697499b32991..c01bde3815017da7015a17d0b2ac3122136692bd 100644 |
--- a/third_party/protobuf/src/google/protobuf/compiler/java/java_extension.h |
+++ b/third_party/protobuf/src/google/protobuf/compiler/javanano/javanano_map_field.h |
@@ -28,50 +28,43 @@ |
// (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_JAVA_EXTENSION_H__ |
-#define GOOGLE_PROTOBUF_COMPILER_JAVA_EXTENSION_H__ |
+#ifndef GOOGLE_PROTOBUF_COMPILER_JAVANANO_MAP_FIELD_H__ |
+#define GOOGLE_PROTOBUF_COMPILER_JAVANANO_MAP_FIELD_H__ |
+#include <map> |
#include <string> |
- |
-#include <google/protobuf/stubs/common.h> |
+#include <vector> |
+#include <google/protobuf/compiler/javanano/javanano_field.h> |
namespace google { |
namespace protobuf { |
- class FieldDescriptor; // descriptor.h |
- namespace io { |
- class Printer; // printer.h |
- } |
-} |
- |
-namespace protobuf { |
namespace compiler { |
-namespace java { |
+namespace javanano { |
-// Generates code for an extension, which may be within the scope of some |
-// message or may be at file scope. This is much simpler than FieldGenerator |
-// since extensions are just simple identifiers with interesting types. |
-class ExtensionGenerator { |
+class MapFieldGenerator : public FieldGenerator { |
public: |
- explicit ExtensionGenerator(const FieldDescriptor* descriptor); |
- ~ExtensionGenerator(); |
+ explicit MapFieldGenerator( |
+ const FieldDescriptor* descriptor, const Params& params); |
+ ~MapFieldGenerator(); |
- void Generate(io::Printer* printer); |
- void GenerateNonNestedInitializationCode(io::Printer* printer); |
- void GenerateRegistrationCode(io::Printer* printer); |
+ // 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_; |
- string scope_; |
- GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ExtensionGenerator); |
+ map<string, string> variables_; |
+ |
+ GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MapFieldGenerator); |
}; |
-} // namespace java |
+} // namespace javanano |
} // namespace compiler |
} // namespace protobuf |
- |
} // namespace google |
-#endif // GOOGLE_PROTOBUF_COMPILER_JAVA_MESSAGE_H__ |
+#endif // GOOGLE_PROTOBUF_COMPILER_JAVANANO_MAP_FIELD_H__ |