File indexing completed on 2025-01-31 10:11:58
0001
0002
0003
0004
0005
0006
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
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 }
0053 }
0054 }
0055 }
0056
0057 #endif