10 #ifndef K_API_ARRAY_LIST_H
11 #define K_API_ARRAY_LIST_H
346 #define kArrayList_AddCount_(LIST, C) kxArrayList_AddCount_(LIST, C)
347 #define kArrayList_RemoveCount_(LIST, C) kxArrayList_RemoveCount_(LIST, C)
348 #define kArrayList_Clear_(LIST) kxArrayList_Clear_(LIST)
350 #define kArrayList_ItemType_(LIST) kxArrayList_ItemType_(LIST)
351 #define kArrayList_ItemSize_(LIST) kxArrayList_ItemSize_(LIST)
352 #define kArrayList_Count_(LIST) kxArrayList_Count_(LIST)
353 #define kArrayList_Capacity_(LIST) kxArrayList_Capacity_(LIST)
355 #define kArrayList_Data_(LIST) kxArrayList_Data_(LIST)
356 #define kArrayList_DataSize_(LIST) kxArrayList_DataSize_(LIST)
358 #define kArrayList_At_(LIST, INDEX) kxArrayList_At_(LIST, INDEX)
360 #define kArrayList_First_(LIST) kxArrayList_First_(LIST)
361 #define kArrayList_Last_(LIST) kxArrayList_Last_(LIST)
363 #define kArrayList_Begin_(LIST) kxArrayList_Begin_(LIST)
364 #define kArrayList_End_(LIST) kxArrayList_End_(LIST)
366 #define kArrayList_RBegin_(LIST) kxArrayList_RBegin_(LIST)
367 #define kArrayList_REnd_(LIST) kxArrayList_REnd_(LIST)
369 #define kArrayList_As_(LIST, INDEX, TYPE) kxArrayList_As_(LIST, INDEX, TYPE)
373 #include <kApi/Data/kArrayList.x.h>
kStatus kArrayList_Construct(kArrayList *list, kType itemType, kSize initialCapacity, kAlloc allocator)
Constructs a kArrayList object.
kStatus kArrayList_Item(kArrayList list, kSize index, void *item)
Gets the value of an item.
kStatus kArrayList_SetItem(kArrayList list, kSize index, const void *item)
Sets the value of an item.
kStatus kArrayList_Attach(kArrayList list, void *items, kType itemType, kSize capacity)
Attaches the list object to an external buffer.
Represents an unsigned integer that can store a pointer address.
Abstract base class for memory allocator types.
kSize kArrayList_Capacity(kArrayList list)
Returns the number of elements for which space has been allocated.
kSize kArrayList_DataSize(kArrayList list)
Returns the total size of list data (Count x ItemSize), in bytes.
kStatus kArrayList_Purge(kArrayList list)
Disposes any elements in the list and sets the count of list items to zero.
void * kArrayList_Data(kArrayList list)
Returns a pointer to the list item buffer.
kSize kArrayList_Count(kArrayList list)
Returns the current count of items in the list.
kStatus kArrayList_AddCount(kArrayList list, kSize count)
Increases the list count by the specified amount.
kStatus kArrayList_Add(kArrayList list, const void *item)
Adds the specified item to the end of the list.
kSize kArrayList_ItemSize(kArrayList list)
Returns the list element size.
kStatus kArrayList_Remove(kArrayList list, kSize index, void *item)
Removes an item from the list at the specified index.
void * kArrayList_At(kArrayList list, kSize index)
Returns a pointer to the specified item in the list buffer.
kType kArrayList_ItemType(kArrayList list)
Returns the list element type.
kStatus kArrayList_Zero(kArrayList list)
Sets the memory for all list elements to zero.
kStatus kArrayList_Import(kArrayList list, const void *items, kType itemType, kSize count)
Copies the specified items into the list, replacing existing contents.
Essential API declarations.
kStatus kArrayList_Resize(kArrayList list, kSize count)
Sets the current count of list items to the specified value.
kStatus kArrayList_Assign(kArrayList list, kArrayList source)
Performs a shallow copy of the source list.
Represents metadata about a type (class, interface, or value).
Represents a list implemented with a dynamic array.
kStatus kArrayList_Reserve(kArrayList list, kSize capacity)
Ensures that capacity is reserved for at least the specified number of list items.
kStatus kArrayList_Allocate(kArrayList list, kType itemType, kSize initialCapacity)
Reallocates the list item buffer.
Represents an enumeration of error codes.
kStatus kArrayList_RemoveCount(kArrayList list, kSize count)
Decreases the list count by the specified amount.
kStatus kArrayList_Insert(kArrayList list, kSize before, const void *item)
Inserts an item into the list at the specified position.
kStatus kArrayList_Append(kArrayList list, const void *items, kSize count)
Appends the specified items to the list.
kStatus kArrayList_Clear(kArrayList list)
Sets the count of list items to zero.