Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! |
| 2 | // source: google/protobuf/struct.proto |
| 3 | |
Thomas Van Lenten | 7da023b | 2016-05-09 13:53:20 -0400 | [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 |
Thomas Van Lenten | 56c48ae | 2020-01-22 15:50:52 -0500 | [diff] [blame] | 11 | #import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h> |
Thomas Van Lenten | 7da023b | 2016-05-09 13:53:20 -0400 | [diff] [blame] | 12 | #else |
| 13 | #import "GPBProtocolBuffers_RuntimeSupport.h" |
| 14 | #endif |
| 15 | |
Thomas Van Lenten | 3e1587f | 2018-01-23 13:38:28 -0500 | [diff] [blame] | 16 | #import <stdatomic.h> |
| 17 | |
Thomas Van Lenten | 7da023b | 2016-05-09 13:53:20 -0400 | [diff] [blame] | 18 | #if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS |
Thomas Van Lenten | 56c48ae | 2020-01-22 15:50:52 -0500 | [diff] [blame] | 19 | #import <Protobuf/GPBStruct.pbobjc.h> |
Thomas Van Lenten | 7da023b | 2016-05-09 13:53:20 -0400 | [diff] [blame] | 20 | #else |
Thomas Van Lenten | 56c48ae | 2020-01-22 15:50:52 -0500 | [diff] [blame] | 21 | #import "GPBStruct.pbobjc.h" |
Thomas Van Lenten | 7da023b | 2016-05-09 13:53:20 -0400 | [diff] [blame] | 22 | #endif |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 23 | // @@protoc_insertion_point(imports) |
| 24 | |
Thomas Van Lenten | e664aa6 | 2016-04-19 13:13:04 -0400 | [diff] [blame] | 25 | #pragma clang diagnostic push |
| 26 | #pragma clang diagnostic ignored "-Wdeprecated-declarations" |
Thomas Van Lenten | c8a440d | 2016-05-25 13:46:00 -0400 | [diff] [blame] | 27 | #pragma clang diagnostic ignored "-Wdirect-ivar-access" |
Dave MacLachlan | 74956e1 | 2019-12-17 17:32:09 -0800 | [diff] [blame] | 28 | #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" |
| 29 | |
Dave MacLachlan | aa1d7e7 | 2020-01-19 17:46:35 -0800 | [diff] [blame] | 30 | #pragma mark - Objective C Class declarations |
| 31 | // Forward declarations of Objective C classes that we can use as |
| 32 | // static values in struct initializers. |
| 33 | // We don't use [Foo class] because it is not a static value. |
| 34 | GPBObjCClassDeclaration(GPBListValue); |
| 35 | GPBObjCClassDeclaration(GPBStruct); |
| 36 | GPBObjCClassDeclaration(GPBValue); |
Thomas Van Lenten | e664aa6 | 2016-04-19 13:13:04 -0400 | [diff] [blame] | 37 | |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 38 | #pragma mark - GPBStructRoot |
| 39 | |
| 40 | @implementation GPBStructRoot |
| 41 | |
Thomas Van Lenten | 13a4124 | 2016-09-01 11:45:50 -0400 | [diff] [blame] | 42 | // No extensions in the file and no imports, so no need to generate |
| 43 | // +extensionRegistry. |
| 44 | |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 45 | @end |
| 46 | |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 47 | #pragma mark - GPBStructRoot_FileDescriptor |
| 48 | |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 49 | static GPBFileDescriptor *GPBStructRoot_FileDescriptor(void) { |
| 50 | // This is called by +initialize so there is no need to worry |
| 51 | // about thread safety of the singleton. |
| 52 | static GPBFileDescriptor *descriptor = NULL; |
| 53 | if (!descriptor) { |
Thomas Van Lenten | 1aa6500 | 2016-09-15 13:27:17 -0400 | [diff] [blame] | 54 | GPB_DEBUG_CHECK_RUNTIME_VERSIONS(); |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 55 | descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.protobuf" |
Thomas Van Lenten | 337ec30 | 2016-08-16 11:26:49 -0400 | [diff] [blame] | 56 | objcPrefix:@"GPB" |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 57 | syntax:GPBFileSyntaxProto3]; |
| 58 | } |
| 59 | return descriptor; |
| 60 | } |
| 61 | |
| 62 | #pragma mark - Enum GPBNullValue |
| 63 | |
| 64 | GPBEnumDescriptor *GPBNullValue_EnumDescriptor(void) { |
Thomas Van Lenten | d83837d | 2018-01-31 13:58:11 -0500 | [diff] [blame] | 65 | static _Atomic(GPBEnumDescriptor*) descriptor = nil; |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 66 | if (!descriptor) { |
Thomas Van Lenten | 79a23c4 | 2016-03-17 10:04:21 -0400 | [diff] [blame] | 67 | static const char *valueNames = |
| 68 | "NullValue\000"; |
| 69 | static const int32_t values[] = { |
| 70 | GPBNullValue_NullValue, |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 71 | }; |
Thomas Van Lenten | 79a23c4 | 2016-03-17 10:04:21 -0400 | [diff] [blame] | 72 | GPBEnumDescriptor *worker = |
| 73 | [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(GPBNullValue) |
| 74 | valueNames:valueNames |
| 75 | values:values |
| 76 | count:(uint32_t)(sizeof(values) / sizeof(int32_t)) |
| 77 | enumVerifier:GPBNullValue_IsValidValue]; |
Jonathan Dierksen | a721bf6 | 2018-01-22 13:26:39 -0800 | [diff] [blame] | 78 | GPBEnumDescriptor *expected = nil; |
| 79 | if (!atomic_compare_exchange_strong(&descriptor, &expected, worker)) { |
Thomas Van Lenten | 79a23c4 | 2016-03-17 10:04:21 -0400 | [diff] [blame] | 80 | [worker release]; |
| 81 | } |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 82 | } |
| 83 | return descriptor; |
| 84 | } |
| 85 | |
| 86 | BOOL GPBNullValue_IsValidValue(int32_t value__) { |
| 87 | switch (value__) { |
| 88 | case GPBNullValue_NullValue: |
| 89 | return YES; |
| 90 | default: |
| 91 | return NO; |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | #pragma mark - GPBStruct |
| 96 | |
| 97 | @implementation GPBStruct |
| 98 | |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 99 | @dynamic fields, fields_Count; |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 100 | |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 101 | typedef struct GPBStruct__storage_ { |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 102 | uint32_t _has_storage_[1]; |
| 103 | NSMutableDictionary *fields; |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 104 | } GPBStruct__storage_; |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 105 | |
| 106 | // This method is threadsafe because it is initially called |
| 107 | // in +initialize for each subclass. |
| 108 | + (GPBDescriptor *)descriptor { |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 109 | static GPBDescriptor *descriptor = nil; |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 110 | if (!descriptor) { |
| 111 | static GPBMessageFieldDescription fields[] = { |
| 112 | { |
| 113 | .name = "fields", |
Dave MacLachlan | aa1d7e7 | 2020-01-19 17:46:35 -0800 | [diff] [blame] | 114 | .dataTypeSpecific.clazz = GPBObjCClass(GPBValue), |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 115 | .number = GPBStruct_FieldNumber_Fields, |
| 116 | .hasIndex = GPBNoHasBit, |
Thomas Van Lenten | 79a23c4 | 2016-03-17 10:04:21 -0400 | [diff] [blame] | 117 | .offset = (uint32_t)offsetof(GPBStruct__storage_, fields), |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 118 | .flags = GPBFieldMapKeyString, |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 119 | .dataType = GPBDataTypeMessage, |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 120 | }, |
| 121 | }; |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 122 | GPBDescriptor *localDescriptor = |
| 123 | [GPBDescriptor allocDescriptorForClass:[GPBStruct class] |
| 124 | rootClass:[GPBStructRoot class] |
| 125 | file:GPBStructRoot_FileDescriptor() |
| 126 | fields:fields |
Thomas Van Lenten | 79a23c4 | 2016-03-17 10:04:21 -0400 | [diff] [blame] | 127 | fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 128 | storageSize:sizeof(GPBStruct__storage_) |
Thomas Van Lenten | b0e2792 | 2020-04-13 13:36:56 -0400 | [diff] [blame] | 129 | flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; |
Dave MacLachlan | b631176 | 2018-12-11 16:32:48 -0800 | [diff] [blame] | 130 | #if defined(DEBUG) && DEBUG |
| 131 | NSAssert(descriptor == nil, @"Startup recursed!"); |
| 132 | #endif // DEBUG |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 133 | descriptor = localDescriptor; |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 134 | } |
| 135 | return descriptor; |
| 136 | } |
| 137 | |
| 138 | @end |
| 139 | |
| 140 | #pragma mark - GPBValue |
| 141 | |
| 142 | @implementation GPBValue |
| 143 | |
| 144 | @dynamic kindOneOfCase; |
| 145 | @dynamic nullValue; |
| 146 | @dynamic numberValue; |
| 147 | @dynamic stringValue; |
| 148 | @dynamic boolValue; |
| 149 | @dynamic structValue; |
| 150 | @dynamic listValue; |
| 151 | |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 152 | typedef struct GPBValue__storage_ { |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 153 | uint32_t _has_storage_[2]; |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 154 | GPBNullValue nullValue; |
| 155 | NSString *stringValue; |
| 156 | GPBStruct *structValue; |
| 157 | GPBListValue *listValue; |
| 158 | double numberValue; |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 159 | } GPBValue__storage_; |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 160 | |
| 161 | // This method is threadsafe because it is initially called |
| 162 | // in +initialize for each subclass. |
| 163 | + (GPBDescriptor *)descriptor { |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 164 | static GPBDescriptor *descriptor = nil; |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 165 | if (!descriptor) { |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 166 | static GPBMessageFieldDescription fields[] = { |
| 167 | { |
| 168 | .name = "nullValue", |
Thomas Van Lenten | 79a23c4 | 2016-03-17 10:04:21 -0400 | [diff] [blame] | 169 | .dataTypeSpecific.enumDescFunc = GPBNullValue_EnumDescriptor, |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 170 | .number = GPBValue_FieldNumber_NullValue, |
| 171 | .hasIndex = -1, |
Thomas Van Lenten | 79a23c4 | 2016-03-17 10:04:21 -0400 | [diff] [blame] | 172 | .offset = (uint32_t)offsetof(GPBValue__storage_, nullValue), |
Sergio Campamá | 14e74f6 | 2016-09-08 12:15:12 -0700 | [diff] [blame] | 173 | .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor), |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 174 | .dataType = GPBDataTypeEnum, |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 175 | }, |
| 176 | { |
| 177 | .name = "numberValue", |
Dave MacLachlan | 74956e1 | 2019-12-17 17:32:09 -0800 | [diff] [blame] | 178 | .dataTypeSpecific.clazz = Nil, |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 179 | .number = GPBValue_FieldNumber_NumberValue, |
| 180 | .hasIndex = -1, |
Thomas Van Lenten | 79a23c4 | 2016-03-17 10:04:21 -0400 | [diff] [blame] | 181 | .offset = (uint32_t)offsetof(GPBValue__storage_, numberValue), |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 182 | .flags = GPBFieldOptional, |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 183 | .dataType = GPBDataTypeDouble, |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 184 | }, |
| 185 | { |
| 186 | .name = "stringValue", |
Dave MacLachlan | 74956e1 | 2019-12-17 17:32:09 -0800 | [diff] [blame] | 187 | .dataTypeSpecific.clazz = Nil, |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 188 | .number = GPBValue_FieldNumber_StringValue, |
| 189 | .hasIndex = -1, |
Thomas Van Lenten | 79a23c4 | 2016-03-17 10:04:21 -0400 | [diff] [blame] | 190 | .offset = (uint32_t)offsetof(GPBValue__storage_, stringValue), |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 191 | .flags = GPBFieldOptional, |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 192 | .dataType = GPBDataTypeString, |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 193 | }, |
| 194 | { |
| 195 | .name = "boolValue", |
Dave MacLachlan | 74956e1 | 2019-12-17 17:32:09 -0800 | [diff] [blame] | 196 | .dataTypeSpecific.clazz = Nil, |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 197 | .number = GPBValue_FieldNumber_BoolValue, |
| 198 | .hasIndex = -1, |
Thomas Van Lenten | 79a23c4 | 2016-03-17 10:04:21 -0400 | [diff] [blame] | 199 | .offset = 0, // Stored in _has_storage_ to save space. |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 200 | .flags = GPBFieldOptional, |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 201 | .dataType = GPBDataTypeBool, |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 202 | }, |
| 203 | { |
| 204 | .name = "structValue", |
Dave MacLachlan | aa1d7e7 | 2020-01-19 17:46:35 -0800 | [diff] [blame] | 205 | .dataTypeSpecific.clazz = GPBObjCClass(GPBStruct), |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 206 | .number = GPBValue_FieldNumber_StructValue, |
| 207 | .hasIndex = -1, |
Thomas Van Lenten | 79a23c4 | 2016-03-17 10:04:21 -0400 | [diff] [blame] | 208 | .offset = (uint32_t)offsetof(GPBValue__storage_, structValue), |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 209 | .flags = GPBFieldOptional, |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 210 | .dataType = GPBDataTypeMessage, |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 211 | }, |
| 212 | { |
| 213 | .name = "listValue", |
Dave MacLachlan | aa1d7e7 | 2020-01-19 17:46:35 -0800 | [diff] [blame] | 214 | .dataTypeSpecific.clazz = GPBObjCClass(GPBListValue), |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 215 | .number = GPBValue_FieldNumber_ListValue, |
| 216 | .hasIndex = -1, |
Thomas Van Lenten | 79a23c4 | 2016-03-17 10:04:21 -0400 | [diff] [blame] | 217 | .offset = (uint32_t)offsetof(GPBValue__storage_, listValue), |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 218 | .flags = GPBFieldOptional, |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 219 | .dataType = GPBDataTypeMessage, |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 220 | }, |
| 221 | }; |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 222 | GPBDescriptor *localDescriptor = |
| 223 | [GPBDescriptor allocDescriptorForClass:[GPBValue class] |
| 224 | rootClass:[GPBStructRoot class] |
| 225 | file:GPBStructRoot_FileDescriptor() |
| 226 | fields:fields |
Thomas Van Lenten | 79a23c4 | 2016-03-17 10:04:21 -0400 | [diff] [blame] | 227 | fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 228 | storageSize:sizeof(GPBValue__storage_) |
Thomas Van Lenten | b0e2792 | 2020-04-13 13:36:56 -0400 | [diff] [blame] | 229 | flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; |
Thomas Van Lenten | 79a23c4 | 2016-03-17 10:04:21 -0400 | [diff] [blame] | 230 | static const char *oneofs[] = { |
| 231 | "kind", |
| 232 | }; |
| 233 | [localDescriptor setupOneofs:oneofs |
| 234 | count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) |
| 235 | firstHasIndex:-1]; |
Dave MacLachlan | b631176 | 2018-12-11 16:32:48 -0800 | [diff] [blame] | 236 | #if defined(DEBUG) && DEBUG |
| 237 | NSAssert(descriptor == nil, @"Startup recursed!"); |
| 238 | #endif // DEBUG |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 239 | descriptor = localDescriptor; |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 240 | } |
| 241 | return descriptor; |
| 242 | } |
| 243 | |
| 244 | @end |
| 245 | |
| 246 | int32_t GPBValue_NullValue_RawValue(GPBValue *message) { |
| 247 | GPBDescriptor *descriptor = [GPBValue descriptor]; |
| 248 | GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBValue_FieldNumber_NullValue]; |
Thomas Van Lenten | b0e2792 | 2020-04-13 13:36:56 -0400 | [diff] [blame] | 249 | return GPBGetMessageRawEnumField(message, field); |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 250 | } |
| 251 | |
| 252 | void SetGPBValue_NullValue_RawValue(GPBValue *message, int32_t value) { |
| 253 | GPBDescriptor *descriptor = [GPBValue descriptor]; |
| 254 | GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBValue_FieldNumber_NullValue]; |
Thomas Van Lenten | b0e2792 | 2020-04-13 13:36:56 -0400 | [diff] [blame] | 255 | GPBSetMessageRawEnumField(message, field, value); |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 256 | } |
| 257 | |
| 258 | void GPBValue_ClearKindOneOfCase(GPBValue *message) { |
Thomas Van Lenten | e9b0c92 | 2020-04-06 16:17:55 -0400 | [diff] [blame] | 259 | GPBDescriptor *descriptor = [GPBValue descriptor]; |
Thomas Van Lenten | 2e98ed5 | 2016-07-18 11:10:02 -0400 | [diff] [blame] | 260 | GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; |
Thomas Van Lenten | b0e2792 | 2020-04-13 13:36:56 -0400 | [diff] [blame] | 261 | GPBClearOneof(message, oneof); |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 262 | } |
| 263 | #pragma mark - GPBListValue |
| 264 | |
| 265 | @implementation GPBListValue |
| 266 | |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 267 | @dynamic valuesArray, valuesArray_Count; |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 268 | |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 269 | typedef struct GPBListValue__storage_ { |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 270 | uint32_t _has_storage_[1]; |
| 271 | NSMutableArray *valuesArray; |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 272 | } GPBListValue__storage_; |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 273 | |
| 274 | // This method is threadsafe because it is initially called |
| 275 | // in +initialize for each subclass. |
| 276 | + (GPBDescriptor *)descriptor { |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 277 | static GPBDescriptor *descriptor = nil; |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 278 | if (!descriptor) { |
| 279 | static GPBMessageFieldDescription fields[] = { |
| 280 | { |
| 281 | .name = "valuesArray", |
Dave MacLachlan | aa1d7e7 | 2020-01-19 17:46:35 -0800 | [diff] [blame] | 282 | .dataTypeSpecific.clazz = GPBObjCClass(GPBValue), |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 283 | .number = GPBListValue_FieldNumber_ValuesArray, |
| 284 | .hasIndex = GPBNoHasBit, |
Thomas Van Lenten | 79a23c4 | 2016-03-17 10:04:21 -0400 | [diff] [blame] | 285 | .offset = (uint32_t)offsetof(GPBListValue__storage_, valuesArray), |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 286 | .flags = GPBFieldRepeated, |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 287 | .dataType = GPBDataTypeMessage, |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 288 | }, |
| 289 | }; |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 290 | GPBDescriptor *localDescriptor = |
| 291 | [GPBDescriptor allocDescriptorForClass:[GPBListValue class] |
| 292 | rootClass:[GPBStructRoot class] |
| 293 | file:GPBStructRoot_FileDescriptor() |
| 294 | fields:fields |
Thomas Van Lenten | 79a23c4 | 2016-03-17 10:04:21 -0400 | [diff] [blame] | 295 | fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 296 | storageSize:sizeof(GPBListValue__storage_) |
Thomas Van Lenten | b0e2792 | 2020-04-13 13:36:56 -0400 | [diff] [blame] | 297 | flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; |
Dave MacLachlan | b631176 | 2018-12-11 16:32:48 -0800 | [diff] [blame] | 298 | #if defined(DEBUG) && DEBUG |
| 299 | NSAssert(descriptor == nil, @"Startup recursed!"); |
| 300 | #endif // DEBUG |
Thomas Van Lenten | d846b0b | 2015-06-08 16:24:57 -0400 | [diff] [blame] | 301 | descriptor = localDescriptor; |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 302 | } |
| 303 | return descriptor; |
| 304 | } |
| 305 | |
| 306 | @end |
| 307 | |
| 308 | |
Thomas Van Lenten | e664aa6 | 2016-04-19 13:13:04 -0400 | [diff] [blame] | 309 | #pragma clang diagnostic pop |
| 310 | |
Thomas Van Lenten | 1dcc329 | 2015-05-21 17:14:52 -0400 | [diff] [blame] | 311 | // @@protoc_insertion_point(global_scope) |