00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include <stdarg.h>
00013
00014 #import "OFObject.h"
00015 #import "OFEnumerator.h"
00016
00017 @class OFArray;
00018
00020 struct of_dictionary_bucket
00021 {
00022 OFObject <OFCopying> *key;
00023 OFObject *object;
00024 uint32_t hash;
00025 };
00027
00031 @interface OFDictionary: OFObject <OFCopying, OFMutableCopying,
00032 OFFastEnumeration>
00033 {
00034 struct of_dictionary_bucket **data;
00035 uint32_t size;
00036 size_t count;
00037 }
00038
00039 #ifdef OF_HAVE_PROPERTIES
00040 @property (readonly) size_t count;
00041 #endif
00042
00048 + dictionary;
00049
00056 + dictionaryWithDictionary: (OFDictionary*)dict;
00057
00065 + dictionaryWithObject: (OFObject*)obj
00066 forKey: (OFObject <OFCopying>*)key;
00067
00075 + dictionaryWithObjects: (OFArray*)objs
00076 forKeys: (OFArray*)keys;
00077
00084 + dictionaryWithKeysAndObjects: (OFObject <OFCopying>*)key, ...;
00085
00091 - init;
00092
00100 - initWithDictionary: (OFDictionary*)dict;
00101
00110 - initWithObject: (OFObject*)obj
00111 forKey: (OFObject <OFCopying>*)key;
00112
00121 - initWithObjects: (OFArray*)objs
00122 forKeys: (OFArray*)keys;
00123
00131 - initWithKeysAndObjects: (OFObject <OFCopying>*)first, ...;
00132
00141 - initWithKey: (OFObject <OFCopying>*)first
00142 argList: (va_list)args;
00143
00148 - (id)objectForKey: (OFObject <OFCopying>*)key;
00149
00153 - (size_t)count;
00154
00158 - (OFEnumerator*)objectEnumerator;
00159
00163 - (OFEnumerator*)keyEnumerator;
00164 @end
00165
00167 @interface OFDictionaryEnumerator: OFEnumerator
00168 {
00169 struct of_dictionary_bucket **data;
00170 uint32_t size;
00171 unsigned long mutations;
00172 unsigned long *mutationsPtr;
00173 uint32_t pos;
00174 }
00175
00176 - initWithData: (struct of_dictionary_bucket**)data
00177 size: (uint32_t)size
00178 mutationsPointer: (unsigned long*)mutations_ptr;
00179 @end
00180
00181 @interface OFDictionaryObjectEnumerator: OFDictionaryEnumerator
00182 @end
00183
00184 @interface OFDictionaryKeyEnumerator: OFDictionaryEnumerator
00185 @end
00187
00188 #import "OFMutableDictionary.h"
00189
00190 extern struct of_dictionary_bucket of_dictionary_deleted_bucket;