• Thomas Van Lenten's avatar
    Beta quality drop of Objective C Support. · d846b0b0
    Thomas Van Lenten authored
    - Add more to the ObjC dir readme.
    - Merge the ExtensionField and ExtensionDescriptor to reduce overhead.
    - Fix an initialization race.
    - Clean up the Xcode schemes.
    - Remove the class/enum filter.
    - Remove some forced inline that were bloating things without proof of performance wins.
    - Rename some internal types to avoid conflicts with the well know types protos.
    - Drop the use of ApplyFunctions to the compiler/optimizer can do what it wants.
    - Better document some possible future improvements.
    - Add missing support for parsing repeated primitive fields in packed or unpacked forms.
    - Improve -hash.
    - Add *Count for repeated and map<> fields to avoid auto create when checking for them being set.
    d846b0b0
Any.pbobjc.m 3.16 KB
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/protobuf/any.proto

#import "GPBProtocolBuffers_RuntimeSupport.h"
#import "google/protobuf/Any.pbobjc.h"
// @@protoc_insertion_point(imports)

#pragma mark - GPBAnyRoot

@implementation GPBAnyRoot

@end

#pragma mark - GPBAnyRoot_FileDescriptor

static GPBFileDescriptor *GPBAnyRoot_FileDescriptor(void) {
  // This is called by +initialize so there is no need to worry
  // about thread safety of the singleton.
  static GPBFileDescriptor *descriptor = NULL;
  if (!descriptor) {
    GPBDebugCheckRuntimeVersion();
    descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.protobuf"
                                                     syntax:GPBFileSyntaxProto3];
  }
  return descriptor;
}

#pragma mark - GPBAny

@implementation GPBAny

@dynamic typeURL;
@dynamic value;

typedef struct GPBAny__storage_ {
  uint32_t _has_storage_[1];
  NSString *typeURL;
  NSData *value;
} GPBAny__storage_;

// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
  static GPBDescriptor *descriptor = nil;
  if (!descriptor) {
    static GPBMessageFieldDescription fields[] = {
      {
        .name = "typeURL",
        .number = GPBAny_FieldNumber_TypeURL,
        .hasIndex = 0,
        .flags = GPBFieldOptional | GPBFieldTextFormatNameCustom,
        .dataType = GPBDataTypeString,
        .offset = offsetof(GPBAny__storage_, typeURL),
        .defaultValue.valueString = nil,
        .dataTypeSpecific.className = NULL,
        .fieldOptions = NULL,
      },
      {
        .name = "value",
        .number = GPBAny_FieldNumber_Value,
        .hasIndex = 1,
        .flags = GPBFieldOptional,
        .dataType = GPBDataTypeBytes,
        .offset = offsetof(GPBAny__storage_, value),
        .defaultValue.valueData = nil,
        .dataTypeSpecific.className = NULL,
        .fieldOptions = NULL,
      },
    };
#if GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS
    const char *extraTextFormatInfo = NULL;
#else
    static const char *extraTextFormatInfo = "\001\001\004\241!!\000";
#endif  // GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS
    GPBDescriptor *localDescriptor =
        [GPBDescriptor allocDescriptorForClass:[GPBAny class]
                                     rootClass:[GPBAnyRoot class]
                                          file:GPBAnyRoot_FileDescriptor()
                                        fields:fields
                                    fieldCount:sizeof(fields) / sizeof(GPBMessageFieldDescription)
                                        oneofs:NULL
                                    oneofCount:0
                                         enums:NULL
                                     enumCount:0
                                        ranges:NULL
                                    rangeCount:0
                                   storageSize:sizeof(GPBAny__storage_)
                                    wireFormat:NO
                           extraTextFormatInfo:extraTextFormatInfo];
    NSAssert(descriptor == nil, @"Startup recursed!");
    descriptor = localDescriptor;
  }
  return descriptor;
}

@end


// @@protoc_insertion_point(global_scope)