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