GPBAny.pbobjc.m 4.1 KB

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