![]() |
#include <citrusleaf/alloc.h>#include <citrusleaf/cf_types.h>#include <string.h>
Include dependency graph for as_vector.h:
This graph shows which files directly or indirectly include this file: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) |
| bool | as_vector_append_unique (as_vector *vector, void *value) |
| static void | as_vector_clear (as_vector *vector) |
| as_vector * | as_vector_create (uint32_t item_size, uint32_t capacity) |
| 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) |
| void | as_vector_increase_capacity (as_vector *vector) |
| void | as_vector_init (as_vector *vector, uint32_t item_size, uint32_t capacity) |
| static void | as_vector_move (as_vector *vector, uint32_t source, uint32_t target) |
| static void | as_vector_set (as_vector *vector, uint32_t index, void *value) |
| #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 67 of file as_vector.h.
|
inlinestatic |
Append item to vector.
Definition at line 142 of file as_vector.h.
References as_vector_increase_capacity(), as_vector::capacity, as_vector::item_size, as_vector::list, and as_vector::size.
| bool as_vector_append_unique | ( | as_vector * | vector, |
| void * | value | ||
| ) |
Append item to vector if it doesn't already exist.
|
inlinestatic |
Empty vector without altering data.
Definition at line 100 of file as_vector.h.
References as_vector::size.
| as_vector* as_vector_create | ( | uint32_t | item_size, |
| uint32_t | capacity | ||
| ) |
Create a heap allocated as_vector, with item storage on the heap.
| void as_vector_destroy | ( | as_vector * | vector | ) |
Free vector.
|
inlinestatic |
Get pointer to item given index.
Definition at line 109 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 118 of file as_vector.h.
References as_vector::item_size, and as_vector::list.
| void as_vector_increase_capacity | ( | as_vector * | vector | ) |
Double vector capacity.
| void as_vector_init | ( | as_vector * | vector, |
| uint32_t | item_size, | ||
| uint32_t | capacity | ||
| ) |
Initialize a stack allocated as_vector, with item storage on the heap.
|
inlinestatic |
Move item row position in vector.
Definition at line 161 of file as_vector.h.
References as_vector::item_size, and as_vector::list.
|
inlinestatic |
Set item in vector.
Definition at line 133 of file as_vector.h.
References as_vector::item_size, and as_vector::list.