From 1dcc329427fd103a0abd96ab787270f5d0a31861 Mon Sep 17 00:00:00 2001 From: Thomas Van Lenten Date: Thu, 21 May 2015 17:14:52 -0400 Subject: Objective C Second Alpha Drop - Style fixups in the code. - map<> serialization fixes and more tests. - Autocreation of map<> fields (to match repeated fields). - @@protoc_insertion_point(global_scope|imports). - Fixup proto2 syntax extension support. - Move all startup code to +initialize so it happen on class usage and not app startup. - Have generated headers use forward declarations and move imports into generated code, reduces what is need at compile time to speed up compiled and avoid pointless rippling of rebuilds. --- objectivec/GPBDictionary_PackagePrivate.h | 558 +++++++++++++----------------- 1 file changed, 234 insertions(+), 324 deletions(-) (limited to 'objectivec/GPBDictionary_PackagePrivate.h') diff --git a/objectivec/GPBDictionary_PackagePrivate.h b/objectivec/GPBDictionary_PackagePrivate.h index 54b37dd8..9c3c5915 100644 --- a/objectivec/GPBDictionary_PackagePrivate.h +++ b/objectivec/GPBDictionary_PackagePrivate.h @@ -37,6 +37,14 @@ @class GPBExtensionRegistry; @class GPBFieldDescriptor; +@protocol GPBDictionaryInternalsProtocol +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field; +- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@end + //%PDDM-DEFINE DICTIONARY_PRIV_INTERFACES_FOR_POD_KEY(KEY_NAME) //%DICTIONARY_POD_PRIV_INTERFACES_FOR_KEY(KEY_NAME) //%DICTIONARY_PRIVATE_INTERFACES(KEY_NAME, Object, Object) @@ -51,12 +59,10 @@ //%DICTIONARY_PRIVATE_INTERFACES(KEY_NAME, Enum, Enum) //%PDDM-DEFINE DICTIONARY_PRIVATE_INTERFACES(KEY_NAME, VALUE_NAME, HELPER) -//%@interface GPB##KEY_NAME##VALUE_NAME##Dictionary () -//%- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -//%- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream -//% asField:(GPBFieldDescriptor *)field; -//%- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -//%- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +//%@interface GPB##KEY_NAME##VALUE_NAME##Dictionary () { +//% @package +//% GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +//%} //%EXTRA_DICTIONARY_PRIVATE_INTERFACES_##HELPER()@end //% @@ -76,79 +82,61 @@ //%PDDM-EXPAND DICTIONARY_PRIV_INTERFACES_FOR_POD_KEY(UInt32) // This block of code is generated, do not edit it directly. -@interface GPBUInt32UInt32Dictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBUInt32UInt32Dictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBUInt32Int32Dictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBUInt32Int32Dictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBUInt32UInt64Dictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBUInt32UInt64Dictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBUInt32Int64Dictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBUInt32Int64Dictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBUInt32BoolDictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBUInt32BoolDictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBUInt32FloatDictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBUInt32FloatDictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBUInt32DoubleDictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBUInt32DoubleDictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBUInt32EnumDictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBUInt32EnumDictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} - (NSData *)serializedDataForUnknownValue:(int32_t)value forKey:(GPBValue *)key keyType:(GPBType)keyType; @end -@interface GPBUInt32ObjectDictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBUInt32ObjectDictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} - (BOOL)isInitialized; - (instancetype)deepCopyWithZone:(NSZone *)zone __attribute__((ns_returns_retained)); @@ -157,79 +145,61 @@ //%PDDM-EXPAND DICTIONARY_PRIV_INTERFACES_FOR_POD_KEY(Int32) // This block of code is generated, do not edit it directly. -@interface GPBInt32UInt32Dictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBInt32UInt32Dictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBInt32Int32Dictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBInt32Int32Dictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBInt32UInt64Dictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBInt32UInt64Dictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBInt32Int64Dictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBInt32Int64Dictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBInt32BoolDictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBInt32BoolDictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBInt32FloatDictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBInt32FloatDictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBInt32DoubleDictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBInt32DoubleDictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBInt32EnumDictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBInt32EnumDictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} - (NSData *)serializedDataForUnknownValue:(int32_t)value forKey:(GPBValue *)key keyType:(GPBType)keyType; @end -@interface GPBInt32ObjectDictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBInt32ObjectDictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} - (BOOL)isInitialized; - (instancetype)deepCopyWithZone:(NSZone *)zone __attribute__((ns_returns_retained)); @@ -238,79 +208,61 @@ //%PDDM-EXPAND DICTIONARY_PRIV_INTERFACES_FOR_POD_KEY(UInt64) // This block of code is generated, do not edit it directly. -@interface GPBUInt64UInt32Dictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBUInt64UInt32Dictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBUInt64Int32Dictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBUInt64Int32Dictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBUInt64UInt64Dictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBUInt64UInt64Dictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBUInt64Int64Dictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBUInt64Int64Dictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBUInt64BoolDictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBUInt64BoolDictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBUInt64FloatDictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBUInt64FloatDictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBUInt64DoubleDictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBUInt64DoubleDictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBUInt64EnumDictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBUInt64EnumDictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} - (NSData *)serializedDataForUnknownValue:(int32_t)value forKey:(GPBValue *)key keyType:(GPBType)keyType; @end -@interface GPBUInt64ObjectDictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBUInt64ObjectDictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} - (BOOL)isInitialized; - (instancetype)deepCopyWithZone:(NSZone *)zone __attribute__((ns_returns_retained)); @@ -319,79 +271,61 @@ //%PDDM-EXPAND DICTIONARY_PRIV_INTERFACES_FOR_POD_KEY(Int64) // This block of code is generated, do not edit it directly. -@interface GPBInt64UInt32Dictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBInt64UInt32Dictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBInt64Int32Dictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBInt64Int32Dictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBInt64UInt64Dictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBInt64UInt64Dictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBInt64Int64Dictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBInt64Int64Dictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBInt64BoolDictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBInt64BoolDictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBInt64FloatDictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBInt64FloatDictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBInt64DoubleDictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBInt64DoubleDictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBInt64EnumDictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBInt64EnumDictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} - (NSData *)serializedDataForUnknownValue:(int32_t)value forKey:(GPBValue *)key keyType:(GPBType)keyType; @end -@interface GPBInt64ObjectDictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBInt64ObjectDictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} - (BOOL)isInitialized; - (instancetype)deepCopyWithZone:(NSZone *)zone __attribute__((ns_returns_retained)); @@ -400,79 +334,61 @@ //%PDDM-EXPAND DICTIONARY_PRIV_INTERFACES_FOR_POD_KEY(Bool) // This block of code is generated, do not edit it directly. -@interface GPBBoolUInt32Dictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBBoolUInt32Dictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBBoolInt32Dictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBBoolInt32Dictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBBoolUInt64Dictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBBoolUInt64Dictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBBoolInt64Dictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBBoolInt64Dictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBBoolBoolDictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBBoolBoolDictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBBoolFloatDictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBBoolFloatDictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBBoolDoubleDictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBBoolDoubleDictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBBoolEnumDictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBBoolEnumDictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} - (NSData *)serializedDataForUnknownValue:(int32_t)value forKey:(GPBValue *)key keyType:(GPBType)keyType; @end -@interface GPBBoolObjectDictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBBoolObjectDictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} - (BOOL)isInitialized; - (instancetype)deepCopyWithZone:(NSZone *)zone __attribute__((ns_returns_retained)); @@ -481,68 +397,52 @@ //%PDDM-EXPAND DICTIONARY_POD_PRIV_INTERFACES_FOR_KEY(String) // This block of code is generated, do not edit it directly. -@interface GPBStringUInt32Dictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBStringUInt32Dictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBStringInt32Dictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBStringInt32Dictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBStringUInt64Dictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBStringUInt64Dictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBStringInt64Dictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBStringInt64Dictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBStringBoolDictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBStringBoolDictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBStringFloatDictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBStringFloatDictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBStringDoubleDictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBStringDoubleDictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} @end -@interface GPBStringEnumDictionary () -- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; -- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream - asField:(GPBFieldDescriptor *)field; -- (void)setGPBValue:(GPBValue *)value forGPBValueKey:(GPBValue *)key; -- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@interface GPBStringEnumDictionary () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} - (NSData *)serializedDataForUnknownValue:(int32_t)value forKey:(GPBValue *)key keyType:(GPBType)keyType; @@ -550,6 +450,16 @@ //%PDDM-EXPAND-END (6 expansions) +#pragma mark - NSDictionary Subclass + +@interface GPBAutocreatedDictionary : NSMutableDictionary { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +#pragma mark - Helpers + CF_EXTERN_C_BEGIN // Helper to compute size when an NSDictionary is used for the map instead -- cgit v1.2.3