18 #import "OFEnumerator.h" 20 OF_ASSUME_NONNULL_BEGIN
31 void *
_Nullable (*_Nullable retain)(
void *_Nullable object);
33 void (*_Nullable release)(
void *_Nullable object);
35 uint32_t (*_Nullable hash)(
void *_Nullable object);
37 bool (*_Nullable equal)(
void *_Nullable object1,
38 void *_Nullable object2);
74 struct of_map_table_bucket *_Nonnull *_Nullable _buckets;
75 uint32_t _count, _capacity;
77 unsigned long _mutations;
114 capacity: (
size_t)capacity;
116 -
init OF_UNAVAILABLE;
141 capacity: (
size_t)capacity OF_DESIGNATED_INITIALIZER;
156 - (nullable
void *)objectForKey: (
void *)key;
164 - (void)setObject: (
void *)object
172 - (void)removeObjectForKey: (
void *)key;
186 - (bool)containsObject: (nullable
void *)object;
196 - (bool)containsObjectIdenticalTo: (nullable
void *)object;
214 #ifdef OF_HAVE_BLOCKS 220 - (void)enumerateKeysAndObjectsUsingBlock:
241 struct of_map_table_bucket *_Nonnull *_Nullable _buckets;
243 unsigned long _mutations;
244 unsigned long *_Nullable _mutationsPtr;
248 -
init OF_UNAVAILABLE;
255 - (nullable
void *)nextObject;
264 OF_ASSUME_NONNULL_END
of_map_table_functions_t keyFunctions
Definition: OFMapTable.h:84
OFMapTableEnumerator * keyEnumerator()
Returns an OFMapTableEnumerator to enumerate through the map table's keys.
Definition: OFMapTable.m:576
A struct describing the functions to be used by the map table.
Definition: OFMapTable.h:29
OFMapTableEnumerator * objectEnumerator()
Returns an OFMapTableEnumerator to enumerate through the map table's objects.
Definition: OFMapTable.m:585
size_t count()
Returns the number of objects in the map table.
Definition: OFMapTable.m:260
A class which provides methods to enumerate through an OFMapTable's keys or objects.
Definition: OFMapTable.h:239
id init()
Initializes an already allocated object.
Definition: OFObject.m:488
A protocol for the creation of copies.
Definition: OFObject.h:914
A protocol for fast enumeration.
Definition: OFEnumerator.h:105
void(^ of_map_table_enumeration_block_t)(void *key, void *object, bool *stop)
A block for enumerating an OFMapTable.
Definition: OFMapTable.h:50
void *_Nonnull(^ of_map_table_replace_block_t)(void *key, void *object)
A block for replacing objects in an OFMapTable.
Definition: OFMapTable.h:60
The root class for all other classes inside ObjFW.
Definition: OFObject.h:379
void removeAllObjects()
Removes all objects.
Definition: OFMapTable.m:513
A class similar to OFDictionary, but providing more options how keys and objects should be retained...
Definition: OFMapTable.h:71
of_map_table_functions_t objectFunctions
Definition: OFMapTable.h:89
void *_Nullable(* _Nullable)(void *_Nullable object)
Definition: OFMapTable.h:31