Zen API

- Home
- Topics
- Types
- Files

All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kList.h
Go to the documentation of this file.
1
10 #ifndef K_API_LIST_H
11 #define K_API_LIST_H
12
13 #include <kApi/kApiDef.h>
14
15 kBeginHeader()
16
17
82 //typedef kObject kList; --forward-declared in kApiDef.x.h
83
84
90 typedef kPointer kListItem;
91
102 kFx(kStatus) kList_Construct(kList* list, kType itemType, kSize initialCapacity, kAlloc allocator);
103
115 kFx(kStatus) kList_Allocate(kList list, kType itemType, kSize initialCapacity);
116
128 kFx(kStatus) kList_Assign(kList list, kList source);
129
137 kFx(kType) kList_ItemType(kList list);
138
146 kFx(kSize) kList_Count(kList list);
147
155 kFx(kSize) kList_Capacity(kList list);
156
168 kFx(kStatus) kList_Add(kList list, const void* itemContent, kListItem* item);
169
182 kFx(kStatus) kList_Insert(kList list, kListItem before, const void* itemContent, kListItem* item);
183
192 kFx(kStatus) kList_Remove(kList list, kListItem item);
193
203 kFx(kStatus) kList_SetItem(kList list, kListItem item, const void* content);
204
214 kFx(kStatus) kList_Item(kList list, kListItem item, void* content);
215
224 kFx(kStatus) kList_Reserve(kList list, kSize capacity);
225
233 kFx(kStatus) kList_Clear(kList list);
234
242 kFx(kStatus) kList_Purge(kList list);
243
251 kFx(kListItem) kList_First(kList list);
252
260 kFx(kListItem) kList_Last(kList list);
261
270 kFx(kListItem) kList_Next(kList list, kListItem item);
271
280 kFx(kListItem) kList_Previous(kList list, kListItem item);
281
292 kFx(kListItem) kList_FindIndex(kList list, kSize index);
293
302 kFx(void*) kList_At(kList list, kListItem item);
303
312 kFx(void*) kList_AtIndex(kList list, kSize index);
313
316 #define kList_ItemType_(LIST) kxList_ItemType_(LIST)
317 #define kList_Count_(LIST) kxList_Count_(LIST)
318 #define kList_Capacity_(LIST) kxList_Capacity_(LIST)
319
320 #define kList_First_(LIST) kxList_First_(LIST)
321 #define kList_Last_(LIST) kxList_Last_(LIST)
322
323 #define kList_Next_(LIST, ITEM) kxList_Next_(LIST, ITEM)
324 #define kList_Previous_(LIST, ITEM) kxList_Previous_(LIST, ITEM)
325
326 #define kList_At_(LIST, ITEM) kxList_At_(LIST, ITEM)
327
328
329 #define kList_As_(LIST, ITEM, TYPE) kxList_As_(LIST, ITEM, TYPE)
330
333 kEndHeader()
334
335 #include <kApi/Data/kList.x.h>
336
337 #endif
kList::kList_Previous
kListItem kList_Previous(kList list, kListItem item)
Given a list item, gets a reference to the previous list item.
kList::kList_AtIndex
void * kList_AtIndex(kList list, kSize index)
Returns a pointer to the content associated with a list item at the specified index.
kPointer
Represents a void pointer.
kList::kList_Count
kSize kList_Count(kList list)
Returns the count of list elements.
kSize
Represents an unsigned integer that can store a pointer address.
kList::kList_Last
kListItem kList_Last(kList list)
Gets a reference to the last list item.
kAlloc
Abstract base class for memory allocator types.
kList::kList_Capacity
kSize kList_Capacity(kList list)
Returns the number of elements for which space has been allocated.
kList::kList_Clear
kStatus kList_Clear(kList list)
Sets the count of list items to zero.
kList::kList_First
kListItem kList_First(kList list)
Gets a reference to the first list item.
kList::kList_Insert
kStatus kList_Insert(kList list, kListItem before, const void *itemContent, kListItem *item)
Inserts an item into the list before the specified list item.
kList::kList_At
void * kList_At(kList list, kListItem item)
Returns a pointer to the content associated with a list item.
kList::kList_ItemType
kType kList_ItemType(kList list)
Returns the item type.
kList::kList_Assign
kStatus kList_Assign(kList list, kList source)
Performs a shallow copy of the source list.
kList::kList_Reserve
kStatus kList_Reserve(kList list, kSize capacity)
Ensures that capacity is reserved for at least the specified number of list items.
kApiDef.h
Core Zen type declarations.
kList::kList_FindIndex
kListItem kList_FindIndex(kList list, kSize index)
Finds a reference to the list item at the specified index.
kList::kList_Next
kListItem kList_Next(kList list, kListItem item)
Given a list item, gets a reference to the next list item.
kList::kList_Allocate
kStatus kList_Allocate(kList list, kType itemType, kSize initialCapacity)
Reallocates the list.
kList::kList_Purge
kStatus kList_Purge(kList list)
Disposes any elements in the list and sets the count of list items to zero.
kType
Represents metadata about a type (class, interface, or value).
kList::kList_Construct
kStatus kList_Construct(kList *list, kType itemType, kSize initialCapacity, kAlloc allocator)
Constructs a kList object.
kList
Represents a doubly-linked list.
kList::kList_Remove
kStatus kList_Remove(kList list, kListItem item)
Removes the specified item from the list.
kStatus
Represents an error code.
kList::kList_Add
kStatus kList_Add(kList list, const void *itemContent, kListItem *item)
Adds a new item to the end of the list.
kList::kList_SetItem
kStatus kList_SetItem(kList list, kListItem item, const void *content)
Sets the content associated with a list item.
kList::kList_Item
kStatus kList_Item(kList list, kListItem item, void *content)
Gets the content associated with a list item.