Files | |
file | axutil_array_list.h |
Axis2 array_list interface. | |
Typedefs | |
typedef struct axutil_array_list | axutil_array_list_t |
Functions | |
AXIS2_EXTERN axutil_array_list_t * | axutil_array_list_create (const axutil_env_t *env, int capacity) |
AXIS2_EXTERN void | axutil_array_list_free_void_arg (void *array_list, const axutil_env_t *env) |
AXIS2_EXTERN axis2_status_t | axutil_array_list_ensure_capacity (struct axutil_array_list *array_list, const axutil_env_t *env, int min_capacity) |
AXIS2_EXTERN int | axutil_array_list_size (struct axutil_array_list *array_list, const axutil_env_t *env) |
AXIS2_EXTERN axis2_bool_t | axutil_array_list_is_empty (struct axutil_array_list *array_list, const axutil_env_t *env) |
AXIS2_EXTERN axis2_bool_t | axutil_array_list_contains (struct axutil_array_list *array_list, const axutil_env_t *env, void *e) |
AXIS2_EXTERN int | axutil_array_list_index_of (struct axutil_array_list *array_list, const axutil_env_t *env, void *e) |
AXIS2_EXTERN void * | axutil_array_list_get (struct axutil_array_list *array_list, const axutil_env_t *env, int index) |
AXIS2_EXTERN void * | axutil_array_list_set (struct axutil_array_list *array_list, const axutil_env_t *env, int index, void *e) |
AXIS2_EXTERN axis2_status_t | axutil_array_list_add (struct axutil_array_list *array_list, const axutil_env_t *env, const void *e) |
AXIS2_EXTERN axis2_status_t | axutil_array_list_add_at (struct axutil_array_list *array_list, const axutil_env_t *env, const int index, const void *e) |
AXIS2_EXTERN void * | axutil_array_list_remove (struct axutil_array_list *array_list, const axutil_env_t *env, int index) |
AXIS2_EXTERN axis2_bool_t | axutil_array_list_check_bound_inclusive (struct axutil_array_list *array_list, const axutil_env_t *env, int index) |
AXIS2_EXTERN axis2_bool_t | axutil_array_list_check_bound_exclusive (struct axutil_array_list *array_list, const axutil_env_t *env, int index) |
AXIS2_EXTERN void | axutil_array_list_free (struct axutil_array_list *array_list, const axutil_env_t *env) |
typedef struct axutil_array_list axutil_array_list_t |
Array List struct
AXIS2_EXTERN axis2_status_t axutil_array_list_add | ( | struct axutil_array_list * | array_list, | |
const axutil_env_t * | env, | |||
const void * | e | |||
) |
Appends the supplied element to the end of this list. The element, e, can be a pointer of any type or NULL.
array_list | pointer to array list | |
env | pointer to environment struct | |
e | the element to be appended to this list |
AXIS2_EXTERN axis2_status_t axutil_array_list_add_at | ( | struct axutil_array_list * | array_list, | |
const axutil_env_t * | env, | |||
const int | index, | |||
const void * | e | |||
) |
Adds the supplied element at the specified index, shifting all elements currently at that index or higher one to the right. The element, e, can be a pointer of any type or NULL.
array_list | pointer to array list | |
env | pointer to environment struct | |
index | the index at which the element is being added | |
e | the item being added |
AXIS2_EXTERN axis2_bool_t axutil_array_list_check_bound_exclusive | ( | struct axutil_array_list * | array_list, | |
const axutil_env_t * | env, | |||
int | index | |||
) |
Checks that the index is in the range of existing elements (exclusive).
array_list | pointer to array list | |
env | pointer to environment struct | |
index | the index to check |
AXIS2_EXTERN axis2_bool_t axutil_array_list_check_bound_inclusive | ( | struct axutil_array_list * | array_list, | |
const axutil_env_t * | env, | |||
int | index | |||
) |
Checks that the index is in the range of possible elements (inclusive).
array_list | pointer to array list | |
env | pointer to environment struct | |
index | the index to check |
AXIS2_EXTERN axis2_bool_t axutil_array_list_contains | ( | struct axutil_array_list * | array_list, | |
const axutil_env_t * | env, | |||
void * | e | |||
) |
Returns true iff element is in this array_list.
array_list | pointer to array list | |
env | pointer to environment struct | |
e | the element whose inclusion in the List is being tested |
AXIS2_EXTERN axutil_array_list_t* axutil_array_list_create | ( | const axutil_env_t * | env, | |
int | capacity | |||
) |
Constructs a new array list with the supplied initial capacity. If capacity is invalid (<= 0) then default capacity is used
env | pointer to environment struct | |
capacity | initial capacity of this array_list |
AXIS2_EXTERN axis2_status_t axutil_array_list_ensure_capacity | ( | struct axutil_array_list * | array_list, | |
const axutil_env_t * | env, | |||
int | min_capacity | |||
) |
Guarantees that this list will have at least enough capacity to hold min_capacity elements. This implementation will grow the list to max(current * 2, min_capacity)
array_list | pointer to array_list | |
env | pointer to environment struct | |
min_capacity | the minimum guaranteed capacity |
AXIS2_EXTERN void axutil_array_list_free | ( | struct axutil_array_list * | array_list, | |
const axutil_env_t * | env | |||
) |
array_list | pointer to array list | |
env | pointer to environment struct |
AXIS2_EXTERN void axutil_array_list_free_void_arg | ( | void * | array_list, | |
const axutil_env_t * | env | |||
) |
Free array passed as void pointer.
array_list | pointer to array list | |
env | pointer to environment struct |
AXIS2_EXTERN void* axutil_array_list_get | ( | struct axutil_array_list * | array_list, | |
const axutil_env_t * | env, | |||
int | index | |||
) |
Retrieves the element at the user-supplied index.
array_list | pointer to array list | |
env | pointer to environment struct | |
index | the index of the element we are fetching |
AXIS2_EXTERN int axutil_array_list_index_of | ( | struct axutil_array_list * | array_list, | |
const axutil_env_t * | env, | |||
void * | e | |||
) |
Returns the lowest index at which element appears in this List, or -1 if it does not appear. This looks for the pointer value equality only, does not look into pointer content
array_list | pointer to array list | |
env | pointer to environment struct | |
e | the element whose inclusion in the List is being tested |
AXIS2_EXTERN axis2_bool_t axutil_array_list_is_empty | ( | struct axutil_array_list * | array_list, | |
const axutil_env_t * | env | |||
) |
Checks if the list is empty.
array_list | pointer to array list | |
env | pointer to environment struct |
AXIS2_EXTERN void* axutil_array_list_remove | ( | struct axutil_array_list * | array_list, | |
const axutil_env_t * | env, | |||
int | index | |||
) |
Removes the element at the user-supplied index.
array_list | pointer to array list | |
env | pointer to environment struct | |
index | the index of the element to be removed |
AXIS2_EXTERN void* axutil_array_list_set | ( | struct axutil_array_list * | array_list, | |
const axutil_env_t * | env, | |||
int | index, | |||
void * | e | |||
) |
Sets the element at the specified index. The new element, e, can be an object of any type or null.
array_list | pointer to array list | |
env | pointer to environment struct | |
index | the index at which the element is being set | |
e | the element to be set |
AXIS2_EXTERN int axutil_array_list_size | ( | struct axutil_array_list * | array_list, | |
const axutil_env_t * | env | |||
) |
Returns the number of elements in this list.
array_list | pointer to array list | |
env | pointer to environment struct |