Imported Upstream version 3.8.0
[platform/upstream/protobuf.git] / objectivec / google / protobuf / Api.pbobjc.m
1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // source: google/protobuf/api.proto
3
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
11  #import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h>
12 #else
13  #import "GPBProtocolBuffers_RuntimeSupport.h"
14 #endif
15
16 #if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
17  #import <Protobuf/Api.pbobjc.h>
18  #import <Protobuf/SourceContext.pbobjc.h>
19  #import <Protobuf/Type.pbobjc.h>
20 #else
21  #import "google/protobuf/Api.pbobjc.h"
22  #import "google/protobuf/SourceContext.pbobjc.h"
23  #import "google/protobuf/Type.pbobjc.h"
24 #endif
25 // @@protoc_insertion_point(imports)
26
27 #pragma clang diagnostic push
28 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
29
30 #pragma mark - GPBApiRoot
31
32 @implementation GPBApiRoot
33
34 // No extensions in the file and none of the imports (direct or indirect)
35 // defined extensions, so no need to generate +extensionRegistry.
36
37 @end
38
39 #pragma mark - GPBApiRoot_FileDescriptor
40
41 static GPBFileDescriptor *GPBApiRoot_FileDescriptor(void) {
42   // This is called by +initialize so there is no need to worry
43   // about thread safety of the singleton.
44   static GPBFileDescriptor *descriptor = NULL;
45   if (!descriptor) {
46     GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
47     descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.protobuf"
48                                                  objcPrefix:@"GPB"
49                                                      syntax:GPBFileSyntaxProto3];
50   }
51   return descriptor;
52 }
53
54 #pragma mark - GPBApi
55
56 @implementation GPBApi
57
58 @dynamic name;
59 @dynamic methodsArray, methodsArray_Count;
60 @dynamic optionsArray, optionsArray_Count;
61 @dynamic version;
62 @dynamic hasSourceContext, sourceContext;
63 @dynamic mixinsArray, mixinsArray_Count;
64 @dynamic syntax;
65
66 typedef struct GPBApi__storage_ {
67   uint32_t _has_storage_[1];
68   GPBSyntax syntax;
69   NSString *name;
70   NSMutableArray *methodsArray;
71   NSMutableArray *optionsArray;
72   NSString *version;
73   GPBSourceContext *sourceContext;
74   NSMutableArray *mixinsArray;
75 } GPBApi__storage_;
76
77 // This method is threadsafe because it is initially called
78 // in +initialize for each subclass.
79 + (GPBDescriptor *)descriptor {
80   static GPBDescriptor *descriptor = nil;
81   if (!descriptor) {
82     static GPBMessageFieldDescription fields[] = {
83       {
84         .name = "name",
85         .dataTypeSpecific.className = NULL,
86         .number = GPBApi_FieldNumber_Name,
87         .hasIndex = 0,
88         .offset = (uint32_t)offsetof(GPBApi__storage_, name),
89         .flags = GPBFieldOptional,
90         .dataType = GPBDataTypeString,
91       },
92       {
93         .name = "methodsArray",
94         .dataTypeSpecific.className = GPBStringifySymbol(GPBMethod),
95         .number = GPBApi_FieldNumber_MethodsArray,
96         .hasIndex = GPBNoHasBit,
97         .offset = (uint32_t)offsetof(GPBApi__storage_, methodsArray),
98         .flags = GPBFieldRepeated,
99         .dataType = GPBDataTypeMessage,
100       },
101       {
102         .name = "optionsArray",
103         .dataTypeSpecific.className = GPBStringifySymbol(GPBOption),
104         .number = GPBApi_FieldNumber_OptionsArray,
105         .hasIndex = GPBNoHasBit,
106         .offset = (uint32_t)offsetof(GPBApi__storage_, optionsArray),
107         .flags = GPBFieldRepeated,
108         .dataType = GPBDataTypeMessage,
109       },
110       {
111         .name = "version",
112         .dataTypeSpecific.className = NULL,
113         .number = GPBApi_FieldNumber_Version,
114         .hasIndex = 1,
115         .offset = (uint32_t)offsetof(GPBApi__storage_, version),
116         .flags = GPBFieldOptional,
117         .dataType = GPBDataTypeString,
118       },
119       {
120         .name = "sourceContext",
121         .dataTypeSpecific.className = GPBStringifySymbol(GPBSourceContext),
122         .number = GPBApi_FieldNumber_SourceContext,
123         .hasIndex = 2,
124         .offset = (uint32_t)offsetof(GPBApi__storage_, sourceContext),
125         .flags = GPBFieldOptional,
126         .dataType = GPBDataTypeMessage,
127       },
128       {
129         .name = "mixinsArray",
130         .dataTypeSpecific.className = GPBStringifySymbol(GPBMixin),
131         .number = GPBApi_FieldNumber_MixinsArray,
132         .hasIndex = GPBNoHasBit,
133         .offset = (uint32_t)offsetof(GPBApi__storage_, mixinsArray),
134         .flags = GPBFieldRepeated,
135         .dataType = GPBDataTypeMessage,
136       },
137       {
138         .name = "syntax",
139         .dataTypeSpecific.enumDescFunc = GPBSyntax_EnumDescriptor,
140         .number = GPBApi_FieldNumber_Syntax,
141         .hasIndex = 3,
142         .offset = (uint32_t)offsetof(GPBApi__storage_, syntax),
143         .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor),
144         .dataType = GPBDataTypeEnum,
145       },
146     };
147     GPBDescriptor *localDescriptor =
148         [GPBDescriptor allocDescriptorForClass:[GPBApi class]
149                                      rootClass:[GPBApiRoot class]
150                                           file:GPBApiRoot_FileDescriptor()
151                                         fields:fields
152                                     fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
153                                    storageSize:sizeof(GPBApi__storage_)
154                                          flags:GPBDescriptorInitializationFlag_None];
155     #if defined(DEBUG) && DEBUG
156       NSAssert(descriptor == nil, @"Startup recursed!");
157     #endif  // DEBUG
158     descriptor = localDescriptor;
159   }
160   return descriptor;
161 }
162
163 @end
164
165 int32_t GPBApi_Syntax_RawValue(GPBApi *message) {
166   GPBDescriptor *descriptor = [GPBApi descriptor];
167   GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBApi_FieldNumber_Syntax];
168   return GPBGetMessageInt32Field(message, field);
169 }
170
171 void SetGPBApi_Syntax_RawValue(GPBApi *message, int32_t value) {
172   GPBDescriptor *descriptor = [GPBApi descriptor];
173   GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBApi_FieldNumber_Syntax];
174   GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax);
175 }
176
177 #pragma mark - GPBMethod
178
179 @implementation GPBMethod
180
181 @dynamic name;
182 @dynamic requestTypeURL;
183 @dynamic requestStreaming;
184 @dynamic responseTypeURL;
185 @dynamic responseStreaming;
186 @dynamic optionsArray, optionsArray_Count;
187 @dynamic syntax;
188
189 typedef struct GPBMethod__storage_ {
190   uint32_t _has_storage_[1];
191   GPBSyntax syntax;
192   NSString *name;
193   NSString *requestTypeURL;
194   NSString *responseTypeURL;
195   NSMutableArray *optionsArray;
196 } GPBMethod__storage_;
197
198 // This method is threadsafe because it is initially called
199 // in +initialize for each subclass.
200 + (GPBDescriptor *)descriptor {
201   static GPBDescriptor *descriptor = nil;
202   if (!descriptor) {
203     static GPBMessageFieldDescription fields[] = {
204       {
205         .name = "name",
206         .dataTypeSpecific.className = NULL,
207         .number = GPBMethod_FieldNumber_Name,
208         .hasIndex = 0,
209         .offset = (uint32_t)offsetof(GPBMethod__storage_, name),
210         .flags = GPBFieldOptional,
211         .dataType = GPBDataTypeString,
212       },
213       {
214         .name = "requestTypeURL",
215         .dataTypeSpecific.className = NULL,
216         .number = GPBMethod_FieldNumber_RequestTypeURL,
217         .hasIndex = 1,
218         .offset = (uint32_t)offsetof(GPBMethod__storage_, requestTypeURL),
219         .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldTextFormatNameCustom),
220         .dataType = GPBDataTypeString,
221       },
222       {
223         .name = "requestStreaming",
224         .dataTypeSpecific.className = NULL,
225         .number = GPBMethod_FieldNumber_RequestStreaming,
226         .hasIndex = 2,
227         .offset = 3,  // Stored in _has_storage_ to save space.
228         .flags = GPBFieldOptional,
229         .dataType = GPBDataTypeBool,
230       },
231       {
232         .name = "responseTypeURL",
233         .dataTypeSpecific.className = NULL,
234         .number = GPBMethod_FieldNumber_ResponseTypeURL,
235         .hasIndex = 4,
236         .offset = (uint32_t)offsetof(GPBMethod__storage_, responseTypeURL),
237         .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldTextFormatNameCustom),
238         .dataType = GPBDataTypeString,
239       },
240       {
241         .name = "responseStreaming",
242         .dataTypeSpecific.className = NULL,
243         .number = GPBMethod_FieldNumber_ResponseStreaming,
244         .hasIndex = 5,
245         .offset = 6,  // Stored in _has_storage_ to save space.
246         .flags = GPBFieldOptional,
247         .dataType = GPBDataTypeBool,
248       },
249       {
250         .name = "optionsArray",
251         .dataTypeSpecific.className = GPBStringifySymbol(GPBOption),
252         .number = GPBMethod_FieldNumber_OptionsArray,
253         .hasIndex = GPBNoHasBit,
254         .offset = (uint32_t)offsetof(GPBMethod__storage_, optionsArray),
255         .flags = GPBFieldRepeated,
256         .dataType = GPBDataTypeMessage,
257       },
258       {
259         .name = "syntax",
260         .dataTypeSpecific.enumDescFunc = GPBSyntax_EnumDescriptor,
261         .number = GPBMethod_FieldNumber_Syntax,
262         .hasIndex = 7,
263         .offset = (uint32_t)offsetof(GPBMethod__storage_, syntax),
264         .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor),
265         .dataType = GPBDataTypeEnum,
266       },
267     };
268     GPBDescriptor *localDescriptor =
269         [GPBDescriptor allocDescriptorForClass:[GPBMethod class]
270                                      rootClass:[GPBApiRoot class]
271                                           file:GPBApiRoot_FileDescriptor()
272                                         fields:fields
273                                     fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
274                                    storageSize:sizeof(GPBMethod__storage_)
275                                          flags:GPBDescriptorInitializationFlag_None];
276 #if !GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS
277     static const char *extraTextFormatInfo =
278         "\002\002\007\244\241!!\000\004\010\244\241!!\000";
279     [localDescriptor setupExtraTextInfo:extraTextFormatInfo];
280 #endif  // !GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS
281     #if defined(DEBUG) && DEBUG
282       NSAssert(descriptor == nil, @"Startup recursed!");
283     #endif  // DEBUG
284     descriptor = localDescriptor;
285   }
286   return descriptor;
287 }
288
289 @end
290
291 int32_t GPBMethod_Syntax_RawValue(GPBMethod *message) {
292   GPBDescriptor *descriptor = [GPBMethod descriptor];
293   GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBMethod_FieldNumber_Syntax];
294   return GPBGetMessageInt32Field(message, field);
295 }
296
297 void SetGPBMethod_Syntax_RawValue(GPBMethod *message, int32_t value) {
298   GPBDescriptor *descriptor = [GPBMethod descriptor];
299   GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBMethod_FieldNumber_Syntax];
300   GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax);
301 }
302
303 #pragma mark - GPBMixin
304
305 @implementation GPBMixin
306
307 @dynamic name;
308 @dynamic root;
309
310 typedef struct GPBMixin__storage_ {
311   uint32_t _has_storage_[1];
312   NSString *name;
313   NSString *root;
314 } GPBMixin__storage_;
315
316 // This method is threadsafe because it is initially called
317 // in +initialize for each subclass.
318 + (GPBDescriptor *)descriptor {
319   static GPBDescriptor *descriptor = nil;
320   if (!descriptor) {
321     static GPBMessageFieldDescription fields[] = {
322       {
323         .name = "name",
324         .dataTypeSpecific.className = NULL,
325         .number = GPBMixin_FieldNumber_Name,
326         .hasIndex = 0,
327         .offset = (uint32_t)offsetof(GPBMixin__storage_, name),
328         .flags = GPBFieldOptional,
329         .dataType = GPBDataTypeString,
330       },
331       {
332         .name = "root",
333         .dataTypeSpecific.className = NULL,
334         .number = GPBMixin_FieldNumber_Root,
335         .hasIndex = 1,
336         .offset = (uint32_t)offsetof(GPBMixin__storage_, root),
337         .flags = GPBFieldOptional,
338         .dataType = GPBDataTypeString,
339       },
340     };
341     GPBDescriptor *localDescriptor =
342         [GPBDescriptor allocDescriptorForClass:[GPBMixin class]
343                                      rootClass:[GPBApiRoot class]
344                                           file:GPBApiRoot_FileDescriptor()
345                                         fields:fields
346                                     fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
347                                    storageSize:sizeof(GPBMixin__storage_)
348                                          flags:GPBDescriptorInitializationFlag_None];
349     #if defined(DEBUG) && DEBUG
350       NSAssert(descriptor == nil, @"Startup recursed!");
351     #endif  // DEBUG
352     descriptor = localDescriptor;
353   }
354   return descriptor;
355 }
356
357 @end
358
359
360 #pragma clang diagnostic pop
361
362 // @@protoc_insertion_point(global_scope)