Go to the source code of this file.
Data Structures | |
struct | as_vector |
Macros | |
#define | as_vector_inita(__vector, __item_size, __capacity) |
Functions | |
static void | as_vector_append (as_vector *vector, void *value) |
AS_EXTERN bool | as_vector_append_unique (as_vector *vector, void *value) |
static void | as_vector_clear (as_vector *vector) |
AS_EXTERN as_vector * | as_vector_create (uint32_t item_size, uint32_t capacity) |
AS_EXTERN void | as_vector_destroy (as_vector *vector) |
static void * | as_vector_get (as_vector *vector, uint32_t index) |
static void * | as_vector_get_ptr (as_vector *vector, uint32_t index) |
AS_EXTERN void | as_vector_increase_capacity (as_vector *vector) |
AS_EXTERN void | as_vector_init (as_vector *vector, uint32_t item_size, uint32_t capacity) |
AS_EXTERN bool | as_vector_remove (as_vector *vector, uint32_t index) |
static void * | as_vector_reserve (as_vector *vector) |
static void | as_vector_set (as_vector *vector, uint32_t index, void *value) |
AS_EXTERN void * | as_vector_to_array (as_vector *vector, uint32_t *size) |
#define as_vector_inita | ( | __vector, | |
__item_size, | |||
__capacity ) |
Initialize a stack allocated as_vector, with item storage on the stack. as_vector_inita() will transfer stack memory to the heap if a resize is required.
Definition at line 70 of file as_vector.h.
|
inlinestatic |
Append item to vector.
Definition at line 145 of file as_vector.h.
References as_vector_increase_capacity(), as_vector::capacity, as_vector::item_size, as_vector::list, and as_vector::size.
Append item to vector if it doesn't already exist.
|
inlinestatic |
Empty vector without altering data.
Definition at line 103 of file as_vector.h.
References as_vector::size.
Create a heap allocated as_vector, with item storage on the heap.
|
inlinestatic |
Get pointer to item given index.
Definition at line 112 of file as_vector.h.
References as_vector::item_size, and as_vector::list.
|
inlinestatic |
Get pointer to item pointer given index.
Definition at line 121 of file as_vector.h.
References as_vector::item_size, and as_vector::list.
Initialize a stack allocated as_vector, with item storage on the heap.
|
inlinestatic |
Reserve a new slot in the vector. Increase capacity if necessary. Return reference to item. The item is initialized to zeroes.
Definition at line 171 of file as_vector.h.
References as_vector_increase_capacity(), as_vector::capacity, as_vector::item_size, as_vector::list, and as_vector::size.
|
inlinestatic |
Set item in vector.
Definition at line 136 of file as_vector.h.
References as_vector::item_size, and as_vector::list.