File indexing completed on 2025-01-31 10:11:59
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_MAP_FIELD_H__
0009 #define GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_MAP_FIELD_H__
0010
0011 #include <memory>
0012 #include <string>
0013
0014 #include "absl/container/btree_set.h"
0015 #include "absl/container/flat_hash_set.h"
0016 #include "google/protobuf/compiler/objectivec/field.h"
0017 #include "google/protobuf/compiler/objectivec/options.h"
0018 #include "google/protobuf/descriptor.h"
0019
0020 namespace google {
0021 namespace protobuf {
0022 namespace compiler {
0023 namespace objectivec {
0024
0025 class MapFieldGenerator : public RepeatedFieldGenerator {
0026 friend FieldGenerator* FieldGenerator::Make(
0027 const FieldDescriptor* field,
0028 const GenerationOptions& generation_options);
0029
0030 public:
0031 void EmitArrayComment(io::Printer* printer) const override;
0032
0033 MapFieldGenerator(const MapFieldGenerator&) = delete;
0034 MapFieldGenerator& operator=(const MapFieldGenerator&) = delete;
0035
0036 protected:
0037 MapFieldGenerator(const FieldDescriptor* descriptor,
0038 const GenerationOptions& generation_options);
0039 ~MapFieldGenerator() override = default;
0040
0041 void DetermineObjectiveCClassDefinitions(
0042 absl::btree_set<std::string>* fwd_decls) const override;
0043 void DetermineForwardDeclarations(absl::btree_set<std::string>* fwd_decls,
0044 bool include_external_types) const override;
0045 void DetermineNeededFiles(
0046 absl::flat_hash_set<const FileDescriptor*>* deps) const override;
0047
0048 private:
0049 std::unique_ptr<FieldGenerator> value_field_generator_;
0050 };
0051
0052 }
0053 }
0054 }
0055 }
0056
0057 #endif