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