1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: google/protobuf/struct.proto
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
10 #if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
11 #import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h>
13 #import "GPBProtocolBuffers_RuntimeSupport.h"
18 #if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
19 #import <Protobuf/Struct.pbobjc.h>
21 #import "google/protobuf/Struct.pbobjc.h"
23 // @@protoc_insertion_point(imports)
25 #pragma clang diagnostic push
26 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
27 #pragma clang diagnostic ignored "-Wdirect-ivar-access"
29 #pragma mark - GPBStructRoot
31 @implementation GPBStructRoot
33 // No extensions in the file and no imports, so no need to generate
34 // +extensionRegistry.
38 #pragma mark - GPBStructRoot_FileDescriptor
40 static 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;
45 GPB_DEBUG_CHECK_RUNTIME_VERSIONS();
46 descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.protobuf"
48 syntax:GPBFileSyntaxProto3];
53 #pragma mark - Enum GPBNullValue
55 GPBEnumDescriptor *GPBNullValue_EnumDescriptor(void) {
56 static _Atomic(GPBEnumDescriptor*) descriptor = nil;
58 static const char *valueNames =
60 static const int32_t values[] = {
61 GPBNullValue_NullValue,
63 GPBEnumDescriptor *worker =
64 [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(GPBNullValue)
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)) {
77 BOOL GPBNullValue_IsValidValue(int32_t value__) {
79 case GPBNullValue_NullValue:
86 #pragma mark - GPBStruct
88 @implementation GPBStruct
90 @dynamic fields, fields_Count;
92 typedef struct GPBStruct__storage_ {
93 uint32_t _has_storage_[1];
94 NSMutableDictionary *fields;
95 } GPBStruct__storage_;
97 // This method is threadsafe because it is initially called
98 // in +initialize for each subclass.
99 + (GPBDescriptor *)descriptor {
100 static GPBDescriptor *descriptor = nil;
102 static GPBMessageFieldDescription 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,
113 GPBDescriptor *localDescriptor =
114 [GPBDescriptor allocDescriptorForClass:[GPBStruct class]
115 rootClass:[GPBStructRoot class]
116 file:GPBStructRoot_FileDescriptor()
118 fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
119 storageSize:sizeof(GPBStruct__storage_)
120 flags:GPBDescriptorInitializationFlag_None];
121 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 static GPBMessageFieldDescription fields[] = {
158 .dataTypeSpecific.enumDescFunc = GPBNullValue_EnumDescriptor,
159 .number = GPBValue_FieldNumber_NullValue,
161 .offset = (uint32_t)offsetof(GPBValue__storage_, nullValue),
162 .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor),
163 .dataType = GPBDataTypeEnum,
166 .name = "numberValue",
167 .dataTypeSpecific.className = NULL,
168 .number = GPBValue_FieldNumber_NumberValue,
170 .offset = (uint32_t)offsetof(GPBValue__storage_, numberValue),
171 .flags = GPBFieldOptional,
172 .dataType = GPBDataTypeDouble,
175 .name = "stringValue",
176 .dataTypeSpecific.className = NULL,
177 .number = GPBValue_FieldNumber_StringValue,
179 .offset = (uint32_t)offsetof(GPBValue__storage_, stringValue),
180 .flags = GPBFieldOptional,
181 .dataType = GPBDataTypeString,
185 .dataTypeSpecific.className = NULL,
186 .number = GPBValue_FieldNumber_BoolValue,
188 .offset = 0, // Stored in _has_storage_ to save space.
189 .flags = GPBFieldOptional,
190 .dataType = GPBDataTypeBool,
193 .name = "structValue",
194 .dataTypeSpecific.className = GPBStringifySymbol(GPBStruct),
195 .number = GPBValue_FieldNumber_StructValue,
197 .offset = (uint32_t)offsetof(GPBValue__storage_, structValue),
198 .flags = GPBFieldOptional,
199 .dataType = GPBDataTypeMessage,
203 .dataTypeSpecific.className = GPBStringifySymbol(GPBListValue),
204 .number = GPBValue_FieldNumber_ListValue,
206 .offset = (uint32_t)offsetof(GPBValue__storage_, listValue),
207 .flags = GPBFieldOptional,
208 .dataType = GPBDataTypeMessage,
211 GPBDescriptor *localDescriptor =
212 [GPBDescriptor allocDescriptorForClass:[GPBValue class]
213 rootClass:[GPBStructRoot class]
214 file:GPBStructRoot_FileDescriptor()
216 fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
217 storageSize:sizeof(GPBValue__storage_)
218 flags:GPBDescriptorInitializationFlag_None];
219 static const char *oneofs[] = {
222 [localDescriptor setupOneofs:oneofs
223 count:(uint32_t)(sizeof(oneofs) / sizeof(char*))
225 NSAssert(descriptor == nil, @"Startup recursed!");
226 descriptor = localDescriptor;
233 int32_t GPBValue_NullValue_RawValue(GPBValue *message) {
234 GPBDescriptor *descriptor = [GPBValue descriptor];
235 GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBValue_FieldNumber_NullValue];
236 return GPBGetMessageInt32Field(message, field);
239 void SetGPBValue_NullValue_RawValue(GPBValue *message, int32_t value) {
240 GPBDescriptor *descriptor = [GPBValue descriptor];
241 GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBValue_FieldNumber_NullValue];
242 GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax);
245 void GPBValue_ClearKindOneOfCase(GPBValue *message) {
246 GPBDescriptor *descriptor = [message descriptor];
247 GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0];
248 GPBMaybeClearOneof(message, oneof, -1, 0);
250 #pragma mark - GPBListValue
252 @implementation GPBListValue
254 @dynamic valuesArray, valuesArray_Count;
256 typedef struct GPBListValue__storage_ {
257 uint32_t _has_storage_[1];
258 NSMutableArray *valuesArray;
259 } GPBListValue__storage_;
261 // This method is threadsafe because it is initially called
262 // in +initialize for each subclass.
263 + (GPBDescriptor *)descriptor {
264 static GPBDescriptor *descriptor = nil;
266 static GPBMessageFieldDescription fields[] = {
268 .name = "valuesArray",
269 .dataTypeSpecific.className = GPBStringifySymbol(GPBValue),
270 .number = GPBListValue_FieldNumber_ValuesArray,
271 .hasIndex = GPBNoHasBit,
272 .offset = (uint32_t)offsetof(GPBListValue__storage_, valuesArray),
273 .flags = GPBFieldRepeated,
274 .dataType = GPBDataTypeMessage,
277 GPBDescriptor *localDescriptor =
278 [GPBDescriptor allocDescriptorForClass:[GPBListValue class]
279 rootClass:[GPBStructRoot class]
280 file:GPBStructRoot_FileDescriptor()
282 fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
283 storageSize:sizeof(GPBListValue__storage_)
284 flags:GPBDescriptorInitializationFlag_None];
285 NSAssert(descriptor == nil, @"Startup recursed!");
286 descriptor = localDescriptor;
294 #pragma clang diagnostic pop
296 // @@protoc_insertion_point(global_scope)