Go to the source code of this file.
Data Structures | |
struct | as_queue |
Macros | |
#define | as_queue_inita(__q, __item_size, __capacity) |
Functions | |
AS_EXTERN as_queue * | as_queue_create (uint32_t item_size, uint32_t capacity) |
static void | as_queue_decr_total (as_queue *queue) |
AS_EXTERN void | as_queue_destroy (as_queue *queue) |
static bool | as_queue_empty (as_queue *queue) |
static void * | as_queue_get (as_queue *queue, uint32_t index) |
static bool | as_queue_incr_total (as_queue *queue) |
AS_EXTERN bool | as_queue_init (as_queue *queue, uint32_t item_size, uint32_t capacity) |
static bool | as_queue_pop (as_queue *queue, void *ptr) |
static bool | as_queue_pop_tail (as_queue *queue, void *ptr) |
AS_EXTERN bool | as_queue_push (as_queue *queue, const void *ptr) |
AS_EXTERN bool | as_queue_push_head (as_queue *queue, const void *ptr) |
AS_EXTERN bool | as_queue_push_head_limit (as_queue *queue, const void *ptr) |
AS_EXTERN bool | as_queue_push_limit (as_queue *queue, const void *ptr) |
static uint32_t | as_queue_size (as_queue *queue) |
#define as_queue_inita | ( | __q, | |
__item_size, | |||
__capacity ) |
Initialize a stack allocated as_queue, with item storage on the stack. as_queue_inita() will transfer stack memory to the heap if a resize is required.
Definition at line 80 of file as_queue.h.
Create a heap allocated as_queue, with item storage on the heap.
|
inlinestatic |
|
inlinestatic |
Is queue empty?
Definition at line 123 of file as_queue.h.
References as_queue::head, and as_queue::tail.
|
inlinestatic |
Get item at virtual index. For internal use only.
Definition at line 156 of file as_queue.h.
References as_queue::capacity, as_queue::data, and as_queue::item_size.
|
inlinestatic |
Increment total counter if within capacity.
Definition at line 204 of file as_queue.h.
References as_queue::capacity, and as_queue::total.
Initialize a stack allocated as_queue, with item storage on the heap.
|
inlinestatic |
Pop item from the head of the queue.
Definition at line 165 of file as_queue.h.
References as_queue_empty(), as_queue_get(), as_queue::head, as_queue::item_size, and as_queue::tail.
|
inlinestatic |
Pop item from the tail of the queue.
Definition at line 185 of file as_queue.h.
References as_queue_empty(), as_queue_get(), as_queue::head, as_queue::item_size, and as_queue::tail.
Push item to the tail of the queue.
Push item to the head of the queue.
Push item to the head of the queue only if size < capacity.
Push item to the tail of the queue only if size < capacity.
|
inlinestatic |
Get the number of items currently in the queue.
Definition at line 114 of file as_queue.h.
References as_queue::head, and as_queue::tail.