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_PRIMITIVE_FIELD_H__
0009 #define GOOGLE_PROTOBUF_COMPILER_CSHARP_PRIMITIVE_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 PrimitiveFieldGenerator : public FieldGeneratorBase {
0022  public:
0023   PrimitiveFieldGenerator(const FieldDescriptor* descriptor,
0024                           int presenceIndex,
0025                           const Options *options);
0026   ~PrimitiveFieldGenerator();
0027 
0028   PrimitiveFieldGenerator(const PrimitiveFieldGenerator&) = delete;
0029   PrimitiveFieldGenerator& operator=(const PrimitiveFieldGenerator&) = 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 GenerateSerializationCode(io::Printer* printer) override;
0037   virtual void GenerateSerializedSizeCode(io::Printer* printer) override;
0038   virtual void GenerateExtensionCode(io::Printer* printer) override;
0039 
0040   virtual void WriteHash(io::Printer* printer) override;
0041   virtual void WriteEquals(io::Printer* printer) override;
0042   virtual void WriteToString(io::Printer* printer) override;
0043 
0044  protected:
0045   bool is_value_type;
0046 };
0047 
0048 class PrimitiveOneofFieldGenerator : public PrimitiveFieldGenerator {
0049  public:
0050   PrimitiveOneofFieldGenerator(const FieldDescriptor* descriptor,
0051                                int presenceIndex,
0052                                const Options *options);
0053   ~PrimitiveOneofFieldGenerator();
0054 
0055   PrimitiveOneofFieldGenerator(const PrimitiveOneofFieldGenerator&) = delete;
0056   PrimitiveOneofFieldGenerator& operator=(const PrimitiveOneofFieldGenerator&) =
0057       delete;
0058 
0059   virtual void GenerateCloningCode(io::Printer* printer) override;
0060   virtual void GenerateMembers(io::Printer* printer) override;
0061   virtual void GenerateMergingCode(io::Printer* printer) override;
0062   virtual void WriteToString(io::Printer* printer) override;
0063   virtual void GenerateParsingCode(io::Printer* printer) override;
0064 };
0065 
0066 }  // namespace csharp
0067 }  // namespace compiler
0068 }  // namespace protobuf
0069 }  // namespace google
0070 
0071 #endif  // GOOGLE_PROTOBUF_COMPILER_CSHARP_PRIMITIVE_FIELD_H__
0072