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