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