vvopensource
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Groups Pages
MutLockDict.h
1 
2 #if IPHONE
3 #import <UIKit/UIKit.h>
4 #else
5 #import <Cocoa/Cocoa.h>
6 #endif
7 #import <pthread.h>
8 
9 
10 
12 
17 @interface MutLockDict : NSObject {
18  NSMutableDictionary *dict;
19  pthread_rwlock_t dictLock;
20 }
21 
23 + (id) dictionaryWithCapacity:(NSInteger)c;
25 + (id) dictionaryWithDict:(NSDictionary *)d;
27 - (id) initWithCapacity:(NSInteger)c;
28 
30 - (void) rdlock;
32 - (void) wrlock;
34 - (void) unlock;
35 
37 - (NSMutableDictionary *) dict;
39 - (NSMutableDictionary *) createDictCopy;
41 - (NSMutableDictionary *) lockCreateDictCopy;
42 
44 - (void) setObject:(id)o forKey:(NSString *)s;
46 - (void) lockSetObject:(id)o forKey:(NSString *)s;
48 - (void) setValue:(id)v forKey:(NSString *)s;
50 - (void) lockSetValue:(id)v forKey:(NSString *)s;
52 - (void) removeAllObjects;
54 - (void) lockRemoveAllObjects;
56 - (id) objectForKey:(NSString *)k;
58 - (id) lockObjectForKey:(NSString *)k;
60 - (void) removeObjectForKey:(NSString *)k;
62 - (void) lockRemoveObjectForKey:(NSString *)k;
64 - (void) addEntriesFromDictionary:(NSDictionary *)otherDictionary;
66 - (void) lockAddEntriesFromDictionary:(NSDictionary *)otherDictionary;
68 - (NSArray *) allKeys;
70 - (NSArray *) lockAllKeys;
72 - (NSArray *) allValues;
74 - (NSArray *) lockAllValues;
75 
77 - (void) makeObjectsPerformSelector:(SEL)s;
79 - (void) lockMakeObjectsPerformSelector:(SEL)s;
80 
82 - (NSInteger) count;
84 - (NSInteger) lockCount;
85 
86 @end
NSMutableDictionary * dict()
returns the NSMutableDictionary used as the basis for this class- useful if you want to use fast iter...
Definition: MutLockDict.m:76
MutLockDict is a thread-safe version of NSMutableDictionary.
Definition: MutLockDict.h:17