blob: 21f156fa5e9720f650f438bcf143b1a49de627bb [file] [log] [blame]
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -04001// Generated by the protocol buffer compiler. DO NOT EDIT!
Thomas Van Lenten7c646282022-09-19 13:19:31 -04002// clang-format off
Thomas Van Lenten672adeb2022-10-06 16:16:07 -04003// source: google/protobuf/struct.proto
Thomas Van Lenten7c646282022-09-19 13:19:31 -04004
Thomas Van Lenten020e4e32022-03-01 14:16:50 -05005#import "GPBProtocolBuffers_RuntimeSupport.h"
6#import "GPBStruct.pbobjc.h"
Thomas Van Lenten7da023b2016-05-09 13:53:20 -04007
Protobuf Team Bote4d70bb2023-02-08 10:17:46 -08008#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 Lenten3e1587f2018-01-23 13:38:28 -050015#import <stdatomic.h>
16
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -040017// @@protoc_insertion_point(imports)
18
Thomas Van Lentene664aa62016-04-19 13:13:04 -040019#pragma clang diagnostic push
20#pragma clang diagnostic ignored "-Wdeprecated-declarations"
Thomas Van Lentenc8a440d2016-05-25 13:46:00 -040021#pragma clang diagnostic ignored "-Wdirect-ivar-access"
Dave MacLachlan74956e12019-12-17 17:32:09 -080022#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension"
23
Protobuf Team Botaeae4302023-02-09 07:43:26 -080024#pragma mark - Objective-C Class declarations
25// Forward declarations of Objective-C classes that we can use as
Dave MacLachlanaa1d7e72020-01-19 17:46:35 -080026// static values in struct initializers.
27// We don't use [Foo class] because it is not a static value.
28GPBObjCClassDeclaration(GPBListValue);
29GPBObjCClassDeclaration(GPBStruct);
30GPBObjCClassDeclaration(GPBValue);
Thomas Van Lentene664aa62016-04-19 13:13:04 -040031
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -040032#pragma mark - GPBStructRoot
33
34@implementation GPBStructRoot
35
Thomas Van Lenten740d3142023-08-14 10:04:53 -070036// 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 Lenten13a41242016-09-01 11:45:50 -040038
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -040039@end
40
Protobuf Team Bot4ed02cc2023-02-08 06:31:58 -080041static GPBFileDescription GPBStructRoot_FileDescription = {
42 .package = "google.protobuf",
43 .prefix = "GPB",
44 .syntax = GPBFileSyntaxProto3
45};
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -040046
47#pragma mark - Enum GPBNullValue
48
49GPBEnumDescriptor *GPBNullValue_EnumDescriptor(void) {
Thomas Van Lentend83837d2018-01-31 13:58:11 -050050 static _Atomic(GPBEnumDescriptor*) descriptor = nil;
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -040051 if (!descriptor) {
Protobuf Team Bot78376c32023-01-31 11:29:07 -080052 GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
Thomas Van Lenten79a23c42016-03-17 10:04:21 -040053 static const char *valueNames =
54 "NullValue\000";
55 static const int32_t values[] = {
56 GPBNullValue_NullValue,
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -040057 };
Thomas Van Lenten79a23c42016-03-17 10:04:21 -040058 GPBEnumDescriptor *worker =
59 [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(GPBNullValue)
60 valueNames:valueNames
61 values:values
62 count:(uint32_t)(sizeof(values) / sizeof(int32_t))
Protobuf Team Bot4a122472022-11-15 11:22:51 -080063 enumVerifier:GPBNullValue_IsValidValue
64 flags:GPBEnumDescriptorInitializationFlag_None];
Jonathan Dierksena721bf62018-01-22 13:26:39 -080065 GPBEnumDescriptor *expected = nil;
66 if (!atomic_compare_exchange_strong(&descriptor, &expected, worker)) {
Thomas Van Lenten79a23c42016-03-17 10:04:21 -040067 [worker release];
68 }
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -040069 }
70 return descriptor;
71}
72
73BOOL 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 Lentend846b0b2015-06-08 16:24:57 -040086@dynamic fields, fields_Count;
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -040087
Thomas Van Lentend846b0b2015-06-08 16:24:57 -040088typedef struct GPBStruct__storage_ {
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -040089 uint32_t _has_storage_[1];
90 NSMutableDictionary *fields;
Thomas Van Lentend846b0b2015-06-08 16:24:57 -040091} GPBStruct__storage_;
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -040092
93// This method is threadsafe because it is initially called
94// in +initialize for each subclass.
95+ (GPBDescriptor *)descriptor {
Thomas Van Lentend846b0b2015-06-08 16:24:57 -040096 static GPBDescriptor *descriptor = nil;
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -040097 if (!descriptor) {
Protobuf Team Bot78376c32023-01-31 11:29:07 -080098 GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -040099 static GPBMessageFieldDescription fields[] = {
100 {
101 .name = "fields",
Dave MacLachlanaa1d7e72020-01-19 17:46:35 -0800102 .dataTypeSpecific.clazz = GPBObjCClass(GPBValue),
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400103 .number = GPBStruct_FieldNumber_Fields,
104 .hasIndex = GPBNoHasBit,
Thomas Van Lenten79a23c42016-03-17 10:04:21 -0400105 .offset = (uint32_t)offsetof(GPBStruct__storage_, fields),
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400106 .flags = GPBFieldMapKeyString,
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400107 .dataType = GPBDataTypeMessage,
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400108 },
109 };
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400110 GPBDescriptor *localDescriptor =
Protobuf Team Botbf7de742023-02-02 11:29:54 -0800111 [GPBDescriptor allocDescriptorForClass:GPBObjCClass(GPBStruct)
Protobuf Team Bot4ed02cc2023-02-08 06:31:58 -0800112 messageName:@"Struct"
113 fileDescription:&GPBStructRoot_FileDescription
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400114 fields:fields
Thomas Van Lenten79a23c42016-03-17 10:04:21 -0400115 fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400116 storageSize:sizeof(GPBStruct__storage_)
Protobuf Team Bot4a122472022-11-15 11:22:51 -0800117 flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
Thomas Van Lenten6c4ab102023-07-11 07:49:55 -0700118 #if defined(DEBUG) && DEBUG
Dave MacLachlanb6311762018-12-11 16:32:48 -0800119 NSAssert(descriptor == nil, @"Startup recursed!");
Thomas Van Lenten6c4ab102023-07-11 07:49:55 -0700120 #endif // DEBUG
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400121 descriptor = localDescriptor;
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400122 }
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 Lentend846b0b2015-06-08 16:24:57 -0400140typedef struct GPBValue__storage_ {
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400141 uint32_t _has_storage_[2];
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400142 GPBNullValue nullValue;
143 NSString *stringValue;
144 GPBStruct *structValue;
145 GPBListValue *listValue;
146 double numberValue;
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400147} GPBValue__storage_;
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400148
149// This method is threadsafe because it is initially called
150// in +initialize for each subclass.
151+ (GPBDescriptor *)descriptor {
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400152 static GPBDescriptor *descriptor = nil;
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400153 if (!descriptor) {
Protobuf Team Bot78376c32023-01-31 11:29:07 -0800154 GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400155 static GPBMessageFieldDescription fields[] = {
156 {
157 .name = "nullValue",
Thomas Van Lenten79a23c42016-03-17 10:04:21 -0400158 .dataTypeSpecific.enumDescFunc = GPBNullValue_EnumDescriptor,
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400159 .number = GPBValue_FieldNumber_NullValue,
160 .hasIndex = -1,
Thomas Van Lenten79a23c42016-03-17 10:04:21 -0400161 .offset = (uint32_t)offsetof(GPBValue__storage_, nullValue),
Sergio Campamá14e74f62016-09-08 12:15:12 -0700162 .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor),
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400163 .dataType = GPBDataTypeEnum,
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400164 },
165 {
166 .name = "numberValue",
Dave MacLachlan74956e12019-12-17 17:32:09 -0800167 .dataTypeSpecific.clazz = Nil,
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400168 .number = GPBValue_FieldNumber_NumberValue,
169 .hasIndex = -1,
Thomas Van Lenten79a23c42016-03-17 10:04:21 -0400170 .offset = (uint32_t)offsetof(GPBValue__storage_, numberValue),
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400171 .flags = GPBFieldOptional,
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400172 .dataType = GPBDataTypeDouble,
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400173 },
174 {
175 .name = "stringValue",
Dave MacLachlan74956e12019-12-17 17:32:09 -0800176 .dataTypeSpecific.clazz = Nil,
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400177 .number = GPBValue_FieldNumber_StringValue,
178 .hasIndex = -1,
Thomas Van Lenten79a23c42016-03-17 10:04:21 -0400179 .offset = (uint32_t)offsetof(GPBValue__storage_, stringValue),
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400180 .flags = GPBFieldOptional,
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400181 .dataType = GPBDataTypeString,
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400182 },
183 {
184 .name = "boolValue",
Dave MacLachlan74956e12019-12-17 17:32:09 -0800185 .dataTypeSpecific.clazz = Nil,
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400186 .number = GPBValue_FieldNumber_BoolValue,
187 .hasIndex = -1,
Thomas Van Lenten79a23c42016-03-17 10:04:21 -0400188 .offset = 0, // Stored in _has_storage_ to save space.
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400189 .flags = GPBFieldOptional,
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400190 .dataType = GPBDataTypeBool,
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400191 },
192 {
193 .name = "structValue",
Dave MacLachlanaa1d7e72020-01-19 17:46:35 -0800194 .dataTypeSpecific.clazz = GPBObjCClass(GPBStruct),
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400195 .number = GPBValue_FieldNumber_StructValue,
196 .hasIndex = -1,
Thomas Van Lenten79a23c42016-03-17 10:04:21 -0400197 .offset = (uint32_t)offsetof(GPBValue__storage_, structValue),
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400198 .flags = GPBFieldOptional,
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400199 .dataType = GPBDataTypeMessage,
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400200 },
201 {
202 .name = "listValue",
Dave MacLachlanaa1d7e72020-01-19 17:46:35 -0800203 .dataTypeSpecific.clazz = GPBObjCClass(GPBListValue),
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400204 .number = GPBValue_FieldNumber_ListValue,
205 .hasIndex = -1,
Thomas Van Lenten79a23c42016-03-17 10:04:21 -0400206 .offset = (uint32_t)offsetof(GPBValue__storage_, listValue),
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400207 .flags = GPBFieldOptional,
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400208 .dataType = GPBDataTypeMessage,
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400209 },
210 };
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400211 GPBDescriptor *localDescriptor =
Protobuf Team Botbf7de742023-02-02 11:29:54 -0800212 [GPBDescriptor allocDescriptorForClass:GPBObjCClass(GPBValue)
Protobuf Team Bot4ed02cc2023-02-08 06:31:58 -0800213 messageName:@"Value"
214 fileDescription:&GPBStructRoot_FileDescription
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400215 fields:fields
Thomas Van Lenten79a23c42016-03-17 10:04:21 -0400216 fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400217 storageSize:sizeof(GPBValue__storage_)
Protobuf Team Bot4a122472022-11-15 11:22:51 -0800218 flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
Thomas Van Lenten79a23c42016-03-17 10:04:21 -0400219 static const char *oneofs[] = {
220 "kind",
221 };
222 [localDescriptor setupOneofs:oneofs
223 count:(uint32_t)(sizeof(oneofs) / sizeof(char*))
224 firstHasIndex:-1];
Thomas Van Lenten6c4ab102023-07-11 07:49:55 -0700225 #if defined(DEBUG) && DEBUG
Dave MacLachlanb6311762018-12-11 16:32:48 -0800226 NSAssert(descriptor == nil, @"Startup recursed!");
Thomas Van Lenten6c4ab102023-07-11 07:49:55 -0700227 #endif // DEBUG
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400228 descriptor = localDescriptor;
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400229 }
230 return descriptor;
231}
232
233@end
234
235int32_t GPBValue_NullValue_RawValue(GPBValue *message) {
236 GPBDescriptor *descriptor = [GPBValue descriptor];
237 GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBValue_FieldNumber_NullValue];
Thomas Van Lentenb0e27922020-04-13 13:36:56 -0400238 return GPBGetMessageRawEnumField(message, field);
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400239}
240
241void SetGPBValue_NullValue_RawValue(GPBValue *message, int32_t value) {
242 GPBDescriptor *descriptor = [GPBValue descriptor];
243 GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBValue_FieldNumber_NullValue];
Thomas Van Lentenb0e27922020-04-13 13:36:56 -0400244 GPBSetMessageRawEnumField(message, field, value);
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400245}
246
247void GPBValue_ClearKindOneOfCase(GPBValue *message) {
Thomas Van Lentene9b0c922020-04-06 16:17:55 -0400248 GPBDescriptor *descriptor = [GPBValue descriptor];
Thomas Van Lenten2e98ed52016-07-18 11:10:02 -0400249 GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0];
Thomas Van Lentenb0e27922020-04-13 13:36:56 -0400250 GPBClearOneof(message, oneof);
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400251}
252#pragma mark - GPBListValue
253
254@implementation GPBListValue
255
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400256@dynamic valuesArray, valuesArray_Count;
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400257
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400258typedef struct GPBListValue__storage_ {
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400259 uint32_t _has_storage_[1];
260 NSMutableArray *valuesArray;
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400261} GPBListValue__storage_;
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400262
263// This method is threadsafe because it is initially called
264// in +initialize for each subclass.
265+ (GPBDescriptor *)descriptor {
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400266 static GPBDescriptor *descriptor = nil;
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400267 if (!descriptor) {
Protobuf Team Bot78376c32023-01-31 11:29:07 -0800268 GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400269 static GPBMessageFieldDescription fields[] = {
270 {
271 .name = "valuesArray",
Dave MacLachlanaa1d7e72020-01-19 17:46:35 -0800272 .dataTypeSpecific.clazz = GPBObjCClass(GPBValue),
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400273 .number = GPBListValue_FieldNumber_ValuesArray,
274 .hasIndex = GPBNoHasBit,
Thomas Van Lenten79a23c42016-03-17 10:04:21 -0400275 .offset = (uint32_t)offsetof(GPBListValue__storage_, valuesArray),
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400276 .flags = GPBFieldRepeated,
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400277 .dataType = GPBDataTypeMessage,
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400278 },
279 };
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400280 GPBDescriptor *localDescriptor =
Protobuf Team Botbf7de742023-02-02 11:29:54 -0800281 [GPBDescriptor allocDescriptorForClass:GPBObjCClass(GPBListValue)
Protobuf Team Bot4ed02cc2023-02-08 06:31:58 -0800282 messageName:@"ListValue"
283 fileDescription:&GPBStructRoot_FileDescription
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400284 fields:fields
Thomas Van Lenten79a23c42016-03-17 10:04:21 -0400285 fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400286 storageSize:sizeof(GPBListValue__storage_)
Protobuf Team Bot4a122472022-11-15 11:22:51 -0800287 flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
Thomas Van Lenten6c4ab102023-07-11 07:49:55 -0700288 #if defined(DEBUG) && DEBUG
Dave MacLachlanb6311762018-12-11 16:32:48 -0800289 NSAssert(descriptor == nil, @"Startup recursed!");
Thomas Van Lenten6c4ab102023-07-11 07:49:55 -0700290 #endif // DEBUG
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400291 descriptor = localDescriptor;
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400292 }
293 return descriptor;
294}
295
296@end
297
298
Thomas Van Lentene664aa62016-04-19 13:13:04 -0400299#pragma clang diagnostic pop
300
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400301// @@protoc_insertion_point(global_scope)
Thomas Van Lenten7c646282022-09-19 13:19:31 -0400302
Thomas Van Lenten672adeb2022-10-06 16:16:07 -0400303// clang-format on