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 // Author: kenton@google.com (Kenton Varda)
0009 //  Based on original Protocol Buffers design by
0010 //  Sanjay Ghemawat, Jeff Dean, and others.
0011 
0012 #ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_EXTENSION_H__
0013 #define GOOGLE_PROTOBUF_COMPILER_JAVA_EXTENSION_H__
0014 
0015 #include <string>
0016 
0017 #include "absl/container/flat_hash_map.h"
0018 #include "google/protobuf/compiler/java/generator_factory.h"
0019 #include "google/protobuf/port.h"
0020 
0021 namespace google {
0022 namespace protobuf {
0023 class FieldDescriptor;  // descriptor.h
0024 namespace compiler {
0025 namespace java {
0026 class Context;            // context.h
0027 class ClassNameResolver;  // name_resolver.h
0028 }  // namespace java
0029 }  // namespace compiler
0030 namespace io {
0031 class Printer;  // printer.h
0032 }
0033 }  // namespace protobuf
0034 }  // namespace google
0035 
0036 namespace google {
0037 namespace protobuf {
0038 namespace compiler {
0039 namespace java {
0040 
0041 class ImmutableExtensionGenerator : public ExtensionGenerator {
0042  public:
0043   explicit ImmutableExtensionGenerator(const FieldDescriptor* descriptor,
0044                                        Context* context);
0045   ImmutableExtensionGenerator(const ImmutableExtensionGenerator&) = delete;
0046   ImmutableExtensionGenerator& operator=(const ImmutableExtensionGenerator&) =
0047       delete;
0048   ~ImmutableExtensionGenerator() override;
0049 
0050   void Generate(io::Printer* printer) override;
0051   int GenerateNonNestedInitializationCode(io::Printer* printer) override;
0052   int GenerateRegistrationCode(io::Printer* printer) override;
0053 
0054  protected:
0055   const FieldDescriptor* descriptor_;
0056   ClassNameResolver* name_resolver_;
0057   std::string scope_;
0058   Context* context_;
0059 };
0060 
0061 }  // namespace java
0062 }  // namespace compiler
0063 }  // namespace protobuf
0064 }  // namespace google
0065 
0066 #endif  // GOOGLE_PROTOBUF_COMPILER_JAVA_EXTENSION_H__