• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Generated by the protocol buffer compiler.  DO NOT EDIT!
2// source: google/protobuf/struct.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#import <stdatomic.h>
17
18#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
19 #import <Protobuf/Struct.pbobjc.h>
20#else
21 #import "google/protobuf/Struct.pbobjc.h"
22#endif
23// @@protoc_insertion_point(imports)
24
25#pragma clang diagnostic push
26#pragma clang diagnostic ignored "-Wdeprecated-declarations"
27#pragma clang diagnostic ignored "-Wdirect-ivar-access"
28
29#pragma mark - GPBStructRoot
30
31@implementation GPBStructRoot
32
33// No extensions in the file and no imports, so no need to generate
34// +extensionRegistry.
35
36@end
37
38#pragma mark - GPBStructRoot_FileDescriptor
39
40static GPBFileDescriptor *GPBStructRoot_FileDescriptor(void) {
41  // This is called by +initialize so there is no need to worry
42  // about thread safety of the singleton.
43  static GPBFileDescriptor *descriptor = NULL;
44  if (!descriptor) {
45    GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
46    descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.protobuf"
47                                                 objcPrefix:@"GPB"
48                                                     syntax:GPBFileSyntaxProto3];
49  }
50  return descriptor;
51}
52
53#pragma mark - Enum GPBNullValue
54
55GPBEnumDescriptor *GPBNullValue_EnumDescriptor(void) {
56  static _Atomic(GPBEnumDescriptor*) descriptor = nil;
57  if (!descriptor) {
58    static const char *valueNames =
59        "NullValue\000";
60    static const int32_t values[] = {
61        GPBNullValue_NullValue,
62    };
63    GPBEnumDescriptor *worker =
64        [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(GPBNullValue)
65                                       valueNames:valueNames
66                                           values:values
67                                            count:(uint32_t)(sizeof(values) / sizeof(int32_t))
68                                     enumVerifier:GPBNullValue_IsValidValue];
69    GPBEnumDescriptor *expected = nil;
70    if (!atomic_compare_exchange_strong(&descriptor, &expected, worker)) {
71      [worker release];
72    }
73  }
74  return descriptor;
75}
76
77BOOL GPBNullValue_IsValidValue(int32_t value__) {
78  switch (value__) {
79    case GPBNullValue_NullValue:
80      return YES;
81    default:
82      return NO;
83  }
84}
85
86#pragma mark - GPBStruct
87
88@implementation GPBStruct
89
90@dynamic fields, fields_Count;
91
92typedef struct GPBStruct__storage_ {
93  uint32_t _has_storage_[1];
94  NSMutableDictionary *fields;
95} GPBStruct__storage_;
96
97// This method is threadsafe because it is initially called
98// in +initialize for each subclass.
99+ (GPBDescriptor *)descriptor {
100  static GPBDescriptor *descriptor = nil;
101  if (!descriptor) {
102    static GPBMessageFieldDescription fields[] = {
103      {
104        .name = "fields",
105        .dataTypeSpecific.className = GPBStringifySymbol(GPBValue),
106        .number = GPBStruct_FieldNumber_Fields,
107        .hasIndex = GPBNoHasBit,
108        .offset = (uint32_t)offsetof(GPBStruct__storage_, fields),
109        .flags = GPBFieldMapKeyString,
110        .dataType = GPBDataTypeMessage,
111      },
112    };
113    GPBDescriptor *localDescriptor =
114        [GPBDescriptor allocDescriptorForClass:[GPBStruct class]
115                                     rootClass:[GPBStructRoot class]
116                                          file:GPBStructRoot_FileDescriptor()
117                                        fields:fields
118                                    fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
119                                   storageSize:sizeof(GPBStruct__storage_)
120                                         flags:GPBDescriptorInitializationFlag_None];
121    #if defined(DEBUG) && DEBUG
122      NSAssert(descriptor == nil, @"Startup recursed!");
123    #endif  // DEBUG
124    descriptor = localDescriptor;
125  }
126  return descriptor;
127}
128
129@end
130
131#pragma mark - GPBValue
132
133@implementation GPBValue
134
135@dynamic kindOneOfCase;
136@dynamic nullValue;
137@dynamic numberValue;
138@dynamic stringValue;
139@dynamic boolValue;
140@dynamic structValue;
141@dynamic listValue;
142
143typedef struct GPBValue__storage_ {
144  uint32_t _has_storage_[2];
145  GPBNullValue nullValue;
146  NSString *stringValue;
147  GPBStruct *structValue;
148  GPBListValue *listValue;
149  double numberValue;
150} GPBValue__storage_;
151
152// This method is threadsafe because it is initially called
153// in +initialize for each subclass.
154+ (GPBDescriptor *)descriptor {
155  static GPBDescriptor *descriptor = nil;
156  if (!descriptor) {
157    static GPBMessageFieldDescription fields[] = {
158      {
159        .name = "nullValue",
160        .dataTypeSpecific.enumDescFunc = GPBNullValue_EnumDescriptor,
161        .number = GPBValue_FieldNumber_NullValue,
162        .hasIndex = -1,
163        .offset = (uint32_t)offsetof(GPBValue__storage_, nullValue),
164        .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor),
165        .dataType = GPBDataTypeEnum,
166      },
167      {
168        .name = "numberValue",
169        .dataTypeSpecific.className = NULL,
170        .number = GPBValue_FieldNumber_NumberValue,
171        .hasIndex = -1,
172        .offset = (uint32_t)offsetof(GPBValue__storage_, numberValue),
173        .flags = GPBFieldOptional,
174        .dataType = GPBDataTypeDouble,
175      },
176      {
177        .name = "stringValue",
178        .dataTypeSpecific.className = NULL,
179        .number = GPBValue_FieldNumber_StringValue,
180        .hasIndex = -1,
181        .offset = (uint32_t)offsetof(GPBValue__storage_, stringValue),
182        .flags = GPBFieldOptional,
183        .dataType = GPBDataTypeString,
184      },
185      {
186        .name = "boolValue",
187        .dataTypeSpecific.className = NULL,
188        .number = GPBValue_FieldNumber_BoolValue,
189        .hasIndex = -1,
190        .offset = 0,  // Stored in _has_storage_ to save space.
191        .flags = GPBFieldOptional,
192        .dataType = GPBDataTypeBool,
193      },
194      {
195        .name = "structValue",
196        .dataTypeSpecific.className = GPBStringifySymbol(GPBStruct),
197        .number = GPBValue_FieldNumber_StructValue,
198        .hasIndex = -1,
199        .offset = (uint32_t)offsetof(GPBValue__storage_, structValue),
200        .flags = GPBFieldOptional,
201        .dataType = GPBDataTypeMessage,
202      },
203      {
204        .name = "listValue",
205        .dataTypeSpecific.className = GPBStringifySymbol(GPBListValue),
206        .number = GPBValue_FieldNumber_ListValue,
207        .hasIndex = -1,
208        .offset = (uint32_t)offsetof(GPBValue__storage_, listValue),
209        .flags = GPBFieldOptional,
210        .dataType = GPBDataTypeMessage,
211      },
212    };
213    GPBDescriptor *localDescriptor =
214        [GPBDescriptor allocDescriptorForClass:[GPBValue class]
215                                     rootClass:[GPBStructRoot class]
216                                          file:GPBStructRoot_FileDescriptor()
217                                        fields:fields
218                                    fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
219                                   storageSize:sizeof(GPBValue__storage_)
220                                         flags:GPBDescriptorInitializationFlag_None];
221    static const char *oneofs[] = {
222      "kind",
223    };
224    [localDescriptor setupOneofs:oneofs
225                           count:(uint32_t)(sizeof(oneofs) / sizeof(char*))
226                   firstHasIndex:-1];
227    #if defined(DEBUG) && DEBUG
228      NSAssert(descriptor == nil, @"Startup recursed!");
229    #endif  // DEBUG
230    descriptor = localDescriptor;
231  }
232  return descriptor;
233}
234
235@end
236
237int32_t GPBValue_NullValue_RawValue(GPBValue *message) {
238  GPBDescriptor *descriptor = [GPBValue descriptor];
239  GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBValue_FieldNumber_NullValue];
240  return GPBGetMessageInt32Field(message, field);
241}
242
243void SetGPBValue_NullValue_RawValue(GPBValue *message, int32_t value) {
244  GPBDescriptor *descriptor = [GPBValue descriptor];
245  GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBValue_FieldNumber_NullValue];
246  GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax);
247}
248
249void GPBValue_ClearKindOneOfCase(GPBValue *message) {
250  GPBDescriptor *descriptor = [message descriptor];
251  GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0];
252  GPBMaybeClearOneof(message, oneof, -1, 0);
253}
254#pragma mark - GPBListValue
255
256@implementation GPBListValue
257
258@dynamic valuesArray, valuesArray_Count;
259
260typedef struct GPBListValue__storage_ {
261  uint32_t _has_storage_[1];
262  NSMutableArray *valuesArray;
263} GPBListValue__storage_;
264
265// This method is threadsafe because it is initially called
266// in +initialize for each subclass.
267+ (GPBDescriptor *)descriptor {
268  static GPBDescriptor *descriptor = nil;
269  if (!descriptor) {
270    static GPBMessageFieldDescription fields[] = {
271      {
272        .name = "valuesArray",
273        .dataTypeSpecific.className = GPBStringifySymbol(GPBValue),
274        .number = GPBListValue_FieldNumber_ValuesArray,
275        .hasIndex = GPBNoHasBit,
276        .offset = (uint32_t)offsetof(GPBListValue__storage_, valuesArray),
277        .flags = GPBFieldRepeated,
278        .dataType = GPBDataTypeMessage,
279      },
280    };
281    GPBDescriptor *localDescriptor =
282        [GPBDescriptor allocDescriptorForClass:[GPBListValue class]
283                                     rootClass:[GPBStructRoot class]
284                                          file:GPBStructRoot_FileDescriptor()
285                                        fields:fields
286                                    fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
287                                   storageSize:sizeof(GPBListValue__storage_)
288                                         flags:GPBDescriptorInitializationFlag_None];
289    #if defined(DEBUG) && DEBUG
290      NSAssert(descriptor == nil, @"Startup recursed!");
291    #endif  // DEBUG
292    descriptor = localDescriptor;
293  }
294  return descriptor;
295}
296
297@end
298
299
300#pragma clang diagnostic pop
301
302// @@protoc_insertion_point(global_scope)
303