Add methods from 10.8 for using zeroing weak references in collections.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35877 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
David Chisnall 2012-12-11 17:49:28 +00:00
parent 66364a9465
commit 69d4344a0a
8 changed files with 110 additions and 10 deletions

View file

@ -52,7 +52,9 @@ enum {
NSMapTableCopyIn
= NSPointerFunctionsCopyIn,
NSMapTableObjectPointerPersonality
= NSPointerFunctionsObjectPointerPersonality
= NSPointerFunctionsObjectPointerPersonality,
NSMapTableWeakMemory
= NSPointerFunctionsWeakMemory
};
typedef NSUInteger NSMapTableOptions;
@ -85,6 +87,27 @@ typedef NSUInteger NSMapTableOptions;
*/
+ (id) mapTableWithWeakToWeakObjects;
/** Convenience method for creating a map table to store object values
* using object keys. The collection will retain both the key and the value.
*/
+ (id) strongToStrongObjectsMapTable;
/** Convenience method for creating a map table to store object values
* using object keys. The collection will retain the key, the value will be a
* zeroing weak reference.
*/
+ (id) strongToWeakObjectsMapTable;
/** Convenience method for creating a map table to store object values
* using object keys. The collection will retain the value, the key will be a
* zeroing weak reference.
*/
+ (id) weakToStrongObjectsMapTable;
/** Convenience method for creating a map table to store object values
* using object keys. The collection will use zeroing weak references for both
* the key and the value.
*/
+ (id) weakToWeakObjectsMapTable;
/** Initialiser using option bitmasks to describe the keys and values.
*/
- (id) initWithKeyOptions: (NSPointerFunctionsOptions)keyOptions