Added generics support to NSMapTable

Also updated NSMapTable and NSHashTable to use "instancetype".
This commit is contained in:
Frederik Seiffert 2019-10-25 11:03:04 +02:00
parent 517f2212c5
commit c22f24de73
3 changed files with 37 additions and 29 deletions

View file

@ -63,23 +63,23 @@ typedef NSUInteger NSHashTableOptions;
@interface GS_GENERIC_CLASS(NSHashTable, ElementT) : NSObject <NSCopying, NSCoding, NSFastEnumeration>
+ (id) hashTableWithOptions: (NSPointerFunctionsOptions)options;
+ (instancetype) hashTableWithOptions: (NSPointerFunctionsOptions)options;
+ (id) hashTableWithWeakObjects;
+ (instancetype) hashTableWithWeakObjects;
/**
* Creates a hash table that uses zeroing weak references (either using the
* automatic reference counting or garbage collection mechanism, depending on
* which mode this framework is compiled in) so that objects are removed when
* their last other reference disappears.
*/
+ (id) weakObjectsHashTable;
+ (instancetype) weakObjectsHashTable;
- (id) initWithOptions: (NSPointerFunctionsOptions)options
capacity: (NSUInteger)initialCapacity;
- (instancetype) initWithOptions: (NSPointerFunctionsOptions)options
capacity: (NSUInteger)initialCapacity;
- (id) initWithPointerFunctions: (NSPointerFunctions*)functions
capacity: (NSUInteger)initialCapacity;
- (instancetype) initWithPointerFunctions: (NSPointerFunctions*)functions
capacity: (NSUInteger)initialCapacity;
/** Adds the object to the receiver.
*/