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