Zen API

- Home
- Topics
- Types
- Files

All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kQueue.h
Go to the documentation of this file.
1
10 #ifndef K_API_QUEUE_H
11 #define K_API_QUEUE_H
12
13 #include <kApi/kApiDef.h>
14
15 kBeginHeader()
16
17
79 //typedef kObject kQueue; --forward-declared in kApiDef.x.h
80
81
91 kFx(kStatus) kQueue_Construct(kQueue* queue, kType itemType, kSize initialCapacity, kAlloc allocator);
92
102 kFx(kStatus) kQueue_Allocate(kQueue queue, kType itemType, kSize initialCapacity);
103
115 kFx(kStatus) kQueue_Assign(kQueue queue, kQueue source);
116
124 kFx(kStatus) kQueue_Clear(kQueue queue);
125
133 kFx(kStatus) kQueue_Purge(kQueue queue);
134
145 kFx(kStatus) kQueue_Reserve(kQueue queue, kSize capacity);
146
155 kFx(kStatus) kQueue_Add(kQueue queue, const void* item);
156
165 kFx(kStatus) kQueue_Remove(kQueue queue, void* item);
166
176 kFx(kStatus) kQueue_SetItem(kQueue queue, kSize index, const void* item);
177
187 kFx(kStatus) kQueue_Item(kQueue queue, kSize index, void* item);
188
200 kFx(kStatus) kQueue_AddCount(kQueue queue, kSize count);
201
210 kFx(kStatus) kQueue_RemoveCount(kQueue queue, kSize count);
211
220 kFx(void*) kQueue_At(kQueue queue, kSize index);
221
229 kFx(kType) kQueue_ItemType(kQueue queue);
230
238 kFx(kSize) kQueue_ItemSize(kQueue queue);
239
247 kFx(kSize) kQueue_Count(kQueue queue);
248
256 kFx(kSize) kQueue_Capacity(kQueue queue);
257
260 #define kQueue_AddCount_(QUEUE, C) kxQueue_AddCount_(QUEUE, C)
261 #define kQueue_RemoveCount_(QUEUE, C) kxQueue_RemoveCount_(QUEUE, C)
262 #define kQueue_Clear_(QUEUE) kxQueue_Clear_(QUEUE)
263 #define kQueue_ItemType_(QUEUE) kxQueue_ItemType_(QUEUE)
264 #define kQueue_ItemSize_(QUEUE) kxQueue_ItemSize_(QUEUE)
265 #define kQueue_Count_(QUEUE) kxQueue_Count_(QUEUE)
266 #define kQueue_Capacity_(QUEUE) kxQueue_Capacity_(QUEUE)
267 #define kQueue_At_(QUEUE, INDEX) kxQueue_At_(QUEUE, INDEX)
268
269
270 #define kQueue_As_(QUEUE, INDEX, TYPE) kxQueue_As_(QUEUE, INDEX, TYPE)
271
274 kEndHeader()
275
276 #include <kApi/Data/kQueue.x.h>
277
278 #endif
kQueue::kQueue_Remove
kStatus kQueue_Remove(kQueue queue, void *item)
Removes the item at the head of the queue.
kQueue::kQueue_SetItem
kStatus kQueue_SetItem(kQueue queue, kSize index, const void *item)
Sets the value of an item.
kQueue::kQueue_ItemSize
kSize kQueue_ItemSize(kQueue queue)
Returns the queue element size.
kSize
Represents an unsigned integer that can store a pointer address.
kAlloc
Abstract base class for memory allocator types.
kQueue::kQueue_Reserve
kStatus kQueue_Reserve(kQueue queue, kSize capacity)
Ensures that capacity is reserved for at least the specified number of queue items.
kQueue::kQueue_RemoveCount
kStatus kQueue_RemoveCount(kQueue queue, kSize count)
Decreases the queue count by the specified amount.
kQueue::kQueue_Construct
kStatus kQueue_Construct(kQueue *queue, kType itemType, kSize initialCapacity, kAlloc allocator)
Constructs a kQueue object.
kQueue::kQueue_ItemType
kType kQueue_ItemType(kQueue queue)
Returns the queue element type.
kQueue::kQueue_Allocate
kStatus kQueue_Allocate(kQueue queue, kType itemType, kSize initialCapacity)
Reallocates the queue item buffer.
kQueue::kQueue_Item
kStatus kQueue_Item(kQueue queue, kSize index, void *item)
Gets the value of an item.
kQueue::kQueue_Assign
kStatus kQueue_Assign(kQueue queue, kQueue source)
Performs a shallow copy of the source queue.
kApiDef.h
Core Zen type declarations.
kMsgQueue
Represents a synchronized FIFO queue with an optional maximum content size and/or item capacity...
kQueue::kQueue_Count
kSize kQueue_Count(kQueue queue)
Returns the current count of items in the queue.
kType
Represents metadata about a type (class, interface, or value).
kQueue
Represents a FIFO queue implemented with a dynamic array.
kStatus
Represents an error code.
kQueue::kQueue_At
void * kQueue_At(kQueue queue, kSize index)
Returns a pointer to the specified item in the queue buffer.
kQueue::kQueue_Add
kStatus kQueue_Add(kQueue queue, const void *item)
Adds the specified item to the end of the queue.
kQueue::kQueue_Capacity
kSize kQueue_Capacity(kQueue queue)
Returns the number of elements for which space has been allocated.
kQueue::kQueue_Purge
kStatus kQueue_Purge(kQueue queue)
Disposes any elements in the queue and sets the count of queue items to zero.
kQueue::kQueue_Clear
kStatus kQueue_Clear(kQueue queue)
Sets the count of queue items to zero.
kQueue::kQueue_AddCount
kStatus kQueue_AddCount(kQueue queue, kSize count)
Increases the queue count by the specified amount.