GPBDuration.pbobjc.m 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: google/protobuf/duration.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/GPBDuration.pbobjc.h>
  15. #else
  16. #import "GPBDuration.pbobjc.h"
  17. #endif
  18. // @@protoc_insertion_point(imports)
  19. #pragma clang diagnostic push
  20. #pragma clang diagnostic ignored "-Wdeprecated-declarations"
  21. #pragma mark - GPBDurationRoot
  22. @implementation GPBDurationRoot
  23. // No extensions in the file and no imports, so no need to generate
  24. // +extensionRegistry.
  25. @end
  26. #pragma mark - GPBDurationRoot_FileDescriptor
  27. static GPBFileDescriptor *GPBDurationRoot_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 - GPBDuration
  40. @implementation GPBDuration
  41. @dynamic seconds;
  42. @dynamic nanos;
  43. typedef struct GPBDuration__storage_ {
  44. uint32_t _has_storage_[1];
  45. int32_t nanos;
  46. int64_t seconds;
  47. } GPBDuration__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 = "seconds",
  56. .dataTypeSpecific.clazz = Nil,
  57. .number = GPBDuration_FieldNumber_Seconds,
  58. .hasIndex = 0,
  59. .offset = (uint32_t)offsetof(GPBDuration__storage_, seconds),
  60. .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
  61. .dataType = GPBDataTypeInt64,
  62. },
  63. {
  64. .name = "nanos",
  65. .dataTypeSpecific.clazz = Nil,
  66. .number = GPBDuration_FieldNumber_Nanos,
  67. .hasIndex = 1,
  68. .offset = (uint32_t)offsetof(GPBDuration__storage_, nanos),
  69. .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
  70. .dataType = GPBDataTypeInt32,
  71. },
  72. };
  73. GPBDescriptor *localDescriptor =
  74. [GPBDescriptor allocDescriptorForClass:[GPBDuration class]
  75. rootClass:[GPBDurationRoot class]
  76. file:GPBDurationRoot_FileDescriptor()
  77. fields:fields
  78. fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
  79. storageSize:sizeof(GPBDuration__storage_)
  80. flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)];
  81. #if defined(DEBUG) && DEBUG
  82. NSAssert(descriptor == nil, @"Startup recursed!");
  83. #endif // DEBUG
  84. descriptor = localDescriptor;
  85. }
  86. return descriptor;
  87. }
  88. @end
  89. #pragma clang diagnostic pop
  90. // @@protoc_insertion_point(global_scope)