18 #import "OFEnumerator.h" 20 OF_ASSUME_NONNULL_BEGIN
31 void *_Nonnull (*_Nullable retain)(
void *object);
33 void (*_Nullable release)(
void *object);
35 uint32_t (*_Nullable hash)(
void *object);
37 bool (*_Nullable equal)(
void *object1,
void *object2);
73 struct of_map_table_bucket **_buckets;
74 uint32_t _count, _capacity;
76 unsigned long _mutations;
113 capacity: (
size_t)capacity;
115 -
init OF_UNAVAILABLE;
140 capacity: (
size_t)capacity OF_DESIGNATED_INITIALIZER;
155 - (nullable
void *)objectForKey: (
void *)key;
163 - (void)setObject: (
void *)object
171 - (void)removeObjectForKey: (
void *)key;
185 - (bool)containsObject: (nullable
void *)object;
195 - (bool)containsObjectIdenticalTo: (nullable
void *)object;
213 #ifdef OF_HAVE_BLOCKS 219 - (void)enumerateKeysAndObjectsUsingBlock:
240 struct of_map_table_bucket **_buckets;
242 unsigned long _mutations;
243 unsigned long *_mutationsPtr;
247 -
init OF_UNAVAILABLE;
254 - (
void *)nextObject;
263 OF_ASSUME_NONNULL_END
of_map_table_functions_t keyFunctions
Definition: OFMapTable.h:83
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:238
id init()
Initializes an already allocated object.
Definition: OFObject.m:488
A protocol for the creation of copies.
Definition: OFObject.h:912
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:49
void *_Nonnull(^ of_map_table_replace_block_t)(void *key, void *object)
A block for replacing objects in an OFMapTable.
Definition: OFMapTable.h:59
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:70
of_map_table_functions_t objectFunctions
Definition: OFMapTable.h:88