1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // NO CHECKED-IN PROTOBUF GENCODE
4 // source: google/protobuf/struct.proto
6 #import "GPBProtocolBuffers_RuntimeSupport.h"
7 #import "GPBStruct.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.
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.
18 // @@protoc_insertion_point(imports)
20 #pragma clang diagnostic push
21 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
22 #pragma clang diagnostic ignored "-Wdirect-ivar-access"
23 #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension"
25 #pragma mark - Objective-C Class declarations
26 // Forward declarations of Objective-C classes that we can use as
27 // static values in struct initializers.
28 // We don't use [Foo class] because it is not a static value.
29 GPBObjCClassDeclaration(GPBListValue);
30 GPBObjCClassDeclaration(GPBStruct);
31 GPBObjCClassDeclaration(GPBValue);
33 #pragma mark - GPBStructRoot
35 @implementation GPBStructRoot
37 // No extensions in the file and no imports or none of the imports (direct or
38 // indirect) defined extensions, so no need to generate +extensionRegistry.
42 static GPBFileDescription GPBStructRoot_FileDescription = {
43 .package = "google.protobuf",
45 .syntax = GPBFileSyntaxProto3
48 #pragma mark - Enum GPBNullValue
50 GPBEnumDescriptor *GPBNullValue_EnumDescriptor(void) {
51 static _Atomic(GPBEnumDescriptor*) descriptor = nil;
53 GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
54 static const char *valueNames =
56 static const int32_t values[] = {
57 GPBNullValue_NullValue,
59 GPBEnumDescriptor *worker =
60 [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(GPBNullValue)
63 count:(uint32_t)(sizeof(values) / sizeof(int32_t))
64 enumVerifier:GPBNullValue_IsValidValue
65 flags:GPBEnumDescriptorInitializationFlag_None];
66 GPBEnumDescriptor *expected = nil;
67 if (!atomic_compare_exchange_strong(&descriptor, &expected, worker)) {
74 BOOL GPBNullValue_IsValidValue(int32_t value__) {
76 case GPBNullValue_NullValue:
83 #pragma mark - GPBStruct
85 @implementation GPBStruct
87 @dynamic fields, fields_Count;
89 typedef struct GPBStruct__storage_ {
90 uint32_t _has_storage_[1];
91 NSMutableDictionary *fields;
92 } GPBStruct__storage_;
94 // This method is threadsafe because it is initially called
95 // in +initialize for each subclass.
96 + (GPBDescriptor *)descriptor {
97 static GPBDescriptor *descriptor = nil;
99 GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
100 static GPBMessageFieldDescription fields[] = {
103 .dataTypeSpecific.clazz = GPBObjCClass(GPBValue),
104 .number = GPBStruct_FieldNumber_Fields,
105 .hasIndex = GPBNoHasBit,
106 .offset = (uint32_t)offsetof(GPBStruct__storage_, fields),
107 .flags = GPBFieldMapKeyString,
108 .dataType = GPBDataTypeMessage,
111 GPBDescriptor *localDescriptor =
112 [GPBDescriptor allocDescriptorForClass:GPBObjCClass(GPBStruct)
113 messageName:@"Struct"
114 fileDescription:&GPBStructRoot_FileDescription
116 fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
117 storageSize:sizeof(GPBStruct__storage_)
118 flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
119 #if defined(DEBUG) && DEBUG
120 NSAssert(descriptor == nil, @"Startup recursed!");
122 descriptor = localDescriptor;
129 #pragma mark - GPBValue
131 @implementation GPBValue
133 @dynamic kindOneOfCase;
135 @dynamic numberValue;
136 @dynamic stringValue;
138 @dynamic structValue;
141 typedef struct GPBValue__storage_ {
142 uint32_t _has_storage_[2];
143 GPBNullValue nullValue;
144 NSString *stringValue;
145 GPBStruct *structValue;
146 GPBListValue *listValue;
148 } GPBValue__storage_;
150 // This method is threadsafe because it is initially called
151 // in +initialize for each subclass.
152 + (GPBDescriptor *)descriptor {
153 static GPBDescriptor *descriptor = nil;
155 GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
156 static GPBMessageFieldDescription fields[] = {
159 .dataTypeSpecific.enumDescFunc = GPBNullValue_EnumDescriptor,
160 .number = GPBValue_FieldNumber_NullValue,
162 .offset = (uint32_t)offsetof(GPBValue__storage_, nullValue),
163 .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor),
164 .dataType = GPBDataTypeEnum,
167 .name = "numberValue",
168 .dataTypeSpecific.clazz = Nil,
169 .number = GPBValue_FieldNumber_NumberValue,
171 .offset = (uint32_t)offsetof(GPBValue__storage_, numberValue),
172 .flags = GPBFieldOptional,
173 .dataType = GPBDataTypeDouble,
176 .name = "stringValue",
177 .dataTypeSpecific.clazz = Nil,
178 .number = GPBValue_FieldNumber_StringValue,
180 .offset = (uint32_t)offsetof(GPBValue__storage_, stringValue),
181 .flags = GPBFieldOptional,
182 .dataType = GPBDataTypeString,
186 .dataTypeSpecific.clazz = Nil,
187 .number = GPBValue_FieldNumber_BoolValue,
189 .offset = 0, // Stored in _has_storage_ to save space.
190 .flags = GPBFieldOptional,
191 .dataType = GPBDataTypeBool,
194 .name = "structValue",
195 .dataTypeSpecific.clazz = GPBObjCClass(GPBStruct),
196 .number = GPBValue_FieldNumber_StructValue,
198 .offset = (uint32_t)offsetof(GPBValue__storage_, structValue),
199 .flags = GPBFieldOptional,
200 .dataType = GPBDataTypeMessage,
204 .dataTypeSpecific.clazz = GPBObjCClass(GPBListValue),
205 .number = GPBValue_FieldNumber_ListValue,
207 .offset = (uint32_t)offsetof(GPBValue__storage_, listValue),
208 .flags = GPBFieldOptional,
209 .dataType = GPBDataTypeMessage,
212 GPBDescriptor *localDescriptor =
213 [GPBDescriptor allocDescriptorForClass:GPBObjCClass(GPBValue)
215 fileDescription:&GPBStructRoot_FileDescription
217 fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
218 storageSize:sizeof(GPBValue__storage_)
219 flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
220 static const char *oneofs[] = {
223 [localDescriptor setupOneofs:oneofs
224 count:(uint32_t)(sizeof(oneofs) / sizeof(char*))
226 #if defined(DEBUG) && DEBUG
227 NSAssert(descriptor == nil, @"Startup recursed!");
229 descriptor = localDescriptor;
236 int32_t GPBValue_NullValue_RawValue(GPBValue *message) {
237 GPBDescriptor *descriptor = [GPBValue descriptor];
238 GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBValue_FieldNumber_NullValue];
239 return GPBGetMessageRawEnumField(message, field);
242 void SetGPBValue_NullValue_RawValue(GPBValue *message, int32_t value) {
243 GPBDescriptor *descriptor = [GPBValue descriptor];
244 GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBValue_FieldNumber_NullValue];
245 GPBSetMessageRawEnumField(message, field, value);
248 void GPBValue_ClearKindOneOfCase(GPBValue *message) {
249 GPBDescriptor *descriptor = [GPBValue descriptor];
250 GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0];
251 GPBClearOneof(message, oneof);
253 #pragma mark - GPBListValue
255 @implementation GPBListValue
257 @dynamic valuesArray, valuesArray_Count;
259 typedef struct GPBListValue__storage_ {
260 uint32_t _has_storage_[1];
261 NSMutableArray *valuesArray;
262 } GPBListValue__storage_;
264 // This method is threadsafe because it is initially called
265 // in +initialize for each subclass.
266 + (GPBDescriptor *)descriptor {
267 static GPBDescriptor *descriptor = nil;
269 GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
270 static GPBMessageFieldDescription fields[] = {
272 .name = "valuesArray",
273 .dataTypeSpecific.clazz = GPBObjCClass(GPBValue),
274 .number = GPBListValue_FieldNumber_ValuesArray,
275 .hasIndex = GPBNoHasBit,
276 .offset = (uint32_t)offsetof(GPBListValue__storage_, valuesArray),
277 .flags = GPBFieldRepeated,
278 .dataType = GPBDataTypeMessage,
281 GPBDescriptor *localDescriptor =
282 [GPBDescriptor allocDescriptorForClass:GPBObjCClass(GPBListValue)
283 messageName:@"ListValue"
284 fileDescription:&GPBStructRoot_FileDescription
286 fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
287 storageSize:sizeof(GPBListValue__storage_)
288 flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown | GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];
289 #if defined(DEBUG) && DEBUG
290 NSAssert(descriptor == nil, @"Startup recursed!");
292 descriptor = localDescriptor;
300 #pragma clang diagnostic pop
302 // @@protoc_insertion_point(global_scope)