• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Generated by the protocol buffer compiler.  DO NOT EDIT!
2// source: google/protobuf/type.proto
3
4// This CPP symbol can be defined to use imports that match up to the framework
5// imports needed when using CocoaPods.
6#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
7 #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
8#endif
9
10#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
11 #import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h>
12#else
13 #import "GPBProtocolBuffers_RuntimeSupport.h"
14#endif
15
16#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
17 #import <Protobuf/Type.pbobjc.h>
18 #import <Protobuf/Any.pbobjc.h>
19 #import <Protobuf/SourceContext.pbobjc.h>
20#else
21 #import "google/protobuf/Type.pbobjc.h"
22 #import "google/protobuf/Any.pbobjc.h"
23 #import "google/protobuf/SourceContext.pbobjc.h"
24#endif
25// @@protoc_insertion_point(imports)
26
27#pragma clang diagnostic push
28#pragma clang diagnostic ignored "-Wdeprecated-declarations"
29
30#pragma mark - GPBTypeRoot
31
32@implementation GPBTypeRoot
33
34+ (GPBExtensionRegistry*)extensionRegistry {
35  // This is called by +initialize so there is no need to worry
36  // about thread safety and initialization of registry.
37  static GPBExtensionRegistry* registry = nil;
38  if (!registry) {
39    GPBDebugCheckRuntimeVersion();
40    registry = [[GPBExtensionRegistry alloc] init];
41    [registry addExtensions:[GPBAnyRoot extensionRegistry]];
42    [registry addExtensions:[GPBSourceContextRoot extensionRegistry]];
43  }
44  return registry;
45}
46
47@end
48
49#pragma mark - GPBTypeRoot_FileDescriptor
50
51static GPBFileDescriptor *GPBTypeRoot_FileDescriptor(void) {
52  // This is called by +initialize so there is no need to worry
53  // about thread safety of the singleton.
54  static GPBFileDescriptor *descriptor = NULL;
55  if (!descriptor) {
56    GPBDebugCheckRuntimeVersion();
57    descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.protobuf"
58                                                     syntax:GPBFileSyntaxProto3];
59  }
60  return descriptor;
61}
62
63#pragma mark - Enum GPBSyntax
64
65GPBEnumDescriptor *GPBSyntax_EnumDescriptor(void) {
66  static GPBEnumDescriptor *descriptor = NULL;
67  if (!descriptor) {
68    static const char *valueNames =
69        "SyntaxProto2\000SyntaxProto3\000";
70    static const int32_t values[] = {
71        GPBSyntax_SyntaxProto2,
72        GPBSyntax_SyntaxProto3,
73    };
74    GPBEnumDescriptor *worker =
75        [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(GPBSyntax)
76                                       valueNames:valueNames
77                                           values:values
78                                            count:(uint32_t)(sizeof(values) / sizeof(int32_t))
79                                     enumVerifier:GPBSyntax_IsValidValue];
80    if (!OSAtomicCompareAndSwapPtrBarrier(nil, worker, (void * volatile *)&descriptor)) {
81      [worker release];
82    }
83  }
84  return descriptor;
85}
86
87BOOL GPBSyntax_IsValidValue(int32_t value__) {
88  switch (value__) {
89    case GPBSyntax_SyntaxProto2:
90    case GPBSyntax_SyntaxProto3:
91      return YES;
92    default:
93      return NO;
94  }
95}
96
97#pragma mark - GPBType
98
99@implementation GPBType
100
101@dynamic name;
102@dynamic fieldsArray, fieldsArray_Count;
103@dynamic oneofsArray, oneofsArray_Count;
104@dynamic optionsArray, optionsArray_Count;
105@dynamic hasSourceContext, sourceContext;
106@dynamic syntax;
107
108typedef struct GPBType__storage_ {
109  uint32_t _has_storage_[1];
110  GPBSyntax syntax;
111  NSString *name;
112  NSMutableArray *fieldsArray;
113  NSMutableArray *oneofsArray;
114  NSMutableArray *optionsArray;
115  GPBSourceContext *sourceContext;
116} GPBType__storage_;
117
118// This method is threadsafe because it is initially called
119// in +initialize for each subclass.
120+ (GPBDescriptor *)descriptor {
121  static GPBDescriptor *descriptor = nil;
122  if (!descriptor) {
123    static GPBMessageFieldDescription fields[] = {
124      {
125        .name = "name",
126        .dataTypeSpecific.className = NULL,
127        .number = GPBType_FieldNumber_Name,
128        .hasIndex = 0,
129        .offset = (uint32_t)offsetof(GPBType__storage_, name),
130        .flags = GPBFieldOptional,
131        .dataType = GPBDataTypeString,
132      },
133      {
134        .name = "fieldsArray",
135        .dataTypeSpecific.className = GPBStringifySymbol(GPBField),
136        .number = GPBType_FieldNumber_FieldsArray,
137        .hasIndex = GPBNoHasBit,
138        .offset = (uint32_t)offsetof(GPBType__storage_, fieldsArray),
139        .flags = GPBFieldRepeated,
140        .dataType = GPBDataTypeMessage,
141      },
142      {
143        .name = "oneofsArray",
144        .dataTypeSpecific.className = NULL,
145        .number = GPBType_FieldNumber_OneofsArray,
146        .hasIndex = GPBNoHasBit,
147        .offset = (uint32_t)offsetof(GPBType__storage_, oneofsArray),
148        .flags = GPBFieldRepeated,
149        .dataType = GPBDataTypeString,
150      },
151      {
152        .name = "optionsArray",
153        .dataTypeSpecific.className = GPBStringifySymbol(GPBOption),
154        .number = GPBType_FieldNumber_OptionsArray,
155        .hasIndex = GPBNoHasBit,
156        .offset = (uint32_t)offsetof(GPBType__storage_, optionsArray),
157        .flags = GPBFieldRepeated,
158        .dataType = GPBDataTypeMessage,
159      },
160      {
161        .name = "sourceContext",
162        .dataTypeSpecific.className = GPBStringifySymbol(GPBSourceContext),
163        .number = GPBType_FieldNumber_SourceContext,
164        .hasIndex = 1,
165        .offset = (uint32_t)offsetof(GPBType__storage_, sourceContext),
166        .flags = GPBFieldOptional,
167        .dataType = GPBDataTypeMessage,
168      },
169      {
170        .name = "syntax",
171        .dataTypeSpecific.enumDescFunc = GPBSyntax_EnumDescriptor,
172        .number = GPBType_FieldNumber_Syntax,
173        .hasIndex = 2,
174        .offset = (uint32_t)offsetof(GPBType__storage_, syntax),
175        .flags = GPBFieldOptional | GPBFieldHasEnumDescriptor,
176        .dataType = GPBDataTypeEnum,
177      },
178    };
179    GPBDescriptor *localDescriptor =
180        [GPBDescriptor allocDescriptorForClass:[GPBType class]
181                                     rootClass:[GPBTypeRoot class]
182                                          file:GPBTypeRoot_FileDescriptor()
183                                        fields:fields
184                                    fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
185                                   storageSize:sizeof(GPBType__storage_)
186                                         flags:0];
187    NSAssert(descriptor == nil, @"Startup recursed!");
188    descriptor = localDescriptor;
189  }
190  return descriptor;
191}
192
193@end
194
195int32_t GPBType_Syntax_RawValue(GPBType *message) {
196  GPBDescriptor *descriptor = [GPBType descriptor];
197  GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBType_FieldNumber_Syntax];
198  return GPBGetMessageInt32Field(message, field);
199}
200
201void SetGPBType_Syntax_RawValue(GPBType *message, int32_t value) {
202  GPBDescriptor *descriptor = [GPBType descriptor];
203  GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBType_FieldNumber_Syntax];
204  GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax);
205}
206
207#pragma mark - GPBField
208
209@implementation GPBField
210
211@dynamic kind;
212@dynamic cardinality;
213@dynamic number;
214@dynamic name;
215@dynamic typeURL;
216@dynamic oneofIndex;
217@dynamic packed;
218@dynamic optionsArray, optionsArray_Count;
219@dynamic jsonName;
220@dynamic defaultValue;
221
222typedef struct GPBField__storage_ {
223  uint32_t _has_storage_[1];
224  GPBField_Kind kind;
225  GPBField_Cardinality cardinality;
226  int32_t number;
227  int32_t oneofIndex;
228  NSString *name;
229  NSString *typeURL;
230  NSMutableArray *optionsArray;
231  NSString *jsonName;
232  NSString *defaultValue;
233} GPBField__storage_;
234
235// This method is threadsafe because it is initially called
236// in +initialize for each subclass.
237+ (GPBDescriptor *)descriptor {
238  static GPBDescriptor *descriptor = nil;
239  if (!descriptor) {
240    static GPBMessageFieldDescription fields[] = {
241      {
242        .name = "kind",
243        .dataTypeSpecific.enumDescFunc = GPBField_Kind_EnumDescriptor,
244        .number = GPBField_FieldNumber_Kind,
245        .hasIndex = 0,
246        .offset = (uint32_t)offsetof(GPBField__storage_, kind),
247        .flags = GPBFieldOptional | GPBFieldHasEnumDescriptor,
248        .dataType = GPBDataTypeEnum,
249      },
250      {
251        .name = "cardinality",
252        .dataTypeSpecific.enumDescFunc = GPBField_Cardinality_EnumDescriptor,
253        .number = GPBField_FieldNumber_Cardinality,
254        .hasIndex = 1,
255        .offset = (uint32_t)offsetof(GPBField__storage_, cardinality),
256        .flags = GPBFieldOptional | GPBFieldHasEnumDescriptor,
257        .dataType = GPBDataTypeEnum,
258      },
259      {
260        .name = "number",
261        .dataTypeSpecific.className = NULL,
262        .number = GPBField_FieldNumber_Number,
263        .hasIndex = 2,
264        .offset = (uint32_t)offsetof(GPBField__storage_, number),
265        .flags = GPBFieldOptional,
266        .dataType = GPBDataTypeInt32,
267      },
268      {
269        .name = "name",
270        .dataTypeSpecific.className = NULL,
271        .number = GPBField_FieldNumber_Name,
272        .hasIndex = 3,
273        .offset = (uint32_t)offsetof(GPBField__storage_, name),
274        .flags = GPBFieldOptional,
275        .dataType = GPBDataTypeString,
276      },
277      {
278        .name = "typeURL",
279        .dataTypeSpecific.className = NULL,
280        .number = GPBField_FieldNumber_TypeURL,
281        .hasIndex = 4,
282        .offset = (uint32_t)offsetof(GPBField__storage_, typeURL),
283        .flags = GPBFieldOptional | GPBFieldTextFormatNameCustom,
284        .dataType = GPBDataTypeString,
285      },
286      {
287        .name = "oneofIndex",
288        .dataTypeSpecific.className = NULL,
289        .number = GPBField_FieldNumber_OneofIndex,
290        .hasIndex = 5,
291        .offset = (uint32_t)offsetof(GPBField__storage_, oneofIndex),
292        .flags = GPBFieldOptional,
293        .dataType = GPBDataTypeInt32,
294      },
295      {
296        .name = "packed",
297        .dataTypeSpecific.className = NULL,
298        .number = GPBField_FieldNumber_Packed,
299        .hasIndex = 6,
300        .offset = 7,  // Stored in _has_storage_ to save space.
301        .flags = GPBFieldOptional,
302        .dataType = GPBDataTypeBool,
303      },
304      {
305        .name = "optionsArray",
306        .dataTypeSpecific.className = GPBStringifySymbol(GPBOption),
307        .number = GPBField_FieldNumber_OptionsArray,
308        .hasIndex = GPBNoHasBit,
309        .offset = (uint32_t)offsetof(GPBField__storage_, optionsArray),
310        .flags = GPBFieldRepeated,
311        .dataType = GPBDataTypeMessage,
312      },
313      {
314        .name = "jsonName",
315        .dataTypeSpecific.className = NULL,
316        .number = GPBField_FieldNumber_JsonName,
317        .hasIndex = 8,
318        .offset = (uint32_t)offsetof(GPBField__storage_, jsonName),
319        .flags = GPBFieldOptional,
320        .dataType = GPBDataTypeString,
321      },
322      {
323        .name = "defaultValue",
324        .dataTypeSpecific.className = NULL,
325        .number = GPBField_FieldNumber_DefaultValue,
326        .hasIndex = 9,
327        .offset = (uint32_t)offsetof(GPBField__storage_, defaultValue),
328        .flags = GPBFieldOptional,
329        .dataType = GPBDataTypeString,
330      },
331    };
332    GPBDescriptor *localDescriptor =
333        [GPBDescriptor allocDescriptorForClass:[GPBField class]
334                                     rootClass:[GPBTypeRoot class]
335                                          file:GPBTypeRoot_FileDescriptor()
336                                        fields:fields
337                                    fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
338                                   storageSize:sizeof(GPBField__storage_)
339                                         flags:0];
340#if !GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS
341    static const char *extraTextFormatInfo =
342        "\001\006\004\241!!\000";
343    [localDescriptor setupExtraTextInfo:extraTextFormatInfo];
344#endif  // !GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS
345    NSAssert(descriptor == nil, @"Startup recursed!");
346    descriptor = localDescriptor;
347  }
348  return descriptor;
349}
350
351@end
352
353int32_t GPBField_Kind_RawValue(GPBField *message) {
354  GPBDescriptor *descriptor = [GPBField descriptor];
355  GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBField_FieldNumber_Kind];
356  return GPBGetMessageInt32Field(message, field);
357}
358
359void SetGPBField_Kind_RawValue(GPBField *message, int32_t value) {
360  GPBDescriptor *descriptor = [GPBField descriptor];
361  GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBField_FieldNumber_Kind];
362  GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax);
363}
364
365int32_t GPBField_Cardinality_RawValue(GPBField *message) {
366  GPBDescriptor *descriptor = [GPBField descriptor];
367  GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBField_FieldNumber_Cardinality];
368  return GPBGetMessageInt32Field(message, field);
369}
370
371void SetGPBField_Cardinality_RawValue(GPBField *message, int32_t value) {
372  GPBDescriptor *descriptor = [GPBField descriptor];
373  GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBField_FieldNumber_Cardinality];
374  GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax);
375}
376
377#pragma mark - Enum GPBField_Kind
378
379GPBEnumDescriptor *GPBField_Kind_EnumDescriptor(void) {
380  static GPBEnumDescriptor *descriptor = NULL;
381  if (!descriptor) {
382    static const char *valueNames =
383        "TypeUnknown\000TypeDouble\000TypeFloat\000TypeInt"
384        "64\000TypeUint64\000TypeInt32\000TypeFixed64\000Type"
385        "Fixed32\000TypeBool\000TypeString\000TypeGroup\000Ty"
386        "peMessage\000TypeBytes\000TypeUint32\000TypeEnum\000"
387        "TypeSfixed32\000TypeSfixed64\000TypeSint32\000Typ"
388        "eSint64\000";
389    static const int32_t values[] = {
390        GPBField_Kind_TypeUnknown,
391        GPBField_Kind_TypeDouble,
392        GPBField_Kind_TypeFloat,
393        GPBField_Kind_TypeInt64,
394        GPBField_Kind_TypeUint64,
395        GPBField_Kind_TypeInt32,
396        GPBField_Kind_TypeFixed64,
397        GPBField_Kind_TypeFixed32,
398        GPBField_Kind_TypeBool,
399        GPBField_Kind_TypeString,
400        GPBField_Kind_TypeGroup,
401        GPBField_Kind_TypeMessage,
402        GPBField_Kind_TypeBytes,
403        GPBField_Kind_TypeUint32,
404        GPBField_Kind_TypeEnum,
405        GPBField_Kind_TypeSfixed32,
406        GPBField_Kind_TypeSfixed64,
407        GPBField_Kind_TypeSint32,
408        GPBField_Kind_TypeSint64,
409    };
410    GPBEnumDescriptor *worker =
411        [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(GPBField_Kind)
412                                       valueNames:valueNames
413                                           values:values
414                                            count:(uint32_t)(sizeof(values) / sizeof(int32_t))
415                                     enumVerifier:GPBField_Kind_IsValidValue];
416    if (!OSAtomicCompareAndSwapPtrBarrier(nil, worker, (void * volatile *)&descriptor)) {
417      [worker release];
418    }
419  }
420  return descriptor;
421}
422
423BOOL GPBField_Kind_IsValidValue(int32_t value__) {
424  switch (value__) {
425    case GPBField_Kind_TypeUnknown:
426    case GPBField_Kind_TypeDouble:
427    case GPBField_Kind_TypeFloat:
428    case GPBField_Kind_TypeInt64:
429    case GPBField_Kind_TypeUint64:
430    case GPBField_Kind_TypeInt32:
431    case GPBField_Kind_TypeFixed64:
432    case GPBField_Kind_TypeFixed32:
433    case GPBField_Kind_TypeBool:
434    case GPBField_Kind_TypeString:
435    case GPBField_Kind_TypeGroup:
436    case GPBField_Kind_TypeMessage:
437    case GPBField_Kind_TypeBytes:
438    case GPBField_Kind_TypeUint32:
439    case GPBField_Kind_TypeEnum:
440    case GPBField_Kind_TypeSfixed32:
441    case GPBField_Kind_TypeSfixed64:
442    case GPBField_Kind_TypeSint32:
443    case GPBField_Kind_TypeSint64:
444      return YES;
445    default:
446      return NO;
447  }
448}
449
450#pragma mark - Enum GPBField_Cardinality
451
452GPBEnumDescriptor *GPBField_Cardinality_EnumDescriptor(void) {
453  static GPBEnumDescriptor *descriptor = NULL;
454  if (!descriptor) {
455    static const char *valueNames =
456        "CardinalityUnknown\000CardinalityOptional\000C"
457        "ardinalityRequired\000CardinalityRepeated\000";
458    static const int32_t values[] = {
459        GPBField_Cardinality_CardinalityUnknown,
460        GPBField_Cardinality_CardinalityOptional,
461        GPBField_Cardinality_CardinalityRequired,
462        GPBField_Cardinality_CardinalityRepeated,
463    };
464    GPBEnumDescriptor *worker =
465        [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(GPBField_Cardinality)
466                                       valueNames:valueNames
467                                           values:values
468                                            count:(uint32_t)(sizeof(values) / sizeof(int32_t))
469                                     enumVerifier:GPBField_Cardinality_IsValidValue];
470    if (!OSAtomicCompareAndSwapPtrBarrier(nil, worker, (void * volatile *)&descriptor)) {
471      [worker release];
472    }
473  }
474  return descriptor;
475}
476
477BOOL GPBField_Cardinality_IsValidValue(int32_t value__) {
478  switch (value__) {
479    case GPBField_Cardinality_CardinalityUnknown:
480    case GPBField_Cardinality_CardinalityOptional:
481    case GPBField_Cardinality_CardinalityRequired:
482    case GPBField_Cardinality_CardinalityRepeated:
483      return YES;
484    default:
485      return NO;
486  }
487}
488
489#pragma mark - GPBEnum
490
491@implementation GPBEnum
492
493@dynamic name;
494@dynamic enumvalueArray, enumvalueArray_Count;
495@dynamic optionsArray, optionsArray_Count;
496@dynamic hasSourceContext, sourceContext;
497@dynamic syntax;
498
499typedef struct GPBEnum__storage_ {
500  uint32_t _has_storage_[1];
501  GPBSyntax syntax;
502  NSString *name;
503  NSMutableArray *enumvalueArray;
504  NSMutableArray *optionsArray;
505  GPBSourceContext *sourceContext;
506} GPBEnum__storage_;
507
508// This method is threadsafe because it is initially called
509// in +initialize for each subclass.
510+ (GPBDescriptor *)descriptor {
511  static GPBDescriptor *descriptor = nil;
512  if (!descriptor) {
513    static GPBMessageFieldDescription fields[] = {
514      {
515        .name = "name",
516        .dataTypeSpecific.className = NULL,
517        .number = GPBEnum_FieldNumber_Name,
518        .hasIndex = 0,
519        .offset = (uint32_t)offsetof(GPBEnum__storage_, name),
520        .flags = GPBFieldOptional,
521        .dataType = GPBDataTypeString,
522      },
523      {
524        .name = "enumvalueArray",
525        .dataTypeSpecific.className = GPBStringifySymbol(GPBEnumValue),
526        .number = GPBEnum_FieldNumber_EnumvalueArray,
527        .hasIndex = GPBNoHasBit,
528        .offset = (uint32_t)offsetof(GPBEnum__storage_, enumvalueArray),
529        .flags = GPBFieldRepeated,
530        .dataType = GPBDataTypeMessage,
531      },
532      {
533        .name = "optionsArray",
534        .dataTypeSpecific.className = GPBStringifySymbol(GPBOption),
535        .number = GPBEnum_FieldNumber_OptionsArray,
536        .hasIndex = GPBNoHasBit,
537        .offset = (uint32_t)offsetof(GPBEnum__storage_, optionsArray),
538        .flags = GPBFieldRepeated,
539        .dataType = GPBDataTypeMessage,
540      },
541      {
542        .name = "sourceContext",
543        .dataTypeSpecific.className = GPBStringifySymbol(GPBSourceContext),
544        .number = GPBEnum_FieldNumber_SourceContext,
545        .hasIndex = 1,
546        .offset = (uint32_t)offsetof(GPBEnum__storage_, sourceContext),
547        .flags = GPBFieldOptional,
548        .dataType = GPBDataTypeMessage,
549      },
550      {
551        .name = "syntax",
552        .dataTypeSpecific.enumDescFunc = GPBSyntax_EnumDescriptor,
553        .number = GPBEnum_FieldNumber_Syntax,
554        .hasIndex = 2,
555        .offset = (uint32_t)offsetof(GPBEnum__storage_, syntax),
556        .flags = GPBFieldOptional | GPBFieldHasEnumDescriptor,
557        .dataType = GPBDataTypeEnum,
558      },
559    };
560    GPBDescriptor *localDescriptor =
561        [GPBDescriptor allocDescriptorForClass:[GPBEnum class]
562                                     rootClass:[GPBTypeRoot class]
563                                          file:GPBTypeRoot_FileDescriptor()
564                                        fields:fields
565                                    fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
566                                   storageSize:sizeof(GPBEnum__storage_)
567                                         flags:0];
568    NSAssert(descriptor == nil, @"Startup recursed!");
569    descriptor = localDescriptor;
570  }
571  return descriptor;
572}
573
574@end
575
576int32_t GPBEnum_Syntax_RawValue(GPBEnum *message) {
577  GPBDescriptor *descriptor = [GPBEnum descriptor];
578  GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBEnum_FieldNumber_Syntax];
579  return GPBGetMessageInt32Field(message, field);
580}
581
582void SetGPBEnum_Syntax_RawValue(GPBEnum *message, int32_t value) {
583  GPBDescriptor *descriptor = [GPBEnum descriptor];
584  GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBEnum_FieldNumber_Syntax];
585  GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax);
586}
587
588#pragma mark - GPBEnumValue
589
590@implementation GPBEnumValue
591
592@dynamic name;
593@dynamic number;
594@dynamic optionsArray, optionsArray_Count;
595
596typedef struct GPBEnumValue__storage_ {
597  uint32_t _has_storage_[1];
598  int32_t number;
599  NSString *name;
600  NSMutableArray *optionsArray;
601} GPBEnumValue__storage_;
602
603// This method is threadsafe because it is initially called
604// in +initialize for each subclass.
605+ (GPBDescriptor *)descriptor {
606  static GPBDescriptor *descriptor = nil;
607  if (!descriptor) {
608    static GPBMessageFieldDescription fields[] = {
609      {
610        .name = "name",
611        .dataTypeSpecific.className = NULL,
612        .number = GPBEnumValue_FieldNumber_Name,
613        .hasIndex = 0,
614        .offset = (uint32_t)offsetof(GPBEnumValue__storage_, name),
615        .flags = GPBFieldOptional,
616        .dataType = GPBDataTypeString,
617      },
618      {
619        .name = "number",
620        .dataTypeSpecific.className = NULL,
621        .number = GPBEnumValue_FieldNumber_Number,
622        .hasIndex = 1,
623        .offset = (uint32_t)offsetof(GPBEnumValue__storage_, number),
624        .flags = GPBFieldOptional,
625        .dataType = GPBDataTypeInt32,
626      },
627      {
628        .name = "optionsArray",
629        .dataTypeSpecific.className = GPBStringifySymbol(GPBOption),
630        .number = GPBEnumValue_FieldNumber_OptionsArray,
631        .hasIndex = GPBNoHasBit,
632        .offset = (uint32_t)offsetof(GPBEnumValue__storage_, optionsArray),
633        .flags = GPBFieldRepeated,
634        .dataType = GPBDataTypeMessage,
635      },
636    };
637    GPBDescriptor *localDescriptor =
638        [GPBDescriptor allocDescriptorForClass:[GPBEnumValue class]
639                                     rootClass:[GPBTypeRoot class]
640                                          file:GPBTypeRoot_FileDescriptor()
641                                        fields:fields
642                                    fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
643                                   storageSize:sizeof(GPBEnumValue__storage_)
644                                         flags:0];
645    NSAssert(descriptor == nil, @"Startup recursed!");
646    descriptor = localDescriptor;
647  }
648  return descriptor;
649}
650
651@end
652
653#pragma mark - GPBOption
654
655@implementation GPBOption
656
657@dynamic name;
658@dynamic hasValue, value;
659
660typedef struct GPBOption__storage_ {
661  uint32_t _has_storage_[1];
662  NSString *name;
663  GPBAny *value;
664} GPBOption__storage_;
665
666// This method is threadsafe because it is initially called
667// in +initialize for each subclass.
668+ (GPBDescriptor *)descriptor {
669  static GPBDescriptor *descriptor = nil;
670  if (!descriptor) {
671    static GPBMessageFieldDescription fields[] = {
672      {
673        .name = "name",
674        .dataTypeSpecific.className = NULL,
675        .number = GPBOption_FieldNumber_Name,
676        .hasIndex = 0,
677        .offset = (uint32_t)offsetof(GPBOption__storage_, name),
678        .flags = GPBFieldOptional,
679        .dataType = GPBDataTypeString,
680      },
681      {
682        .name = "value",
683        .dataTypeSpecific.className = GPBStringifySymbol(GPBAny),
684        .number = GPBOption_FieldNumber_Value,
685        .hasIndex = 1,
686        .offset = (uint32_t)offsetof(GPBOption__storage_, value),
687        .flags = GPBFieldOptional,
688        .dataType = GPBDataTypeMessage,
689      },
690    };
691    GPBDescriptor *localDescriptor =
692        [GPBDescriptor allocDescriptorForClass:[GPBOption class]
693                                     rootClass:[GPBTypeRoot class]
694                                          file:GPBTypeRoot_FileDescriptor()
695                                        fields:fields
696                                    fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
697                                   storageSize:sizeof(GPBOption__storage_)
698                                         flags:0];
699    NSAssert(descriptor == nil, @"Startup recursed!");
700    descriptor = localDescriptor;
701  }
702  return descriptor;
703}
704
705@end
706
707
708#pragma clang diagnostic pop
709
710// @@protoc_insertion_point(global_scope)
711