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 #ifndef GOOGLE_PROTOBUF_COMPILER_JAVA_MAP_FIELD_LITE_H__
0009 #define GOOGLE_PROTOBUF_COMPILER_JAVA_MAP_FIELD_LITE_H__
0010 
0011 #include <cstdint>
0012 #include <string>
0013 #include <vector>
0014 
0015 #include "absl/container/flat_hash_map.h"
0016 #include "absl/strings/string_view.h"
0017 #include "google/protobuf/compiler/java/context.h"
0018 #include "google/protobuf/compiler/java/lite/field_generator.h"
0019 #include "google/protobuf/descriptor.h"
0020 
0021 namespace google {
0022 namespace protobuf {
0023 namespace compiler {
0024 namespace java {
0025 
0026 class ImmutableMapFieldLiteGenerator : public ImmutableFieldLiteGenerator {
0027  public:
0028   explicit ImmutableMapFieldLiteGenerator(const FieldDescriptor* descriptor,
0029                                           int messageBitIndex,
0030                                           Context* context);
0031   ~ImmutableMapFieldLiteGenerator() override;
0032 
0033   // implements ImmutableFieldLiteGenerator ------------------------------------
0034   int GetNumBitsForMessage() const override;
0035   void GenerateInterfaceMembers(io::Printer* printer) const override;
0036   void GenerateMembers(io::Printer* printer) const override;
0037   void GenerateBuilderMembers(io::Printer* printer) const override;
0038   void GenerateInitializationCode(io::Printer* printer) const override;
0039   void GenerateFieldInfo(io::Printer* printer,
0040                          std::vector<uint16_t>* output) const override;
0041   void GenerateKotlinDslMembers(io::Printer* printer) const override;
0042 
0043   std::string GetBoxedType() const override;
0044 
0045  private:
0046   const FieldDescriptor* descriptor_;
0047   absl::flat_hash_map<absl::string_view, std::string> variables_;
0048   Context* context_;
0049   ClassNameResolver* name_resolver_;
0050 };
0051 
0052 }  // namespace java
0053 }  // namespace compiler
0054 }  // namespace protobuf
0055 }  // namespace google
0056 
0057 #endif  // GOOGLE_PROTOBUF_COMPILER_JAVA_MAP_FIELD_LITE_H__