GPBAny.pbobjc.m 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: google/protobuf/any.proto
  3. // This CPP symbol can be defined to use imports that match up to the framework
  4. // imports needed when using CocoaPods.
  5. #if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
  6. #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
  7. #endif
  8. #if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
  9. #import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h>
  10. #else
  11. #import "GPBProtocolBuffers_RuntimeSupport.h"
  12. #endif
  13. #if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
  14. #import <Protobuf/GPBAny.pbobjc.h>
  15. #else
  16. #import "GPBAny.pbobjc.h"
  17. #endif
  18. // @@protoc_insertion_point(imports)
  19. #pragma clang diagnostic push
  20. #pragma clang diagnostic ignored "-Wdeprecated-declarations"
  21. #pragma mark - GPBAnyRoot
  22. @implementation GPBAnyRoot
  23. // No extensions in the file and no imports, so no need to generate
  24. // +extensionRegistry.
  25. @end
  26. #pragma mark - GPBAnyRoot_FileDescriptor
  27. static GPBFileDescriptor *GPBAnyRoot_FileDescriptor(void) {
  28. // This is called by +initialize so there is no need to worry
  29. // about thread safety of the singleton.
  30. static GPBFileDescriptor *descriptor = NULL;
  31. if (!descriptor) {
  32. GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
  33. descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.protobuf"
  34. objcPrefix:@"GPB"
  35. syntax:GPBFileSyntaxProto3];
  36. }
  37. return descriptor;
  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. 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:[GPBAny class]
  75. rootClass:[GPBAnyRoot class]
  76. file:GPBAnyRoot_FileDescriptor()
  77. fields:fields
  78. fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
  79. storageSize:sizeof(GPBAny__storage_)
  80. flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)];
  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)