![]() |
#include <aerospike/as_bytes.h>
#include <aerospike/as_double.h>
#include <aerospike/as_integer.h>
#include <aerospike/as_iterator.h>
#include <aerospike/as_string.h>
#include <aerospike/as_util.h>
#include <aerospike/as_val.h>
#include <stdbool.h>
#include <stdint.h>
Go to the source code of this file.
Data Structures | |
struct | as_list |
struct | as_list_hooks |
Typedefs | |
typedef bool(* | as_list_foreach_callback )(as_val *value, void *udata) |
Functions | |
static int | as_list_append (as_list *list, as_val *value) |
static int | as_list_append_as_double (as_list *list, as_double *value) |
static int | as_list_append_bytes (as_list *list, as_bytes *value) |
static int | as_list_append_double (as_list *list, double value) |
static int | as_list_append_int64 (as_list *list, int64_t value) |
static int | as_list_append_integer (as_list *list, as_integer *value) |
static int | as_list_append_list (as_list *list, as_list *value) |
static int | as_list_append_map (as_list *list, struct as_map_s *value) |
static int | as_list_append_str (as_list *list, const char *value) |
static int | as_list_append_string (as_list *list, as_string *value) |
static int | as_list_concat (as_list *list, const as_list *list2) |
as_list * | as_list_cons (as_list *list, bool free, const as_list_hooks *hooks) |
static void | as_list_destroy (as_list *list) |
static as_list * | as_list_drop (const as_list *list, uint32_t n) |
static bool | as_list_foreach (const as_list *list, as_list_foreach_callback callback, void *udata) |
static as_list * | as_list_fromval (as_val *v) |
static as_val * | as_list_get (const as_list *list, uint32_t i) |
static as_double * | as_list_get_as_double (const as_list *list, uint32_t i) |
static as_bytes * | as_list_get_bytes (const as_list *list, uint32_t i) |
static double | as_list_get_double (const as_list *list, uint32_t i) |
static int64_t | as_list_get_int64 (const as_list *list, uint32_t i) |
static as_integer * | as_list_get_integer (const as_list *list, uint32_t i) |
static as_list * | as_list_get_list (const as_list *list, uint32_t i) |
static struct as_map_s * | as_list_get_map (const as_list *list, uint32_t i) |
static char * | as_list_get_str (const as_list *list, uint32_t i) |
static as_string * | as_list_get_string (const as_list *list, uint32_t i) |
static uint32_t | as_list_hashcode (as_list *list) |
static as_val * | as_list_head (const as_list *list) |
as_list * | as_list_init (as_list *list, const as_list_hooks *hooks) |
static int | as_list_insert (as_list *list, uint32_t i, as_val *value) |
static int | as_list_insert_as_double (as_list *list, uint32_t i, as_double *value) |
static int | as_list_insert_bytes (as_list *list, uint32_t i, as_bytes *value) |
static int | as_list_insert_double (as_list *list, uint32_t i, double value) |
static int | as_list_insert_int64 (as_list *list, uint32_t i, int64_t value) |
static int | as_list_insert_integer (as_list *list, uint32_t i, as_integer *value) |
static int | as_list_insert_list (as_list *list, uint32_t i, as_list *value) |
static int | as_list_insert_map (as_list *list, uint32_t i, struct as_map_s *value) |
static int | as_list_insert_str (as_list *list, uint32_t i, const char *value) |
static int | as_list_insert_string (as_list *list, uint32_t i, as_string *value) |
static union as_list_iterator_u * | as_list_iterator_init (union as_list_iterator_u *it, const as_list *list) |
static union as_list_iterator_u * | as_list_iterator_new (const as_list *list) |
as_list * | as_list_new (const as_list_hooks *hooks) |
static int | as_list_prepend (as_list *list, as_val *value) |
static int | as_list_prepend_as_double (as_list *list, as_double *value) |
static int | as_list_prepend_bytes (as_list *list, as_bytes *value) |
static int | as_list_prepend_double (as_list *list, double value) |
static int | as_list_prepend_int64 (as_list *list, int64_t value) |
static int | as_list_prepend_integer (as_list *list, as_integer *value) |
static int | as_list_prepend_list (as_list *list, as_list *value) |
static int | as_list_prepend_map (as_list *list, struct as_map_s *value) |
static int | as_list_prepend_str (as_list *list, const char *value) |
static int | as_list_prepend_string (as_list *list, as_string *value) |
static int | as_list_remove (as_list *list, uint32_t index) |
static int | as_list_set (as_list *list, uint32_t i, as_val *value) |
static int | as_list_set_as_double (as_list *list, uint32_t i, as_double *value) |
static int | as_list_set_bytes (as_list *list, uint32_t i, as_bytes *value) |
static int | as_list_set_double (as_list *list, uint32_t i, double value) |
static int | as_list_set_int64 (as_list *list, uint32_t i, int64_t value) |
static int | as_list_set_integer (as_list *list, uint32_t i, as_integer *value) |
static int | as_list_set_list (as_list *list, uint32_t i, as_list *value) |
static int | as_list_set_map (as_list *list, uint32_t i, struct as_map_s *value) |
static int | as_list_set_str (as_list *list, uint32_t i, const char *value) |
static int | as_list_set_string (as_list *list, uint32_t i, as_string *value) |
static uint32_t | as_list_size (as_list *list) |
static as_list * | as_list_tail (const as_list *list) |
static as_list * | as_list_take (const as_list *list, uint32_t n) |
static as_val * | as_list_toval (as_list *list) |
static int | as_list_trim (as_list *list, uint32_t index) |
void | as_list_val_destroy (as_val *v) |
uint32_t | as_list_val_hashcode (const as_val *v) |
char * | as_list_val_tostring (const as_val *v) |
typedef bool(* as_list_foreach_callback)(as_val *value, void *udata) |
Callback function for as_list_foreach()
. Called for each element in the list.
value | The value of the current element. |
udata | The user-data provided to the as_list_foreach() . |
Append a value to the list.
list | The list. |
value | The value to append to the list. |
Definition at line 1100 of file as_list.h.
References as_util_hook.
Append an as_double to the list.
list | The list. |
value | The value to append to the list. |
Definition at line 1170 of file as_list.h.
References as_list::as_list_append().
Append an as_bytes to the list.
list | The list. |
value | The value to append to the list. |
Definition at line 1198 of file as_list.h.
References as_list::as_list_append().
|
inlinestatic |
Append a double to the list.
list | The list. |
value | The value to append to the list. |
Definition at line 1128 of file as_list.h.
References as_util_hook.
|
inlinestatic |
Append an int64_t to the list.
list | The list. |
value | The value to append to the list. |
Definition at line 1114 of file as_list.h.
References as_util_hook.
|
inlinestatic |
Append an as_integer to the list.
list | The list. |
value | The value to append to the list. |
Definition at line 1156 of file as_list.h.
References as_list::as_list_append().
Append an as_list to the list.
list | The list. |
value | The value to append to the list. |
Definition at line 1212 of file as_list.h.
References as_list::as_list_append().
|
inlinestatic |
Append an as_map to the list.
list | The list. |
value | The value to append to the list. |
Definition at line 1226 of file as_list.h.
References as_list::as_list_append().
|
inlinestatic |
Append a NULL-terminated string to the list.
list | The list. |
value | The value to append to the list. |
Definition at line 1142 of file as_list.h.
References as_util_hook.
Append an as_string to the list.
list | The list. |
value | The value to append to the list. |
Definition at line 1184 of file as_list.h.
References as_list::as_list_append().
Append all elements of list2, in order, to list. No new list object is created.
list | The list to append to. |
list2 | The list from which to append. |
Definition at line 556 of file as_list.h.
References as_util_hook.
|
private |
Utilized by subtypes of as_list to initialize the parent.
list | The list to initialize. |
free | If true, then as_list_destroy() will free the list. |
hooks | Implementaton for the list interface. |
|
inlinestatic |
Destroy the list and associated resources.
list | The list to destroy. |
Definition at line 507 of file as_list.h.
References as_val_destroy.
Create a new list containing all elements, except the first n elements, of the list.
list | The list to drop elements from. |
n | The number of elements to drop. |
Definition at line 611 of file as_list.h.
References as_util_hook.
|
inlinestatic |
Call the callback function for each element in the list..
list | The list to iterate over. |
callback | The callback function call for each element. |
udata | User-data to send to the callback. |
Definition at line 1411 of file as_list.h.
References as_util_hook.
Convert from an as_val.
Definition at line 1461 of file as_list.h.
References AS_LIST, and as_util_fromval.
Get the value at specified index as an as_val.
list | The list to get the value from. |
i | The index of the value to get from the list. |
Definition at line 643 of file as_list.h.
References as_util_hook.
Get the value at specified index as an as_double.
list | The list to get the value from. |
i | The index of the value to get from the list. |
Definition at line 713 of file as_list.h.
References as_double::as_double_fromval(), and as_list::as_list_get().
Get the value at specified index as an as_val.
list | The list to get the value from. |
i | The index of the value to get from the list. |
Definition at line 741 of file as_list.h.
References as_bytes::as_bytes_fromval(), and as_list::as_list_get().
|
inlinestatic |
Get the value at specified index as a double.
list | The list to get the value from. |
i | The index of the value to get from the list. |
Definition at line 671 of file as_list.h.
References as_util_hook.
|
inlinestatic |
Get the value at specified index as an int64_t.
list | The list to get the value from. |
i | The index of the value to get from the list. |
Definition at line 657 of file as_list.h.
References as_util_hook.
|
inlinestatic |
Get the value at specified index as an as_integer.
list | The list to get the value from. |
i | The index of the value to get from the list. |
Definition at line 699 of file as_list.h.
References as_integer::as_integer_fromval(), and as_list::as_list_get().
Get the value at specified index as an as_val.
list | The list to get the value from. |
i | The index of the value to get from the list. |
Definition at line 755 of file as_list.h.
References AS_LIST, as_list::as_list_get(), and as_val::type.
|
static |
Get the value at specified index as an as_val.
list | The list to get the value from. |
i | The index of the value to get from the list. |
Definition at line 770 of file as_list.h.
References as_list::as_list_get(), AS_MAP, and as_val::type.
|
inlinestatic |
Get the value at specified index as an NULL terminated string.
list | The list to get the value from. |
i | The index of the value to get from the list. |
Definition at line 685 of file as_list.h.
References as_util_hook.
Get the value at specified index as an as_val.
list | The list to get the value from. |
i | The index of the value to get from the list. |
Definition at line 727 of file as_list.h.
References as_list::as_list_get(), and as_string::as_string_fromval().
|
inlinestatic |
Get the hashcode value for the list.
list | The list. |
Definition at line 524 of file as_list.h.
References as_util_hook.
The first element in the list.
list | The list to get the head value from. |
Definition at line 584 of file as_list.h.
References as_util_hook.
as_list * as_list_init | ( | as_list * | list, |
const as_list_hooks * | hooks | ||
) |
Initialize a stack allocated list.
list | Stack allocated list to initialize. |
hooks | Implementaton for the list interface. |
Insert a value at the specified index of the list.
Any elements at and beyond specified index will be shifted so their indexes increase by 1. It's ok to insert beyond the current end of the list.
list | The list. |
i | The index at which to insert. |
value | The value to insert at the given index. |
Definition at line 947 of file as_list.h.
References as_util_hook.
Insert an as_double at specified index as an as_val.
list | The list. |
i | The index at which to insert. |
value | The value to insert at the given index. |
Definition at line 1022 of file as_list.h.
References as_list::as_list_insert().
Insert an as_bytes at specified index as an as_val.
list | The list. |
i | The index at which to insert. |
value | The value to insert at the given index. |
Definition at line 1052 of file as_list.h.
References as_list::as_list_insert().
|
inlinestatic |
Insert a double at specified index as an as_val.
list | The list. |
i | The index at which to insert. |
value | The value to insert at the given index. |
Definition at line 977 of file as_list.h.
References as_util_hook.
|
inlinestatic |
Insert an int64_t at specified index as an as_val.
list | The list. |
i | The index at which to insert. |
value | The value to insert at the given index. |
Definition at line 962 of file as_list.h.
References as_util_hook.
|
inlinestatic |
Insert an as_integer at specified index as an as_val.
list | The list. |
i | The index at which to insert. |
value | The value to insert at the given index. |
Definition at line 1007 of file as_list.h.
References as_list::as_list_insert().
Insert an as_list at specified index as an as_val.
list | The list. |
i | The index at which to insert. |
value | The value to insert at the given index. |
Definition at line 1067 of file as_list.h.
References as_list::as_list_insert().
|
inlinestatic |
Insert an as_map at specified index as an as_val.
list | The list. |
i | The index at which to insert. |
value | The value to insert at the given index. |
Definition at line 1082 of file as_list.h.
References as_list::as_list_insert().
|
inlinestatic |
Insert a NULL-terminated string at specified index as an as_val.
list | The list. |
i | The index at which to insert. |
value | The value to insert at the given index. |
Definition at line 992 of file as_list.h.
References as_util_hook.
Insert an as_string at specified index as an as_val.
list | The list. |
i | The index at which to insert. |
value | The value to insert at the given index. |
Definition at line 1037 of file as_list.h.
References as_list::as_list_insert().
|
static |
Initializes a stack allocated iterator over the given list.
list | The list to iterate. |
it | The iterator to initialize. |
Definition at line 1439 of file as_list.h.
References as_util_hook.
|
static |
Creates and initializes a new heap allocated iterator over the given list.
list | The list to iterate. |
Definition at line 1424 of file as_list.h.
References as_util_hook.
as_list * as_list_new | ( | const as_list_hooks * | hooks | ) |
Create and initialize a new heap allocated list.
hooks | Implementaton for the list interface. |
Prepend a value to the list.
list | The list. |
value | The value to prepend to the list. |
Definition at line 1244 of file as_list.h.
References as_util_hook.
Prepend an as_double to the list.
list | The list. |
value | The value to prepend to the list. |
Definition at line 1314 of file as_list.h.
References as_list::as_list_prepend().
Prepend an as_bytes to the list.
list | The list. |
value | The value to prepend to the list. |
Definition at line 1342 of file as_list.h.
References as_list::as_list_prepend().
|
inlinestatic |
Prepend a double value to the list.
list | The list. |
value | The value to prepend to the list. |
Definition at line 1272 of file as_list.h.
References as_util_hook.
|
inlinestatic |
Prepend an int64_t value to the list.
list | The list. |
value | The value to prepend to the list. |
Definition at line 1258 of file as_list.h.
References as_util_hook.
|
inlinestatic |
Prepend an as_integer to the list.
list | The list. |
value | The value to prepend to the list. |
Definition at line 1300 of file as_list.h.
References as_list::as_list_prepend().
Prepend an as_list to the list.
list | The list. |
value | The value to prepend to the list. |
Definition at line 1356 of file as_list.h.
References as_list::as_list_prepend().
|
inlinestatic |
Prepend an as_map to the list.
list | The list. |
value | The value to prepend to the list. |
Definition at line 1370 of file as_list.h.
References as_list::as_list_prepend().
|
inlinestatic |
Prepend a NULL-terminated string to the list.
list | The list. |
value | The value to prepend to the list. |
Definition at line 1286 of file as_list.h.
References as_util_hook.
Prepend an as_string to the list.
list | The list. |
value | The value to prepend to the list. |
Definition at line 1328 of file as_list.h.
References as_list::as_list_prepend().
|
inlinestatic |
Remove element at specified index.
Any elements beyond specified index will be shifted so their indexes decrease by 1. The element at specified index will be destroyed.
list | The list. |
index | The index of the element to remove. |
Definition at line 1391 of file as_list.h.
References as_util_hook.
Set the value at specified index as an as_val.
list | The list. |
i | The index of the value to set in the list. |
value | The value to set at the given index. |
Definition at line 790 of file as_list.h.
References as_util_hook.
Set an as_double at specified index as an as_val.
list | The list. |
i | The index of the value to set in the list. |
value | The value to set at the given index. |
Definition at line 865 of file as_list.h.
References as_list::as_list_set().
Set an as_bytes at specified index as an as_val.
list | The list. |
i | The index of the value to set in the list. |
value | The value to set at the given index. |
Definition at line 895 of file as_list.h.
References as_list::as_list_set().
|
inlinestatic |
Set a double at specified index as an as_val.
list | The list. |
i | The index of the value to set in the list. |
value | The value to set at the given index. |
Definition at line 820 of file as_list.h.
References as_util_hook.
|
inlinestatic |
Set an int64_t at specified index as an as_val.
list | The list. |
i | The index of the value to set in the list. |
value | The value to set at the given index. |
Definition at line 805 of file as_list.h.
References as_util_hook.
|
inlinestatic |
Set an as_integer at specified index as an as_val.
list | The list. |
i | The index of the value to set in the list. |
value | The value to set at the given index. |
Definition at line 850 of file as_list.h.
References as_list::as_list_set().
Set an as_list at specified index as an as_val.
list | The list. |
i | The index of the value to set in the list. |
value | The value to set at the given index. |
Definition at line 910 of file as_list.h.
References as_list::as_list_set().
|
inlinestatic |
Set an as_map at specified index as an as_val.
list | The list. |
i | The index of the value to set in the list. |
value | The value to set at the given index. |
Definition at line 925 of file as_list.h.
References as_list::as_list_set().
|
inlinestatic |
Set a NULL-terminated string at specified index as an as_val.
list | The list. |
i | The index of the value to set in the list. |
value | The value to set at the given index. |
Definition at line 835 of file as_list.h.
References as_util_hook.
Set an as_string at specified index as an as_val.
list | The list. |
i | The index of the value to set in the list. |
value | The value to set at the given index. |
Definition at line 880 of file as_list.h.
References as_list::as_list_set().
|
inlinestatic |
Number of elements in the list.
list | The list. |
Definition at line 537 of file as_list.h.
References as_util_hook.
All elements after the first element in the list.
list | The list to get the tail from. |
Definition at line 597 of file as_list.h.
References as_util_hook.
Creates a new list containing the first n elements of the list.
list | The list to drop elements from. |
n | The number of elements to take. |
Definition at line 625 of file as_list.h.
References as_util_hook.
|
inlinestatic |
Delete (and destroy) all elements at and beyond specified index. Capacity is not reduced.
list | The list to trim. |
index | The index from which to trim. |
Definition at line 571 of file as_list.h.
References as_util_hook.
|
private |
Internal helper function for getting the hashcode of an as_val.