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