279 #define kMap_KeyType_(MAP) kxMap_KeyType_(MAP)
280 #define kMap_ValueType_(MAP) kxMap_ValueType_(MAP)
281 #define kMap_Count_(MAP) kxMap_Count_(MAP)
284 #define kMap_KeyAs_(MAP, ITEM, TYPE) kxMap_KeyAs_(MAP, ITEM, TYPE)
287 #define kMap_ValueAs_(MAP, ITEM, TYPE) kxMap_ValueAs_(MAP, ITEM, TYPE)
291 #include <kApi/Data/kMap.x.h>
kStatus kMap_SetValue(kMap map, kMapItem item, const void *value)
Sets the value associated with a map item.
Represents a void pointer.
kStatus kMap_Purge(kMap map)
Disposes any elements in the map and sets the count of map items to zero.
kStatus kMap_Add(kMap map, const void *key, const void *value)
Adds a new key-value pair.
kMapItem kMap_First(kMap map)
Gets a reference to the first map item (key-value pair).
Represents an unsigned integer that can store a pointer address.
Abstract base class for memory allocator types.
kStatus kMap_Allocate(kMap map, kType keyType, kType valueType, kSize initialCapacity)
Reallocates the map.
kSize(kCall * kHashFx)(const void *item)
Callback signature to determine hash code of an item.
Definition: kApiDef.h:1020
void * kMap_Value(kMap map, kMapItem item)
Returns a pointer to the value associated with a map item.
kSize kMap_Count(kMap map)
Returns the count of map elements.
kStatus kMap_Clear(kMap map)
Sets the count of map items to zero.
kSize kMap_Capacity(kMap map)
Returns the number of elements for which space has been allocated.
kStatus kMap_SetEqualsFx(kMap map, kEqualsFx function)
Sets a custom key equality comparator.
kStatus kMap_Reserve(kMap map, kSize capacity)
Ensures that capacity is reserved for at least the specified number of map items. ...
kStatus kMap_Remove(kMap map, const void *key, void *oldKey, void *oldValue)
Removes a key-value pair from the map.
Essential API declarations.
kBool(kCall * kEqualsFx)(const void *item1, const void *item2)
Callback signature to determine equality of two items.
Definition: kApiDef.h:1012
kType kMap_ValueType(kMap map)
Returns the value type.
kSize kMap_SetHashFx(kMap map, kHashFx function)
Sets a custom hash code generator.
kStatus kMap_Find(kMap map, const void *key, void *value)
Finds the value associated with the given key.
Represents metadata about a type (class, interface, or value).
kStatus kMap_FindItem(kMap map, const void *key, kMapItem *item)
Finds the map item associated with the given key.
kStatus kMap_Construct(kMap *map, kType keyType, kType valueType, kSize initialCapacity, kAlloc allocator)
Constructs a kMap object.
const void * kMap_Key(kMap map, kMapItem item)
Returns a pointer to the key associated with a map item.
kMapItem kMap_Next(kMap map, kMapItem item)
Given a map item, gets a reference to the next map item.
kStatus kMap_Assign(kMap map, kMap source)
Performs a shallow copy of the source map.
Represents an enumeration of error codes.
kStatus kMap_RemoveItem(kMap map, kMapItem item)
Removes an item from the map.
kType kMap_KeyType(kMap map)
Returns the key type.
Represents a collection of key-value pairs stored in a hash table.
kStatus kMap_Replace(kMap map, const void *key, const void *value)
Adds or replaces a key-value pair.