GPBAny.pbobjc.m 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // NO CHECKED-IN PROTOBUF GENCODE
  3. // clang-format off
  4. // source: google/protobuf/any.proto
  5. #import "GPBProtocolBuffers_RuntimeSupport.h"
  6. #import "GPBWellKnownTypes.h"
  7. #import "GPBAny.pbobjc.h"
  8. #if GOOGLE_PROTOBUF_OBJC_VERSION < 30007
  9. #error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources.
  10. #endif
  11. #if 30007 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION
  12. #error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources.
  13. #endif
  14. // @@protoc_insertion_point(imports)
  15. #pragma clang diagnostic push
  16. #pragma clang diagnostic ignored "-Wdeprecated-declarations"
  17. #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension"
  18. #pragma mark - Objective-C Class declarations
  19. // Forward declarations of Objective-C classes that we can use as
  20. // static values in struct initializers.
  21. // We don't use [Foo class] because it is not a static value.
  22. GPBObjCClassDeclaration(GPBAny);
  23. #pragma mark - GPBAnyRoot
  24. @implementation GPBAnyRoot
  25. // No extensions in the file and no imports or none of the imports (direct or
  26. // indirect) defined extensions, so no need to generate +extensionRegistry.
  27. @end
  28. static GPBFileDescription GPBAnyRoot_FileDescription = {
  29. .package = "google.protobuf",
  30. .prefix = "GPB",
  31. .syntax = GPBFileSyntaxProto3
  32. };
  33. // This is to help make sure that the GPBWellKnownTypes.* categories get linked and
  34. // developers do not have to use the `-ObjC` linker flag. More information
  35. // here: https://medium.com/ios-os-x-development/categories-in-static-libraries-78e41f8ddb96
  36. __attribute__((used)) static NSString* any_importCategories(void) {
  37. return GPBWellKnownTypesErrorDomain;
  38. }
  39. #pragma mark - GPBAny
  40. @implementation GPBAny
  41. @dynamic typeURL;
  42. @dynamic value;
  43. typedef struct GPBAny__storage_ {
  44. uint32_t _has_storage_[1];
  45. NSString *typeURL;
  46. NSData *value;
  47. } GPBAny__storage_;
  48. // This method is threadsafe because it is initially called
  49. // in +initialize for each subclass.
  50. + (GPBDescriptor *)descriptor {
  51. static GPBDescriptor *descriptor = nil;
  52. if (!descriptor) {
  53. GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
  54. static GPBMessageFieldDescription fields[] = {
  55. {
  56. .name = "typeURL",
  57. .dataTypeSpecific.clazz = Nil,
  58. .number = GPBAny_FieldNumber_TypeURL,
  59. .hasIndex = 0,
  60. .offset = (uint32_t)offsetof(GPBAny__storage_, typeURL),
  61. .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldTextFormatNameCustom | GPBFieldClearHasIvarOnZero),
  62. .dataType = GPBDataTypeString,
  63. },
  64. {
  65. .name = "value",
  66. .dataTypeSpecific.clazz = Nil,
  67. .number = GPBAny_FieldNumber_Value,
  68. .hasIndex = 1,
  69. .offset = (uint32_t)offsetof(GPBAny__storage_, value),
  70. .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
  71. .dataType = GPBDataTypeBytes,
  72. },
  73. };
  74. GPBDescriptor *localDescriptor =
  75. [GPBDescriptor allocDescriptorForClass:GPBObjCClass(GPBAny)
  76. messageName:@"Any"
  77. fileDescription:&GPBAnyRoot_FileDescription
  78. fields:fields
  79. fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
  80. storageSize:sizeof(GPBAny__storage_)
  81. flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
  82. #if !GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS
  83. static const char *extraTextFormatInfo =
  84. "\001\001\004\241!!\000";
  85. [localDescriptor setupExtraTextInfo:extraTextFormatInfo];
  86. #endif // !GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS
  87. #if defined(DEBUG) && DEBUG
  88. NSAssert(descriptor == nil, @"Startup recursed!");
  89. #endif // DEBUG
  90. descriptor = localDescriptor;
  91. }
  92. return descriptor;
  93. }
  94. @end
  95. #pragma clang diagnostic pop
  96. // @@protoc_insertion_point(global_scope)
  97. // clang-format on