Zen API

- Home
- Topics
- Types
- Files

All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kArrayList.h
Go to the documentation of this file.
1
10 #ifndef K_API_ARRAY_LIST_H
11 #define K_API_ARRAY_LIST_H
12
13 #include <kApi/kApiDef.h>
14
15 kBeginHeader()
16
17
79 //typedef kObject kArrayList; --forward-declared in kApiDef.x.h
80
81
91 kFx(kStatus) kArrayList_Construct(kArrayList* list, kType itemType, kSize initialCapacity, kAlloc allocator);
92
102 kFx(kStatus) kArrayList_Allocate(kArrayList list, kType itemType, kSize initialCapacity);
103
116 kFx(kStatus) kArrayList_Attach(kArrayList list, void* items, kType itemType, kSize capacity);
117
130 kFx(kStatus) kArrayList_Import(kArrayList list, const void* items, kType itemType, kSize count);
131
141 kFx(kStatus) kArrayList_Append(kArrayList list, const void* items, kSize count);
142
154 kFx(kStatus) kArrayList_Assign(kArrayList list, kArrayList source);
155
163 kFx(kStatus) kArrayList_Clear(kArrayList list);
164
172 kFx(kStatus) kArrayList_Purge(kArrayList list);
173
181 kFx(kStatus) kArrayList_Zero(kArrayList list);
182
191 kFx(kStatus) kArrayList_Add(kArrayList list, const void* item);
192
204 kFx(kStatus) kArrayList_Insert(kArrayList list, kSize before, const void* item);
205
215 kFx(kStatus) kArrayList_Remove(kArrayList list, kSize index, void* item);
216
226 kFx(kStatus) kArrayList_SetItem(kArrayList list, kSize index, const void* item);
227
237 kFx(kStatus) kArrayList_Item(kArrayList list, kSize index, void* item);
238
249 kFx(kStatus) kArrayList_Resize(kArrayList list, kSize count);
250
262 kFx(kStatus) kArrayList_AddCount(kArrayList list, kSize count);
263
272 kFx(kStatus) kArrayList_RemoveCount(kArrayList list, kSize count);
273
284 kFx(kStatus) kArrayList_Reserve(kArrayList list, kSize capacity);
285
293 kFx(void*) kArrayList_Data(kArrayList list);
294
302 kFx(kSize) kArrayList_DataSize(kArrayList list);
303
312 kFx(void*) kArrayList_At(kArrayList list, kSize index);
313
321 kFx(kType) kArrayList_ItemType(kArrayList list);
322
330 kFx(kSize) kArrayList_ItemSize(kArrayList list);
331
339 kFx(kSize) kArrayList_Count(kArrayList list);
340
348 kFx(kSize) kArrayList_Capacity(kArrayList list);
349
352 #define kArrayList_AddCount_(LIST, C) kxArrayList_AddCount_(LIST, C)
353 #define kArrayList_RemoveCount_(LIST, C) kxArrayList_RemoveCount_(LIST, C)
354 #define kArrayList_Clear_(LIST) kxArrayList_Clear_(LIST)
355
356 #define kArrayList_ItemType_(LIST) kxArrayList_ItemType_(LIST)
357 #define kArrayList_ItemSize_(LIST) kxArrayList_ItemSize_(LIST)
358 #define kArrayList_Count_(LIST) kxArrayList_Count_(LIST)
359 #define kArrayList_Capacity_(LIST) kxArrayList_Capacity_(LIST)
360
361 #define kArrayList_Data_(LIST) kxArrayList_Data_(LIST)
362 #define kArrayList_DataSize_(LIST) kxArrayList_DataSize_(LIST)
363
364 #define kArrayList_At_(LIST, INDEX) kxArrayList_At_(LIST, INDEX)
365
366 #define kArrayList_First_(LIST) kxArrayList_First_(LIST)
367 #define kArrayList_Last_(LIST) kxArrayList_Last_(LIST)
368
369 #define kArrayList_Begin_(LIST) kxArrayList_Begin_(LIST)
370 #define kArrayList_End_(LIST) kxArrayList_End_(LIST)
371
372 #define kArrayList_RBegin_(LIST) kxArrayList_RBegin_(LIST)
373 #define kArrayList_REnd_(LIST) kxArrayList_REnd_(LIST)
374
375 #define kArrayList_As_(LIST, INDEX, TYPE) kxArrayList_As_(LIST, INDEX, TYPE)
376
377
379 kEndHeader()
380
381 #include <kApi/Data/kArrayList.x.h>
382
383 #endif
kArrayList::kArrayList_Resize
kStatus kArrayList_Resize(kArrayList list, kSize count)
Sets the current count of list items to the specified value.
kArrayList::kArrayList_Insert
kStatus kArrayList_Insert(kArrayList list, kSize before, const void *item)
Inserts an item into the list at the specified position.
kArrayList::kArrayList_DataSize
kSize kArrayList_DataSize(kArrayList list)
Returns the total size of list data (Count x ItemSize), in bytes.
kArrayList::kArrayList_Attach
kStatus kArrayList_Attach(kArrayList list, void *items, kType itemType, kSize capacity)
Attaches the list object to an external buffer.
kArrayList::kArrayList_Purge
kStatus kArrayList_Purge(kArrayList list)
Disposes any elements in the list and sets the count of list items to zero.
kArrayList::kArrayList_Append
kStatus kArrayList_Append(kArrayList list, const void *items, kSize count)
Appends the specified items to the list.
kArrayList::kArrayList_Data
void * kArrayList_Data(kArrayList list)
Returns a pointer to the list item buffer.
kArrayList::kArrayList_Add
kStatus kArrayList_Add(kArrayList list, const void *item)
Adds the specified item to the end of the list.
kArrayList::kArrayList_Reserve
kStatus kArrayList_Reserve(kArrayList list, kSize capacity)
Ensures that capacity is reserved for at least the specified number of list items.
kSize
Represents an unsigned integer that can store a pointer address.
kAlloc
Abstract base class for memory allocator types.
kArrayList::kArrayList_Remove
kStatus kArrayList_Remove(kArrayList list, kSize index, void *item)
Removes an item from the list at the specified index.
kArrayList::kArrayList_ItemType
kType kArrayList_ItemType(kArrayList list)
Returns the list element type.
kArrayList::kArrayList_SetItem
kStatus kArrayList_SetItem(kArrayList list, kSize index, const void *item)
Sets the value of an item.
kArrayList::kArrayList_Allocate
kStatus kArrayList_Allocate(kArrayList list, kType itemType, kSize initialCapacity)
Reallocates the list item buffer.
kArrayList::kArrayList_Construct
kStatus kArrayList_Construct(kArrayList *list, kType itemType, kSize initialCapacity, kAlloc allocator)
Constructs a kArrayList object.
kArrayList::kArrayList_Capacity
kSize kArrayList_Capacity(kArrayList list)
Returns the number of elements for which space has been allocated.
kArrayList::kArrayList_ItemSize
kSize kArrayList_ItemSize(kArrayList list)
Returns the list element size.
kApiDef.h
Core Zen type declarations.
kArrayList::kArrayList_AddCount
kStatus kArrayList_AddCount(kArrayList list, kSize count)
Increases the list count by the specified amount.
kArrayList::kArrayList_Count
kSize kArrayList_Count(kArrayList list)
Returns the current count of items in the list.
kArrayList::kArrayList_Clear
kStatus kArrayList_Clear(kArrayList list)
Sets the count of list items to zero.
kArrayList::kArrayList_Item
kStatus kArrayList_Item(kArrayList list, kSize index, void *item)
Gets the value of an item.
kType
Represents metadata about a type (class, interface, or value).
kArrayList::kArrayList_Zero
kStatus kArrayList_Zero(kArrayList list)
Sets the memory for all list elements to zero.
kArrayList
Represents a list implemented with a dynamic array.
kArrayList::kArrayList_Assign
kStatus kArrayList_Assign(kArrayList list, kArrayList source)
Performs a shallow copy of the source list.
kStatus
Represents an error code.
kArrayList::kArrayList_Import
kStatus kArrayList_Import(kArrayList list, const void *items, kType itemType, kSize count)
Copies the specified items into the list, replacing existing contents.
kArrayList::kArrayList_RemoveCount
kStatus kArrayList_RemoveCount(kArrayList list, kSize count)
Decreases the list count by the specified amount.
kArrayList::kArrayList_At
void * kArrayList_At(kArrayList list, kSize index)
Returns a pointer to the specified item in the list buffer.