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