Avoid recursive call to `Insert` in the flat case.
[google-protobuf.git] / objectivec / GPBWrappers.pbobjc.m
blobcae024e4bf9490e7b983c2fbaf511a598aeca563
1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // NO CHECKED-IN PROTOBUF GENCODE
3 // clang-format off
4 // source: google/protobuf/wrappers.proto
6 #import "GPBProtocolBuffers_RuntimeSupport.h"
7 #import "GPBWrappers.pbobjc.h"
9 #if GOOGLE_PROTOBUF_OBJC_VERSION < 30007
10 #error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources.
11 #endif
12 #if 30007 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION
13 #error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources.
14 #endif
16 // @@protoc_insertion_point(imports)
18 #pragma clang diagnostic push
19 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
20 #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension"
22 #pragma mark - Objective-C Class declarations
23 // Forward declarations of Objective-C classes that we can use as
24 // static values in struct initializers.
25 // We don't use [Foo class] because it is not a static value.
26 GPBObjCClassDeclaration(GPBBoolValue);
27 GPBObjCClassDeclaration(GPBBytesValue);
28 GPBObjCClassDeclaration(GPBDoubleValue);
29 GPBObjCClassDeclaration(GPBFloatValue);
30 GPBObjCClassDeclaration(GPBInt32Value);
31 GPBObjCClassDeclaration(GPBInt64Value);
32 GPBObjCClassDeclaration(GPBStringValue);
33 GPBObjCClassDeclaration(GPBUInt32Value);
34 GPBObjCClassDeclaration(GPBUInt64Value);
36 #pragma mark - GPBWrappersRoot
38 @implementation GPBWrappersRoot
40 // No extensions in the file and no imports or none of the imports (direct or
41 // indirect) defined extensions, so no need to generate +extensionRegistry.
43 @end
45 static GPBFileDescription GPBWrappersRoot_FileDescription = {
46   .package = "google.protobuf",
47   .prefix = "GPB",
48   .syntax = GPBFileSyntaxProto3
51 #pragma mark - GPBDoubleValue
53 @implementation GPBDoubleValue
55 @dynamic value;
57 typedef struct GPBDoubleValue__storage_ {
58   uint32_t _has_storage_[1];
59   double value;
60 } GPBDoubleValue__storage_;
62 // This method is threadsafe because it is initially called
63 // in +initialize for each subclass.
64 + (GPBDescriptor *)descriptor {
65   static GPBDescriptor *descriptor = nil;
66   if (!descriptor) {
67     GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
68     static GPBMessageFieldDescription fields[] = {
69       {
70         .name = "value",
71         .dataTypeSpecific.clazz = Nil,
72         .number = GPBDoubleValue_FieldNumber_Value,
73         .hasIndex = 0,
74         .offset = (uint32_t)offsetof(GPBDoubleValue__storage_, value),
75         .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
76         .dataType = GPBDataTypeDouble,
77       },
78     };
79     GPBDescriptor *localDescriptor =
80         [GPBDescriptor allocDescriptorForClass:GPBObjCClass(GPBDoubleValue)
81                                    messageName:@"DoubleValue"
82                                fileDescription:&GPBWrappersRoot_FileDescription
83                                         fields:fields
84                                     fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
85                                    storageSize:sizeof(GPBDoubleValue__storage_)
86                                          flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
87     #if defined(DEBUG) && DEBUG
88       NSAssert(descriptor == nil, @"Startup recursed!");
89     #endif  // DEBUG
90     descriptor = localDescriptor;
91   }
92   return descriptor;
95 @end
97 #pragma mark - GPBFloatValue
99 @implementation GPBFloatValue
101 @dynamic value;
103 typedef struct GPBFloatValue__storage_ {
104   uint32_t _has_storage_[1];
105   float value;
106 } GPBFloatValue__storage_;
108 // This method is threadsafe because it is initially called
109 // in +initialize for each subclass.
110 + (GPBDescriptor *)descriptor {
111   static GPBDescriptor *descriptor = nil;
112   if (!descriptor) {
113     GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
114     static GPBMessageFieldDescription fields[] = {
115       {
116         .name = "value",
117         .dataTypeSpecific.clazz = Nil,
118         .number = GPBFloatValue_FieldNumber_Value,
119         .hasIndex = 0,
120         .offset = (uint32_t)offsetof(GPBFloatValue__storage_, value),
121         .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
122         .dataType = GPBDataTypeFloat,
123       },
124     };
125     GPBDescriptor *localDescriptor =
126         [GPBDescriptor allocDescriptorForClass:GPBObjCClass(GPBFloatValue)
127                                    messageName:@"FloatValue"
128                                fileDescription:&GPBWrappersRoot_FileDescription
129                                         fields:fields
130                                     fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
131                                    storageSize:sizeof(GPBFloatValue__storage_)
132                                          flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
133     #if defined(DEBUG) && DEBUG
134       NSAssert(descriptor == nil, @"Startup recursed!");
135     #endif  // DEBUG
136     descriptor = localDescriptor;
137   }
138   return descriptor;
141 @end
143 #pragma mark - GPBInt64Value
145 @implementation GPBInt64Value
147 @dynamic value;
149 typedef struct GPBInt64Value__storage_ {
150   uint32_t _has_storage_[1];
151   int64_t value;
152 } GPBInt64Value__storage_;
154 // This method is threadsafe because it is initially called
155 // in +initialize for each subclass.
156 + (GPBDescriptor *)descriptor {
157   static GPBDescriptor *descriptor = nil;
158   if (!descriptor) {
159     GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
160     static GPBMessageFieldDescription fields[] = {
161       {
162         .name = "value",
163         .dataTypeSpecific.clazz = Nil,
164         .number = GPBInt64Value_FieldNumber_Value,
165         .hasIndex = 0,
166         .offset = (uint32_t)offsetof(GPBInt64Value__storage_, value),
167         .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
168         .dataType = GPBDataTypeInt64,
169       },
170     };
171     GPBDescriptor *localDescriptor =
172         [GPBDescriptor allocDescriptorForClass:GPBObjCClass(GPBInt64Value)
173                                    messageName:@"Int64Value"
174                                fileDescription:&GPBWrappersRoot_FileDescription
175                                         fields:fields
176                                     fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
177                                    storageSize:sizeof(GPBInt64Value__storage_)
178                                          flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
179     #if defined(DEBUG) && DEBUG
180       NSAssert(descriptor == nil, @"Startup recursed!");
181     #endif  // DEBUG
182     descriptor = localDescriptor;
183   }
184   return descriptor;
187 @end
189 #pragma mark - GPBUInt64Value
191 @implementation GPBUInt64Value
193 @dynamic value;
195 typedef struct GPBUInt64Value__storage_ {
196   uint32_t _has_storage_[1];
197   uint64_t value;
198 } GPBUInt64Value__storage_;
200 // This method is threadsafe because it is initially called
201 // in +initialize for each subclass.
202 + (GPBDescriptor *)descriptor {
203   static GPBDescriptor *descriptor = nil;
204   if (!descriptor) {
205     GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
206     static GPBMessageFieldDescription fields[] = {
207       {
208         .name = "value",
209         .dataTypeSpecific.clazz = Nil,
210         .number = GPBUInt64Value_FieldNumber_Value,
211         .hasIndex = 0,
212         .offset = (uint32_t)offsetof(GPBUInt64Value__storage_, value),
213         .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
214         .dataType = GPBDataTypeUInt64,
215       },
216     };
217     GPBDescriptor *localDescriptor =
218         [GPBDescriptor allocDescriptorForClass:GPBObjCClass(GPBUInt64Value)
219                                    messageName:@"UInt64Value"
220                                fileDescription:&GPBWrappersRoot_FileDescription
221                                         fields:fields
222                                     fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
223                                    storageSize:sizeof(GPBUInt64Value__storage_)
224                                          flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
225     #if defined(DEBUG) && DEBUG
226       NSAssert(descriptor == nil, @"Startup recursed!");
227     #endif  // DEBUG
228     descriptor = localDescriptor;
229   }
230   return descriptor;
233 @end
235 #pragma mark - GPBInt32Value
237 @implementation GPBInt32Value
239 @dynamic value;
241 typedef struct GPBInt32Value__storage_ {
242   uint32_t _has_storage_[1];
243   int32_t value;
244 } GPBInt32Value__storage_;
246 // This method is threadsafe because it is initially called
247 // in +initialize for each subclass.
248 + (GPBDescriptor *)descriptor {
249   static GPBDescriptor *descriptor = nil;
250   if (!descriptor) {
251     GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
252     static GPBMessageFieldDescription fields[] = {
253       {
254         .name = "value",
255         .dataTypeSpecific.clazz = Nil,
256         .number = GPBInt32Value_FieldNumber_Value,
257         .hasIndex = 0,
258         .offset = (uint32_t)offsetof(GPBInt32Value__storage_, value),
259         .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
260         .dataType = GPBDataTypeInt32,
261       },
262     };
263     GPBDescriptor *localDescriptor =
264         [GPBDescriptor allocDescriptorForClass:GPBObjCClass(GPBInt32Value)
265                                    messageName:@"Int32Value"
266                                fileDescription:&GPBWrappersRoot_FileDescription
267                                         fields:fields
268                                     fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
269                                    storageSize:sizeof(GPBInt32Value__storage_)
270                                          flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
271     #if defined(DEBUG) && DEBUG
272       NSAssert(descriptor == nil, @"Startup recursed!");
273     #endif  // DEBUG
274     descriptor = localDescriptor;
275   }
276   return descriptor;
279 @end
281 #pragma mark - GPBUInt32Value
283 @implementation GPBUInt32Value
285 @dynamic value;
287 typedef struct GPBUInt32Value__storage_ {
288   uint32_t _has_storage_[1];
289   uint32_t value;
290 } GPBUInt32Value__storage_;
292 // This method is threadsafe because it is initially called
293 // in +initialize for each subclass.
294 + (GPBDescriptor *)descriptor {
295   static GPBDescriptor *descriptor = nil;
296   if (!descriptor) {
297     GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
298     static GPBMessageFieldDescription fields[] = {
299       {
300         .name = "value",
301         .dataTypeSpecific.clazz = Nil,
302         .number = GPBUInt32Value_FieldNumber_Value,
303         .hasIndex = 0,
304         .offset = (uint32_t)offsetof(GPBUInt32Value__storage_, value),
305         .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
306         .dataType = GPBDataTypeUInt32,
307       },
308     };
309     GPBDescriptor *localDescriptor =
310         [GPBDescriptor allocDescriptorForClass:GPBObjCClass(GPBUInt32Value)
311                                    messageName:@"UInt32Value"
312                                fileDescription:&GPBWrappersRoot_FileDescription
313                                         fields:fields
314                                     fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
315                                    storageSize:sizeof(GPBUInt32Value__storage_)
316                                          flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
317     #if defined(DEBUG) && DEBUG
318       NSAssert(descriptor == nil, @"Startup recursed!");
319     #endif  // DEBUG
320     descriptor = localDescriptor;
321   }
322   return descriptor;
325 @end
327 #pragma mark - GPBBoolValue
329 @implementation GPBBoolValue
331 @dynamic value;
333 typedef struct GPBBoolValue__storage_ {
334   uint32_t _has_storage_[1];
335 } GPBBoolValue__storage_;
337 // This method is threadsafe because it is initially called
338 // in +initialize for each subclass.
339 + (GPBDescriptor *)descriptor {
340   static GPBDescriptor *descriptor = nil;
341   if (!descriptor) {
342     GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
343     static GPBMessageFieldDescription fields[] = {
344       {
345         .name = "value",
346         .dataTypeSpecific.clazz = Nil,
347         .number = GPBBoolValue_FieldNumber_Value,
348         .hasIndex = 0,
349         .offset = 1,  // Stored in _has_storage_ to save space.
350         .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
351         .dataType = GPBDataTypeBool,
352       },
353     };
354     GPBDescriptor *localDescriptor =
355         [GPBDescriptor allocDescriptorForClass:GPBObjCClass(GPBBoolValue)
356                                    messageName:@"BoolValue"
357                                fileDescription:&GPBWrappersRoot_FileDescription
358                                         fields:fields
359                                     fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
360                                    storageSize:sizeof(GPBBoolValue__storage_)
361                                          flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
362     #if defined(DEBUG) && DEBUG
363       NSAssert(descriptor == nil, @"Startup recursed!");
364     #endif  // DEBUG
365     descriptor = localDescriptor;
366   }
367   return descriptor;
370 @end
372 #pragma mark - GPBStringValue
374 @implementation GPBStringValue
376 @dynamic value;
378 typedef struct GPBStringValue__storage_ {
379   uint32_t _has_storage_[1];
380   NSString *value;
381 } GPBStringValue__storage_;
383 // This method is threadsafe because it is initially called
384 // in +initialize for each subclass.
385 + (GPBDescriptor *)descriptor {
386   static GPBDescriptor *descriptor = nil;
387   if (!descriptor) {
388     GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
389     static GPBMessageFieldDescription fields[] = {
390       {
391         .name = "value",
392         .dataTypeSpecific.clazz = Nil,
393         .number = GPBStringValue_FieldNumber_Value,
394         .hasIndex = 0,
395         .offset = (uint32_t)offsetof(GPBStringValue__storage_, value),
396         .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
397         .dataType = GPBDataTypeString,
398       },
399     };
400     GPBDescriptor *localDescriptor =
401         [GPBDescriptor allocDescriptorForClass:GPBObjCClass(GPBStringValue)
402                                    messageName:@"StringValue"
403                                fileDescription:&GPBWrappersRoot_FileDescription
404                                         fields:fields
405                                     fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
406                                    storageSize:sizeof(GPBStringValue__storage_)
407                                          flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
408     #if defined(DEBUG) && DEBUG
409       NSAssert(descriptor == nil, @"Startup recursed!");
410     #endif  // DEBUG
411     descriptor = localDescriptor;
412   }
413   return descriptor;
416 @end
418 #pragma mark - GPBBytesValue
420 @implementation GPBBytesValue
422 @dynamic value;
424 typedef struct GPBBytesValue__storage_ {
425   uint32_t _has_storage_[1];
426   NSData *value;
427 } GPBBytesValue__storage_;
429 // This method is threadsafe because it is initially called
430 // in +initialize for each subclass.
431 + (GPBDescriptor *)descriptor {
432   static GPBDescriptor *descriptor = nil;
433   if (!descriptor) {
434     GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
435     static GPBMessageFieldDescription fields[] = {
436       {
437         .name = "value",
438         .dataTypeSpecific.clazz = Nil,
439         .number = GPBBytesValue_FieldNumber_Value,
440         .hasIndex = 0,
441         .offset = (uint32_t)offsetof(GPBBytesValue__storage_, value),
442         .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero),
443         .dataType = GPBDataTypeBytes,
444       },
445     };
446     GPBDescriptor *localDescriptor =
447         [GPBDescriptor allocDescriptorForClass:GPBObjCClass(GPBBytesValue)
448                                    messageName:@"BytesValue"
449                                fileDescription:&GPBWrappersRoot_FileDescription
450                                         fields:fields
451                                     fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
452                                    storageSize:sizeof(GPBBytesValue__storage_)
453                                          flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
454     #if defined(DEBUG) && DEBUG
455       NSAssert(descriptor == nil, @"Startup recursed!");
456     #endif  // DEBUG
457     descriptor = localDescriptor;
458   }
459   return descriptor;
462 @end
465 #pragma clang diagnostic pop
467 // @@protoc_insertion_point(global_scope)
469 // clang-format on