GPBApi.pbobjc.m 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: google/protobuf/api.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/GPBApi.pbobjc.h>
  15. #import <Protobuf/GPBSourceContext.pbobjc.h>
  16. #import <Protobuf/GPBType.pbobjc.h>
  17. #else
  18. #import "GPBApi.pbobjc.h"
  19. #import "GPBSourceContext.pbobjc.h"
  20. #import "GPBType.pbobjc.h"
  21. #endif
  22. // @@protoc_insertion_point(imports)
  23. #pragma clang diagnostic push
  24. #pragma clang diagnostic ignored "-Wdeprecated-declarations"
  25. #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension"
  26. #pragma mark - Objective C Class declarations
  27. // Forward declarations of Objective C classes that we can use as
  28. // static values in struct initializers.
  29. // We don't use [Foo class] because it is not a static value.
  30. GPBObjCClassDeclaration(GPBMethod);
  31. GPBObjCClassDeclaration(GPBMixin);
  32. GPBObjCClassDeclaration(GPBOption);
  33. GPBObjCClassDeclaration(GPBSourceContext);
  34. #pragma mark - GPBApiRoot
  35. @implementation GPBApiRoot
  36. // No extensions in the file and none of the imports (direct or indirect)
  37. // defined extensions, so no need to generate +extensionRegistry.
  38. @end
  39. #pragma mark - GPBApiRoot_FileDescriptor
  40. static GPBFileDescriptor *GPBApiRoot_FileDescriptor(void) {
  41. // This is called by +initialize so there is no need to worry
  42. // about thread safety of the singleton.
  43. static GPBFileDescriptor *descriptor = NULL;
  44. if (!descriptor) {
  45. GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
  46. descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.protobuf"
  47. objcPrefix:@"GPB"
  48. syntax:GPBFileSyntaxProto3];
  49. }
  50. return descriptor;
  51. }
  52. #pragma mark - GPBApi
  53. @implementation GPBApi
  54. @dynamic name;
  55. @dynamic methodsArray, methodsArray_Count;
  56. @dynamic optionsArray, optionsArray_Count;
  57. @dynamic version;
  58. @dynamic hasSourceContext, sourceContext;
  59. @dynamic mixinsArray, mixinsArray_Count;
  60. @dynamic syntax;
  61. typedef struct GPBApi__storage_ {
  62. uint32_t _has_storage_[1];
  63. GPBSyntax syntax;
  64. NSString *name;
  65. NSMutableArray *methodsArray;
  66. NSMutableArray *optionsArray;
  67. NSString *version;
  68. GPBSourceContext *sourceContext;
  69. NSMutableArray *mixinsArray;
  70. } GPBApi__storage_;
  71. // This method is threadsafe because it is initially called
  72. // in +initialize for each subclass.
  73. + (GPBDescriptor *)descriptor {
  74. static GPBDescriptor *descriptor = nil;
  75. if (!descriptor) {
  76. static GPBMessageFieldDescription fields[] = {
  77. {
  78. .name = "name",
  79. .dataTypeSpecific.clazz = Nil,
  80. .number = GPBApi_FieldNumber_Name,
  81. .hasIndex = 0,
  82. .offset = (uint32_t)offsetof(GPBApi__storage_, name),
  83. .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
  84. .dataType = GPBDataTypeString,
  85. },
  86. {
  87. .name = "methodsArray",
  88. .dataTypeSpecific.clazz = GPBObjCClass(GPBMethod),
  89. .number = GPBApi_FieldNumber_MethodsArray,
  90. .hasIndex = GPBNoHasBit,
  91. .offset = (uint32_t)offsetof(GPBApi__storage_, methodsArray),
  92. .flags = GPBFieldRepeated,
  93. .dataType = GPBDataTypeMessage,
  94. },
  95. {
  96. .name = "optionsArray",
  97. .dataTypeSpecific.clazz = GPBObjCClass(GPBOption),
  98. .number = GPBApi_FieldNumber_OptionsArray,
  99. .hasIndex = GPBNoHasBit,
  100. .offset = (uint32_t)offsetof(GPBApi__storage_, optionsArray),
  101. .flags = GPBFieldRepeated,
  102. .dataType = GPBDataTypeMessage,
  103. },
  104. {
  105. .name = "version",
  106. .dataTypeSpecific.clazz = Nil,
  107. .number = GPBApi_FieldNumber_Version,
  108. .hasIndex = 1,
  109. .offset = (uint32_t)offsetof(GPBApi__storage_, version),
  110. .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
  111. .dataType = GPBDataTypeString,
  112. },
  113. {
  114. .name = "sourceContext",
  115. .dataTypeSpecific.clazz = GPBObjCClass(GPBSourceContext),
  116. .number = GPBApi_FieldNumber_SourceContext,
  117. .hasIndex = 2,
  118. .offset = (uint32_t)offsetof(GPBApi__storage_, sourceContext),
  119. .flags = GPBFieldOptional,
  120. .dataType = GPBDataTypeMessage,
  121. },
  122. {
  123. .name = "mixinsArray",
  124. .dataTypeSpecific.clazz = GPBObjCClass(GPBMixin),
  125. .number = GPBApi_FieldNumber_MixinsArray,
  126. .hasIndex = GPBNoHasBit,
  127. .offset = (uint32_t)offsetof(GPBApi__storage_, mixinsArray),
  128. .flags = GPBFieldRepeated,
  129. .dataType = GPBDataTypeMessage,
  130. },
  131. {
  132. .name = "syntax",
  133. .dataTypeSpecific.enumDescFunc = GPBSyntax_EnumDescriptor,
  134. .number = GPBApi_FieldNumber_Syntax,
  135. .hasIndex = 3,
  136. .offset = (uint32_t)offsetof(GPBApi__storage_, syntax),
  137. .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor | GPBFieldClearHasIvarOnZero),
  138. .dataType = GPBDataTypeEnum,
  139. },
  140. };
  141. GPBDescriptor *localDescriptor =
  142. [GPBDescriptor allocDescriptorForClass:[GPBApi class]
  143. rootClass:[GPBApiRoot class]
  144. file:GPBApiRoot_FileDescriptor()
  145. fields:fields
  146. fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
  147. storageSize:sizeof(GPBApi__storage_)
  148. flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)];
  149. #if defined(DEBUG) && DEBUG
  150. NSAssert(descriptor == nil, @"Startup recursed!");
  151. #endif // DEBUG
  152. descriptor = localDescriptor;
  153. }
  154. return descriptor;
  155. }
  156. @end
  157. int32_t GPBApi_Syntax_RawValue(GPBApi *message) {
  158. GPBDescriptor *descriptor = [GPBApi descriptor];
  159. GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBApi_FieldNumber_Syntax];
  160. return GPBGetMessageRawEnumField(message, field);
  161. }
  162. void SetGPBApi_Syntax_RawValue(GPBApi *message, int32_t value) {
  163. GPBDescriptor *descriptor = [GPBApi descriptor];
  164. GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBApi_FieldNumber_Syntax];
  165. GPBSetMessageRawEnumField(message, field, value);
  166. }
  167. #pragma mark - GPBMethod
  168. @implementation GPBMethod
  169. @dynamic name;
  170. @dynamic requestTypeURL;
  171. @dynamic requestStreaming;
  172. @dynamic responseTypeURL;
  173. @dynamic responseStreaming;
  174. @dynamic optionsArray, optionsArray_Count;
  175. @dynamic syntax;
  176. typedef struct GPBMethod__storage_ {
  177. uint32_t _has_storage_[1];
  178. GPBSyntax syntax;
  179. NSString *name;
  180. NSString *requestTypeURL;
  181. NSString *responseTypeURL;
  182. NSMutableArray *optionsArray;
  183. } GPBMethod__storage_;
  184. // This method is threadsafe because it is initially called
  185. // in +initialize for each subclass.
  186. + (GPBDescriptor *)descriptor {
  187. static GPBDescriptor *descriptor = nil;
  188. if (!descriptor) {
  189. static GPBMessageFieldDescription fields[] = {
  190. {
  191. .name = "name",
  192. .dataTypeSpecific.clazz = Nil,
  193. .number = GPBMethod_FieldNumber_Name,
  194. .hasIndex = 0,
  195. .offset = (uint32_t)offsetof(GPBMethod__storage_, name),
  196. .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
  197. .dataType = GPBDataTypeString,
  198. },
  199. {
  200. .name = "requestTypeURL",
  201. .dataTypeSpecific.clazz = Nil,
  202. .number = GPBMethod_FieldNumber_RequestTypeURL,
  203. .hasIndex = 1,
  204. .offset = (uint32_t)offsetof(GPBMethod__storage_, requestTypeURL),
  205. .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldTextFormatNameCustom | GPBFieldClearHasIvarOnZero),
  206. .dataType = GPBDataTypeString,
  207. },
  208. {
  209. .name = "requestStreaming",
  210. .dataTypeSpecific.clazz = Nil,
  211. .number = GPBMethod_FieldNumber_RequestStreaming,
  212. .hasIndex = 2,
  213. .offset = 3, // Stored in _has_storage_ to save space.
  214. .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
  215. .dataType = GPBDataTypeBool,
  216. },
  217. {
  218. .name = "responseTypeURL",
  219. .dataTypeSpecific.clazz = Nil,
  220. .number = GPBMethod_FieldNumber_ResponseTypeURL,
  221. .hasIndex = 4,
  222. .offset = (uint32_t)offsetof(GPBMethod__storage_, responseTypeURL),
  223. .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldTextFormatNameCustom | GPBFieldClearHasIvarOnZero),
  224. .dataType = GPBDataTypeString,
  225. },
  226. {
  227. .name = "responseStreaming",
  228. .dataTypeSpecific.clazz = Nil,
  229. .number = GPBMethod_FieldNumber_ResponseStreaming,
  230. .hasIndex = 5,
  231. .offset = 6, // Stored in _has_storage_ to save space.
  232. .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
  233. .dataType = GPBDataTypeBool,
  234. },
  235. {
  236. .name = "optionsArray",
  237. .dataTypeSpecific.clazz = GPBObjCClass(GPBOption),
  238. .number = GPBMethod_FieldNumber_OptionsArray,
  239. .hasIndex = GPBNoHasBit,
  240. .offset = (uint32_t)offsetof(GPBMethod__storage_, optionsArray),
  241. .flags = GPBFieldRepeated,
  242. .dataType = GPBDataTypeMessage,
  243. },
  244. {
  245. .name = "syntax",
  246. .dataTypeSpecific.enumDescFunc = GPBSyntax_EnumDescriptor,
  247. .number = GPBMethod_FieldNumber_Syntax,
  248. .hasIndex = 7,
  249. .offset = (uint32_t)offsetof(GPBMethod__storage_, syntax),
  250. .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor | GPBFieldClearHasIvarOnZero),
  251. .dataType = GPBDataTypeEnum,
  252. },
  253. };
  254. GPBDescriptor *localDescriptor =
  255. [GPBDescriptor allocDescriptorForClass:[GPBMethod class]
  256. rootClass:[GPBApiRoot class]
  257. file:GPBApiRoot_FileDescriptor()
  258. fields:fields
  259. fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
  260. storageSize:sizeof(GPBMethod__storage_)
  261. flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)];
  262. #if !GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS
  263. static const char *extraTextFormatInfo =
  264. "\002\002\007\244\241!!\000\004\010\244\241!!\000";
  265. [localDescriptor setupExtraTextInfo:extraTextFormatInfo];
  266. #endif // !GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS
  267. #if defined(DEBUG) && DEBUG
  268. NSAssert(descriptor == nil, @"Startup recursed!");
  269. #endif // DEBUG
  270. descriptor = localDescriptor;
  271. }
  272. return descriptor;
  273. }
  274. @end
  275. int32_t GPBMethod_Syntax_RawValue(GPBMethod *message) {
  276. GPBDescriptor *descriptor = [GPBMethod descriptor];
  277. GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBMethod_FieldNumber_Syntax];
  278. return GPBGetMessageRawEnumField(message, field);
  279. }
  280. void SetGPBMethod_Syntax_RawValue(GPBMethod *message, int32_t value) {
  281. GPBDescriptor *descriptor = [GPBMethod descriptor];
  282. GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBMethod_FieldNumber_Syntax];
  283. GPBSetMessageRawEnumField(message, field, value);
  284. }
  285. #pragma mark - GPBMixin
  286. @implementation GPBMixin
  287. @dynamic name;
  288. @dynamic root;
  289. typedef struct GPBMixin__storage_ {
  290. uint32_t _has_storage_[1];
  291. NSString *name;
  292. NSString *root;
  293. } GPBMixin__storage_;
  294. // This method is threadsafe because it is initially called
  295. // in +initialize for each subclass.
  296. + (GPBDescriptor *)descriptor {
  297. static GPBDescriptor *descriptor = nil;
  298. if (!descriptor) {
  299. static GPBMessageFieldDescription fields[] = {
  300. {
  301. .name = "name",
  302. .dataTypeSpecific.clazz = Nil,
  303. .number = GPBMixin_FieldNumber_Name,
  304. .hasIndex = 0,
  305. .offset = (uint32_t)offsetof(GPBMixin__storage_, name),
  306. .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
  307. .dataType = GPBDataTypeString,
  308. },
  309. {
  310. .name = "root",
  311. .dataTypeSpecific.clazz = Nil,
  312. .number = GPBMixin_FieldNumber_Root,
  313. .hasIndex = 1,
  314. .offset = (uint32_t)offsetof(GPBMixin__storage_, root),
  315. .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
  316. .dataType = GPBDataTypeString,
  317. },
  318. };
  319. GPBDescriptor *localDescriptor =
  320. [GPBDescriptor allocDescriptorForClass:[GPBMixin class]
  321. rootClass:[GPBApiRoot class]
  322. file:GPBApiRoot_FileDescriptor()
  323. fields:fields
  324. fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
  325. storageSize:sizeof(GPBMixin__storage_)
  326. flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)];
  327. #if defined(DEBUG) && DEBUG
  328. NSAssert(descriptor == nil, @"Startup recursed!");
  329. #endif // DEBUG
  330. descriptor = localDescriptor;
  331. }
  332. return descriptor;
  333. }
  334. @end
  335. #pragma clang diagnostic pop
  336. // @@protoc_insertion_point(global_scope)