Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! |
| 2 | // source: google/protobuf/struct.proto |
| 3 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 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/Struct.pbobjc.h> |
| 20 | #else |
| 21 | #import "google/protobuf/Struct.pbobjc.h" |
| 22 | #endif |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 23 | // @@protoc_insertion_point(imports) |
| 24 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 25 | #pragma clang diagnostic push |
| 26 | #pragma clang diagnostic ignored "-Wdeprecated-declarations" |
| 27 | #pragma clang diagnostic ignored "-Wdirect-ivar-access" |
| 28 | |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 29 | #pragma mark - GPBStructRoot |
| 30 | |
| 31 | @implementation GPBStructRoot |
| 32 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 33 | // No extensions in the file and no imports, so no need to generate |
| 34 | // +extensionRegistry. |
| 35 | |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 36 | @end |
| 37 | |
| 38 | #pragma mark - GPBStructRoot_FileDescriptor |
| 39 | |
| 40 | static GPBFileDescriptor *GPBStructRoot_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) { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 45 | GPB_DEBUG_CHECK_RUNTIME_VERSIONS(); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 46 | descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.protobuf" |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 47 | objcPrefix:@"GPB" |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 48 | syntax:GPBFileSyntaxProto3]; |
| 49 | } |
| 50 | return descriptor; |
| 51 | } |
| 52 | |
| 53 | #pragma mark - Enum GPBNullValue |
| 54 | |
| 55 | GPBEnumDescriptor *GPBNullValue_EnumDescriptor(void) { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 56 | static _Atomic(GPBEnumDescriptor*) descriptor = nil; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 57 | if (!descriptor) { |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 58 | static const char *valueNames = |
| 59 | "NullValue\000"; |
| 60 | static const int32_t values[] = { |
| 61 | GPBNullValue_NullValue, |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 62 | }; |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 63 | GPBEnumDescriptor *worker = |
| 64 | [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(GPBNullValue) |
| 65 | valueNames:valueNames |
| 66 | values:values |
| 67 | count:(uint32_t)(sizeof(values) / sizeof(int32_t)) |
| 68 | enumVerifier:GPBNullValue_IsValidValue]; |
| 69 | GPBEnumDescriptor *expected = nil; |
| 70 | if (!atomic_compare_exchange_strong(&descriptor, &expected, worker)) { |
| 71 | [worker release]; |
| 72 | } |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 73 | } |
| 74 | return descriptor; |
| 75 | } |
| 76 | |
| 77 | BOOL GPBNullValue_IsValidValue(int32_t value__) { |
| 78 | switch (value__) { |
| 79 | case GPBNullValue_NullValue: |
| 80 | return YES; |
| 81 | default: |
| 82 | return NO; |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | #pragma mark - GPBStruct |
| 87 | |
| 88 | @implementation GPBStruct |
| 89 | |
| 90 | @dynamic fields, fields_Count; |
| 91 | |
| 92 | typedef struct GPBStruct__storage_ { |
| 93 | uint32_t _has_storage_[1]; |
| 94 | NSMutableDictionary *fields; |
| 95 | } GPBStruct__storage_; |
| 96 | |
| 97 | // This method is threadsafe because it is initially called |
| 98 | // in +initialize for each subclass. |
| 99 | + (GPBDescriptor *)descriptor { |
| 100 | static GPBDescriptor *descriptor = nil; |
| 101 | if (!descriptor) { |
| 102 | static GPBMessageFieldDescription fields[] = { |
| 103 | { |
| 104 | .name = "fields", |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 105 | .dataTypeSpecific.className = GPBStringifySymbol(GPBValue), |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 106 | .number = GPBStruct_FieldNumber_Fields, |
| 107 | .hasIndex = GPBNoHasBit, |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 108 | .offset = (uint32_t)offsetof(GPBStruct__storage_, fields), |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 109 | .flags = GPBFieldMapKeyString, |
| 110 | .dataType = GPBDataTypeMessage, |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 111 | }, |
| 112 | }; |
| 113 | GPBDescriptor *localDescriptor = |
| 114 | [GPBDescriptor allocDescriptorForClass:[GPBStruct class] |
| 115 | rootClass:[GPBStructRoot class] |
| 116 | file:GPBStructRoot_FileDescriptor() |
| 117 | fields:fields |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 118 | fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 119 | storageSize:sizeof(GPBStruct__storage_) |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 120 | flags:GPBDescriptorInitializationFlag_None]; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 121 | NSAssert(descriptor == nil, @"Startup recursed!"); |
| 122 | descriptor = localDescriptor; |
| 123 | } |
| 124 | return descriptor; |
| 125 | } |
| 126 | |
| 127 | @end |
| 128 | |
| 129 | #pragma mark - GPBValue |
| 130 | |
| 131 | @implementation GPBValue |
| 132 | |
| 133 | @dynamic kindOneOfCase; |
| 134 | @dynamic nullValue; |
| 135 | @dynamic numberValue; |
| 136 | @dynamic stringValue; |
| 137 | @dynamic boolValue; |
| 138 | @dynamic structValue; |
| 139 | @dynamic listValue; |
| 140 | |
| 141 | typedef struct GPBValue__storage_ { |
| 142 | uint32_t _has_storage_[2]; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 143 | GPBNullValue nullValue; |
| 144 | NSString *stringValue; |
| 145 | GPBStruct *structValue; |
| 146 | GPBListValue *listValue; |
| 147 | double numberValue; |
| 148 | } GPBValue__storage_; |
| 149 | |
| 150 | // This method is threadsafe because it is initially called |
| 151 | // in +initialize for each subclass. |
| 152 | + (GPBDescriptor *)descriptor { |
| 153 | static GPBDescriptor *descriptor = nil; |
| 154 | if (!descriptor) { |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 155 | static GPBMessageFieldDescription fields[] = { |
| 156 | { |
| 157 | .name = "nullValue", |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 158 | .dataTypeSpecific.enumDescFunc = GPBNullValue_EnumDescriptor, |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 159 | .number = GPBValue_FieldNumber_NullValue, |
| 160 | .hasIndex = -1, |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 161 | .offset = (uint32_t)offsetof(GPBValue__storage_, nullValue), |
| 162 | .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor), |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 163 | .dataType = GPBDataTypeEnum, |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 164 | }, |
| 165 | { |
| 166 | .name = "numberValue", |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 167 | .dataTypeSpecific.className = NULL, |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 168 | .number = GPBValue_FieldNumber_NumberValue, |
| 169 | .hasIndex = -1, |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 170 | .offset = (uint32_t)offsetof(GPBValue__storage_, numberValue), |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 171 | .flags = GPBFieldOptional, |
| 172 | .dataType = GPBDataTypeDouble, |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 173 | }, |
| 174 | { |
| 175 | .name = "stringValue", |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 176 | .dataTypeSpecific.className = NULL, |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 177 | .number = GPBValue_FieldNumber_StringValue, |
| 178 | .hasIndex = -1, |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 179 | .offset = (uint32_t)offsetof(GPBValue__storage_, stringValue), |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 180 | .flags = GPBFieldOptional, |
| 181 | .dataType = GPBDataTypeString, |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 182 | }, |
| 183 | { |
| 184 | .name = "boolValue", |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 185 | .dataTypeSpecific.className = NULL, |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 186 | .number = GPBValue_FieldNumber_BoolValue, |
| 187 | .hasIndex = -1, |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 188 | .offset = 0, // Stored in _has_storage_ to save space. |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 189 | .flags = GPBFieldOptional, |
| 190 | .dataType = GPBDataTypeBool, |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 191 | }, |
| 192 | { |
| 193 | .name = "structValue", |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 194 | .dataTypeSpecific.className = GPBStringifySymbol(GPBStruct), |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 195 | .number = GPBValue_FieldNumber_StructValue, |
| 196 | .hasIndex = -1, |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 197 | .offset = (uint32_t)offsetof(GPBValue__storage_, structValue), |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 198 | .flags = GPBFieldOptional, |
| 199 | .dataType = GPBDataTypeMessage, |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 200 | }, |
| 201 | { |
| 202 | .name = "listValue", |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 203 | .dataTypeSpecific.className = GPBStringifySymbol(GPBListValue), |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 204 | .number = GPBValue_FieldNumber_ListValue, |
| 205 | .hasIndex = -1, |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 206 | .offset = (uint32_t)offsetof(GPBValue__storage_, listValue), |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 207 | .flags = GPBFieldOptional, |
| 208 | .dataType = GPBDataTypeMessage, |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 209 | }, |
| 210 | }; |
| 211 | GPBDescriptor *localDescriptor = |
| 212 | [GPBDescriptor allocDescriptorForClass:[GPBValue class] |
| 213 | rootClass:[GPBStructRoot class] |
| 214 | file:GPBStructRoot_FileDescriptor() |
| 215 | fields:fields |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 216 | fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 217 | storageSize:sizeof(GPBValue__storage_) |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 218 | flags:GPBDescriptorInitializationFlag_None]; |
| 219 | static const char *oneofs[] = { |
| 220 | "kind", |
| 221 | }; |
| 222 | [localDescriptor setupOneofs:oneofs |
| 223 | count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) |
| 224 | firstHasIndex:-1]; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 225 | NSAssert(descriptor == nil, @"Startup recursed!"); |
| 226 | descriptor = localDescriptor; |
| 227 | } |
| 228 | return descriptor; |
| 229 | } |
| 230 | |
| 231 | @end |
| 232 | |
| 233 | int32_t GPBValue_NullValue_RawValue(GPBValue *message) { |
| 234 | GPBDescriptor *descriptor = [GPBValue descriptor]; |
| 235 | GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBValue_FieldNumber_NullValue]; |
| 236 | return GPBGetMessageInt32Field(message, field); |
| 237 | } |
| 238 | |
| 239 | void SetGPBValue_NullValue_RawValue(GPBValue *message, int32_t value) { |
| 240 | GPBDescriptor *descriptor = [GPBValue descriptor]; |
| 241 | GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBValue_FieldNumber_NullValue]; |
| 242 | GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax); |
| 243 | } |
| 244 | |
| 245 | void GPBValue_ClearKindOneOfCase(GPBValue *message) { |
| 246 | GPBDescriptor *descriptor = [message descriptor]; |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 247 | GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; |
| 248 | GPBMaybeClearOneof(message, oneof, -1, 0); |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 249 | } |
| 250 | #pragma mark - GPBListValue |
| 251 | |
| 252 | @implementation GPBListValue |
| 253 | |
| 254 | @dynamic valuesArray, valuesArray_Count; |
| 255 | |
| 256 | typedef struct GPBListValue__storage_ { |
| 257 | uint32_t _has_storage_[1]; |
| 258 | NSMutableArray *valuesArray; |
| 259 | } GPBListValue__storage_; |
| 260 | |
| 261 | // This method is threadsafe because it is initially called |
| 262 | // in +initialize for each subclass. |
| 263 | + (GPBDescriptor *)descriptor { |
| 264 | static GPBDescriptor *descriptor = nil; |
| 265 | if (!descriptor) { |
| 266 | static GPBMessageFieldDescription fields[] = { |
| 267 | { |
| 268 | .name = "valuesArray", |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 269 | .dataTypeSpecific.className = GPBStringifySymbol(GPBValue), |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 270 | .number = GPBListValue_FieldNumber_ValuesArray, |
| 271 | .hasIndex = GPBNoHasBit, |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 272 | .offset = (uint32_t)offsetof(GPBListValue__storage_, valuesArray), |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 273 | .flags = GPBFieldRepeated, |
| 274 | .dataType = GPBDataTypeMessage, |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 275 | }, |
| 276 | }; |
| 277 | GPBDescriptor *localDescriptor = |
| 278 | [GPBDescriptor allocDescriptorForClass:[GPBListValue class] |
| 279 | rootClass:[GPBStructRoot class] |
| 280 | file:GPBStructRoot_FileDescriptor() |
| 281 | fields:fields |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 282 | fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 283 | storageSize:sizeof(GPBListValue__storage_) |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 284 | flags:GPBDescriptorInitializationFlag_None]; |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 285 | NSAssert(descriptor == nil, @"Startup recursed!"); |
| 286 | descriptor = localDescriptor; |
| 287 | } |
| 288 | return descriptor; |
| 289 | } |
| 290 | |
| 291 | @end |
| 292 | |
| 293 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 294 | #pragma clang diagnostic pop |
| 295 | |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 296 | // @@protoc_insertion_point(global_scope) |