Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 10:11:57

0001 // Protocol Buffers - Google's data interchange format
0002 // Copyright 2008 Google Inc.  All rights reserved.
0003 //
0004 // Use of this source code is governed by a BSD-style
0005 // license that can be found in the LICENSE file or at
0006 // https://developers.google.com/open-source/licenses/bsd
0007 
0008 #ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_WRAPPER_FIELD_H__
0009 #define GOOGLE_PROTOBUF_COMPILER_CSHARP_WRAPPER_FIELD_H__
0010 
0011 #include "google/protobuf/compiler/code_generator.h"
0012 #include "google/protobuf/compiler/csharp/csharp_field_base.h"
0013 
0014 namespace google {
0015 namespace protobuf {
0016 namespace compiler {
0017 namespace csharp {
0018 
0019 struct Options;
0020 
0021 class WrapperFieldGenerator : public FieldGeneratorBase {
0022  public:
0023   WrapperFieldGenerator(const FieldDescriptor* descriptor,
0024                         int presenceIndex,
0025                         const Options *options);
0026   ~WrapperFieldGenerator();
0027 
0028   WrapperFieldGenerator(const WrapperFieldGenerator&) = delete;
0029   WrapperFieldGenerator& operator=(const WrapperFieldGenerator&) = delete;
0030 
0031   virtual void GenerateCodecCode(io::Printer* printer) override;
0032   virtual void GenerateCloningCode(io::Printer* printer) override;
0033   virtual void GenerateMembers(io::Printer* printer) override;
0034   virtual void GenerateMergingCode(io::Printer* printer) override;
0035   virtual void GenerateParsingCode(io::Printer* printer) override;
0036   virtual void GenerateParsingCode(io::Printer* printer, bool use_parse_context) override;
0037   virtual void GenerateSerializationCode(io::Printer* printer) override;
0038   virtual void GenerateSerializationCode(io::Printer* printer, bool use_write_context) override;
0039   virtual void GenerateSerializedSizeCode(io::Printer* printer) override;
0040   virtual void GenerateExtensionCode(io::Printer* printer) override;
0041 
0042   virtual void WriteHash(io::Printer* printer) override;
0043   virtual void WriteEquals(io::Printer* printer) override;
0044   virtual void WriteToString(io::Printer* printer) override;
0045 
0046  private:
0047   bool is_value_type; // True for int32 etc; false for bytes and string
0048 };
0049 
0050 class WrapperOneofFieldGenerator : public WrapperFieldGenerator {
0051  public:
0052   WrapperOneofFieldGenerator(const FieldDescriptor* descriptor,
0053                              int presenceIndex,
0054                              const Options *options);
0055   ~WrapperOneofFieldGenerator();
0056 
0057   WrapperOneofFieldGenerator(const WrapperOneofFieldGenerator&) = delete;
0058   WrapperOneofFieldGenerator& operator=(const WrapperOneofFieldGenerator&) = delete;
0059 
0060   virtual void GenerateMembers(io::Printer* printer) override;
0061   virtual void GenerateMergingCode(io::Printer* printer) override;
0062   virtual void GenerateParsingCode(io::Printer* printer) override;
0063   virtual void GenerateParsingCode(io::Printer* printer, bool use_parse_context) override;
0064   virtual void GenerateSerializationCode(io::Printer* printer) override;
0065   virtual void GenerateSerializationCode(io::Printer* printer, bool use_write_context) override;
0066   virtual void GenerateSerializedSizeCode(io::Printer* printer) override;
0067 };
0068 
0069 }  // namespace csharp
0070 }  // namespace compiler
0071 }  // namespace protobuf
0072 }  // namespace google
0073 
0074 #endif  // GOOGLE_PROTOBUF_COMPILER_CSHARP_WRAPPER_FIELD_H__