blob: 554046a9fe50f8b5b92c6705d31d31810f53dd2c [file] [log] [blame]
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -04001// Generated by the protocol buffer compiler. DO NOT EDIT!
2// source: google/protobuf/struct.proto
3
Thomas Van Lenten7da023b2016-05-09 13:53:20 -04004// 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 Lenten56c48ae2020-01-22 15:50:52 -050011 #import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h>
Thomas Van Lenten7da023b2016-05-09 13:53:20 -040012#else
13 #import "GPBProtocolBuffers_RuntimeSupport.h"
14#endif
15
Thomas Van Lenten3e1587f2018-01-23 13:38:28 -050016#import <stdatomic.h>
17
Thomas Van Lenten7da023b2016-05-09 13:53:20 -040018#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
Thomas Van Lenten56c48ae2020-01-22 15:50:52 -050019 #import <Protobuf/GPBStruct.pbobjc.h>
Thomas Van Lenten7da023b2016-05-09 13:53:20 -040020#else
Thomas Van Lenten56c48ae2020-01-22 15:50:52 -050021 #import "GPBStruct.pbobjc.h"
Thomas Van Lenten7da023b2016-05-09 13:53:20 -040022#endif
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -040023// @@protoc_insertion_point(imports)
24
Thomas Van Lentene664aa62016-04-19 13:13:04 -040025#pragma clang diagnostic push
26#pragma clang diagnostic ignored "-Wdeprecated-declarations"
Thomas Van Lentenc8a440d2016-05-25 13:46:00 -040027#pragma clang diagnostic ignored "-Wdirect-ivar-access"
Dave MacLachlan74956e12019-12-17 17:32:09 -080028#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension"
29
Dave MacLachlanaa1d7e72020-01-19 17:46:35 -080030#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.
34GPBObjCClassDeclaration(GPBListValue);
35GPBObjCClassDeclaration(GPBStruct);
36GPBObjCClassDeclaration(GPBValue);
Thomas Van Lentene664aa62016-04-19 13:13:04 -040037
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -040038#pragma mark - GPBStructRoot
39
40@implementation GPBStructRoot
41
Thomas Van Lenten13a41242016-09-01 11:45:50 -040042// No extensions in the file and no imports, so no need to generate
43// +extensionRegistry.
44
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -040045@end
46
Thomas Van Lentend846b0b2015-06-08 16:24:57 -040047#pragma mark - GPBStructRoot_FileDescriptor
48
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -040049static 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 Lenten1aa65002016-09-15 13:27:17 -040054 GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -040055 descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.protobuf"
Thomas Van Lenten337ec302016-08-16 11:26:49 -040056 objcPrefix:@"GPB"
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -040057 syntax:GPBFileSyntaxProto3];
58 }
59 return descriptor;
60}
61
62#pragma mark - Enum GPBNullValue
63
64GPBEnumDescriptor *GPBNullValue_EnumDescriptor(void) {
Thomas Van Lentend83837d2018-01-31 13:58:11 -050065 static _Atomic(GPBEnumDescriptor*) descriptor = nil;
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -040066 if (!descriptor) {
Thomas Van Lenten79a23c42016-03-17 10:04:21 -040067 static const char *valueNames =
68 "NullValue\000";
69 static const int32_t values[] = {
70 GPBNullValue_NullValue,
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -040071 };
Thomas Van Lenten79a23c42016-03-17 10:04:21 -040072 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 Dierksena721bf62018-01-22 13:26:39 -080078 GPBEnumDescriptor *expected = nil;
79 if (!atomic_compare_exchange_strong(&descriptor, &expected, worker)) {
Thomas Van Lenten79a23c42016-03-17 10:04:21 -040080 [worker release];
81 }
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -040082 }
83 return descriptor;
84}
85
86BOOL 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 Lentend846b0b2015-06-08 16:24:57 -040099@dynamic fields, fields_Count;
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400100
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400101typedef struct GPBStruct__storage_ {
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400102 uint32_t _has_storage_[1];
103 NSMutableDictionary *fields;
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400104} GPBStruct__storage_;
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400105
106// This method is threadsafe because it is initially called
107// in +initialize for each subclass.
108+ (GPBDescriptor *)descriptor {
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400109 static GPBDescriptor *descriptor = nil;
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400110 if (!descriptor) {
111 static GPBMessageFieldDescription fields[] = {
112 {
113 .name = "fields",
Dave MacLachlanaa1d7e72020-01-19 17:46:35 -0800114 .dataTypeSpecific.clazz = GPBObjCClass(GPBValue),
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400115 .number = GPBStruct_FieldNumber_Fields,
116 .hasIndex = GPBNoHasBit,
Thomas Van Lenten79a23c42016-03-17 10:04:21 -0400117 .offset = (uint32_t)offsetof(GPBStruct__storage_, fields),
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400118 .flags = GPBFieldMapKeyString,
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400119 .dataType = GPBDataTypeMessage,
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400120 },
121 };
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400122 GPBDescriptor *localDescriptor =
123 [GPBDescriptor allocDescriptorForClass:[GPBStruct class]
124 rootClass:[GPBStructRoot class]
125 file:GPBStructRoot_FileDescriptor()
126 fields:fields
Thomas Van Lenten79a23c42016-03-17 10:04:21 -0400127 fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400128 storageSize:sizeof(GPBStruct__storage_)
Thomas Van Lentenb0e27922020-04-13 13:36:56 -0400129 flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)];
Dave MacLachlanb6311762018-12-11 16:32:48 -0800130 #if defined(DEBUG) && DEBUG
131 NSAssert(descriptor == nil, @"Startup recursed!");
132 #endif // DEBUG
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400133 descriptor = localDescriptor;
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400134 }
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 Lentend846b0b2015-06-08 16:24:57 -0400152typedef struct GPBValue__storage_ {
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400153 uint32_t _has_storage_[2];
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400154 GPBNullValue nullValue;
155 NSString *stringValue;
156 GPBStruct *structValue;
157 GPBListValue *listValue;
158 double numberValue;
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400159} GPBValue__storage_;
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400160
161// This method is threadsafe because it is initially called
162// in +initialize for each subclass.
163+ (GPBDescriptor *)descriptor {
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400164 static GPBDescriptor *descriptor = nil;
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400165 if (!descriptor) {
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400166 static GPBMessageFieldDescription fields[] = {
167 {
168 .name = "nullValue",
Thomas Van Lenten79a23c42016-03-17 10:04:21 -0400169 .dataTypeSpecific.enumDescFunc = GPBNullValue_EnumDescriptor,
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400170 .number = GPBValue_FieldNumber_NullValue,
171 .hasIndex = -1,
Thomas Van Lenten79a23c42016-03-17 10:04:21 -0400172 .offset = (uint32_t)offsetof(GPBValue__storage_, nullValue),
Sergio Campamá14e74f62016-09-08 12:15:12 -0700173 .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor),
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400174 .dataType = GPBDataTypeEnum,
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400175 },
176 {
177 .name = "numberValue",
Dave MacLachlan74956e12019-12-17 17:32:09 -0800178 .dataTypeSpecific.clazz = Nil,
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400179 .number = GPBValue_FieldNumber_NumberValue,
180 .hasIndex = -1,
Thomas Van Lenten79a23c42016-03-17 10:04:21 -0400181 .offset = (uint32_t)offsetof(GPBValue__storage_, numberValue),
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400182 .flags = GPBFieldOptional,
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400183 .dataType = GPBDataTypeDouble,
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400184 },
185 {
186 .name = "stringValue",
Dave MacLachlan74956e12019-12-17 17:32:09 -0800187 .dataTypeSpecific.clazz = Nil,
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400188 .number = GPBValue_FieldNumber_StringValue,
189 .hasIndex = -1,
Thomas Van Lenten79a23c42016-03-17 10:04:21 -0400190 .offset = (uint32_t)offsetof(GPBValue__storage_, stringValue),
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400191 .flags = GPBFieldOptional,
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400192 .dataType = GPBDataTypeString,
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400193 },
194 {
195 .name = "boolValue",
Dave MacLachlan74956e12019-12-17 17:32:09 -0800196 .dataTypeSpecific.clazz = Nil,
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400197 .number = GPBValue_FieldNumber_BoolValue,
198 .hasIndex = -1,
Thomas Van Lenten79a23c42016-03-17 10:04:21 -0400199 .offset = 0, // Stored in _has_storage_ to save space.
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400200 .flags = GPBFieldOptional,
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400201 .dataType = GPBDataTypeBool,
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400202 },
203 {
204 .name = "structValue",
Dave MacLachlanaa1d7e72020-01-19 17:46:35 -0800205 .dataTypeSpecific.clazz = GPBObjCClass(GPBStruct),
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400206 .number = GPBValue_FieldNumber_StructValue,
207 .hasIndex = -1,
Thomas Van Lenten79a23c42016-03-17 10:04:21 -0400208 .offset = (uint32_t)offsetof(GPBValue__storage_, structValue),
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400209 .flags = GPBFieldOptional,
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400210 .dataType = GPBDataTypeMessage,
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400211 },
212 {
213 .name = "listValue",
Dave MacLachlanaa1d7e72020-01-19 17:46:35 -0800214 .dataTypeSpecific.clazz = GPBObjCClass(GPBListValue),
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400215 .number = GPBValue_FieldNumber_ListValue,
216 .hasIndex = -1,
Thomas Van Lenten79a23c42016-03-17 10:04:21 -0400217 .offset = (uint32_t)offsetof(GPBValue__storage_, listValue),
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400218 .flags = GPBFieldOptional,
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400219 .dataType = GPBDataTypeMessage,
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400220 },
221 };
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400222 GPBDescriptor *localDescriptor =
223 [GPBDescriptor allocDescriptorForClass:[GPBValue class]
224 rootClass:[GPBStructRoot class]
225 file:GPBStructRoot_FileDescriptor()
226 fields:fields
Thomas Van Lenten79a23c42016-03-17 10:04:21 -0400227 fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400228 storageSize:sizeof(GPBValue__storage_)
Thomas Van Lentenb0e27922020-04-13 13:36:56 -0400229 flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)];
Thomas Van Lenten79a23c42016-03-17 10:04:21 -0400230 static const char *oneofs[] = {
231 "kind",
232 };
233 [localDescriptor setupOneofs:oneofs
234 count:(uint32_t)(sizeof(oneofs) / sizeof(char*))
235 firstHasIndex:-1];
Dave MacLachlanb6311762018-12-11 16:32:48 -0800236 #if defined(DEBUG) && DEBUG
237 NSAssert(descriptor == nil, @"Startup recursed!");
238 #endif // DEBUG
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400239 descriptor = localDescriptor;
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400240 }
241 return descriptor;
242}
243
244@end
245
246int32_t GPBValue_NullValue_RawValue(GPBValue *message) {
247 GPBDescriptor *descriptor = [GPBValue descriptor];
248 GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBValue_FieldNumber_NullValue];
Thomas Van Lentenb0e27922020-04-13 13:36:56 -0400249 return GPBGetMessageRawEnumField(message, field);
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400250}
251
252void SetGPBValue_NullValue_RawValue(GPBValue *message, int32_t value) {
253 GPBDescriptor *descriptor = [GPBValue descriptor];
254 GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBValue_FieldNumber_NullValue];
Thomas Van Lentenb0e27922020-04-13 13:36:56 -0400255 GPBSetMessageRawEnumField(message, field, value);
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400256}
257
258void GPBValue_ClearKindOneOfCase(GPBValue *message) {
Thomas Van Lentene9b0c922020-04-06 16:17:55 -0400259 GPBDescriptor *descriptor = [GPBValue descriptor];
Thomas Van Lenten2e98ed52016-07-18 11:10:02 -0400260 GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0];
Thomas Van Lentenb0e27922020-04-13 13:36:56 -0400261 GPBClearOneof(message, oneof);
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400262}
263#pragma mark - GPBListValue
264
265@implementation GPBListValue
266
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400267@dynamic valuesArray, valuesArray_Count;
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400268
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400269typedef struct GPBListValue__storage_ {
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400270 uint32_t _has_storage_[1];
271 NSMutableArray *valuesArray;
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400272} GPBListValue__storage_;
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400273
274// This method is threadsafe because it is initially called
275// in +initialize for each subclass.
276+ (GPBDescriptor *)descriptor {
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400277 static GPBDescriptor *descriptor = nil;
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400278 if (!descriptor) {
279 static GPBMessageFieldDescription fields[] = {
280 {
281 .name = "valuesArray",
Dave MacLachlanaa1d7e72020-01-19 17:46:35 -0800282 .dataTypeSpecific.clazz = GPBObjCClass(GPBValue),
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400283 .number = GPBListValue_FieldNumber_ValuesArray,
284 .hasIndex = GPBNoHasBit,
Thomas Van Lenten79a23c42016-03-17 10:04:21 -0400285 .offset = (uint32_t)offsetof(GPBListValue__storage_, valuesArray),
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400286 .flags = GPBFieldRepeated,
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400287 .dataType = GPBDataTypeMessage,
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400288 },
289 };
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400290 GPBDescriptor *localDescriptor =
291 [GPBDescriptor allocDescriptorForClass:[GPBListValue class]
292 rootClass:[GPBStructRoot class]
293 file:GPBStructRoot_FileDescriptor()
294 fields:fields
Thomas Van Lenten79a23c42016-03-17 10:04:21 -0400295 fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400296 storageSize:sizeof(GPBListValue__storage_)
Thomas Van Lentenb0e27922020-04-13 13:36:56 -0400297 flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)];
Dave MacLachlanb6311762018-12-11 16:32:48 -0800298 #if defined(DEBUG) && DEBUG
299 NSAssert(descriptor == nil, @"Startup recursed!");
300 #endif // DEBUG
Thomas Van Lentend846b0b2015-06-08 16:24:57 -0400301 descriptor = localDescriptor;
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400302 }
303 return descriptor;
304}
305
306@end
307
308
Thomas Van Lentene664aa62016-04-19 13:13:04 -0400309#pragma clang diagnostic pop
310
Thomas Van Lenten1dcc3292015-05-21 17:14:52 -0400311// @@protoc_insertion_point(global_scope)