Back to home page

EIC code displayed by LXR

 
 

    


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

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: dweis@google.com (Daniel Weis)
0009 //  Based on original Protocol Buffers design by
0010 //  Sanjay Ghemawat, Jeff Dean, and others.
0011 
0012 #ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_MESSAGE_BUILDER_LITE_H__
0013 #define GOOGLE_PROTOBUF_COMPILER_JAVA_MESSAGE_BUILDER_LITE_H__
0014 
0015 #include <string>
0016 
0017 #include "absl/container/btree_map.h"
0018 #include "google/protobuf/compiler/java/generator_common.h"
0019 #include "google/protobuf/compiler/java/lite/field_generator.h"
0020 
0021 namespace google {
0022 namespace protobuf {
0023 namespace compiler {
0024 namespace java {
0025 class Context;            // context.h
0026 class ClassNameResolver;  // name_resolver.h
0027 }  // namespace java
0028 }  // namespace compiler
0029 namespace io {
0030 class Printer;  // printer.h
0031 }
0032 }  // namespace protobuf
0033 }  // namespace google
0034 
0035 namespace google {
0036 namespace protobuf {
0037 namespace compiler {
0038 namespace java {
0039 
0040 class MessageBuilderLiteGenerator {
0041  public:
0042   explicit MessageBuilderLiteGenerator(const Descriptor* descriptor,
0043                                        Context* context);
0044   MessageBuilderLiteGenerator(const MessageBuilderLiteGenerator&) = delete;
0045   MessageBuilderLiteGenerator& operator=(const MessageBuilderLiteGenerator&) =
0046       delete;
0047   virtual ~MessageBuilderLiteGenerator();
0048 
0049   virtual void Generate(io::Printer* printer);
0050 
0051  private:
0052   void GenerateCommonBuilderMethods(io::Printer* printer);
0053 
0054   const Descriptor* descriptor_;
0055   Context* context_;
0056   ClassNameResolver* name_resolver_;
0057   FieldGeneratorMap<ImmutableFieldLiteGenerator> field_generators_;
0058   absl::btree_map<int, const OneofDescriptor*> oneofs_;
0059 };
0060 
0061 }  // namespace java
0062 }  // namespace compiler
0063 }  // namespace protobuf
0064 }  // namespace google
0065 
0066 #endif  // GOOGLE_PROTOBUF_COMPILER_JAVA_MESSAGE_BUILDER_LITE_H__