rcutils
master
C API providing common utilities and data structures.
|
Go to the documentation of this file.
15 #ifndef RCUTILS__TYPES__ARRAY_LIST_H_
16 #define RCUTILS__TYPES__ARRAY_LIST_H_
30 struct rcutils_array_list_impl_t;
34 struct rcutils_array_list_impl_t *
impl;
43 #define ARRAY_LIST_VALIDATE_ARRAY_LIST(array_list) \
44 RCUTILS_CHECK_ARGUMENT_FOR_NULL(array_list, RCUTILS_RET_INVALID_ARGUMENT); \
45 if (NULL == array_list->impl) { \
46 RCUTILS_SET_ERROR_MSG("array_list is not initialized"); \
47 return RCUTILS_RET_NOT_INITIALIZED; \
124 size_t initial_capacity,
284 #endif // RCUTILS__TYPES__ARRAY_LIST_H_
struct rcutils_array_list_t rcutils_array_list_t
rcutils_ret_t rcutils_array_list_get(const rcutils_array_list_t *array_list, size_t index, void *data)
Retrieves an entry in the list at the provided index.
Definition: array_list.h:32
rcutils_ret_t rcutils_array_list_set(rcutils_array_list_t *array_list, size_t index, const void *data)
Sets an entry in the list to the provided data.
rcutils_ret_t rcutils_array_list_get_size(const rcutils_array_list_t *array_list, size_t *size)
Retrieves the size of the provided array_list.
rcutils_ret_t rcutils_array_list_add(rcutils_array_list_t *array_list, const void *data)
Adds an entry to the list.
#define RCUTILS_PUBLIC_TYPE
Definition: visibility_control.h:29
rcutils_ret_t rcutils_array_list_init(rcutils_array_list_t *array_list, size_t initial_capacity, size_t data_size, const rcutils_allocator_t *allocator)
Initialize an array list with a given initial capacity.
int rcutils_ret_t
Definition: rcutils_ret.h:23
#define RCUTILS_WARN_UNUSED
Definition: macros.h:24
struct rcutils_array_list_impl_t * impl
Definition: array_list.h:34
rcutils_array_list_t rcutils_get_zero_initialized_array_list(void)
Return an empty array_list struct.
Encapsulation of an allocator.
Definition: allocator.h:45
#define RCUTILS_PUBLIC
Definition: visibility_control.h:23
rcutils_ret_t rcutils_array_list_fini(rcutils_array_list_t *array_list)
Finalize an array list, reclaiming all resources.
rcutils_ret_t rcutils_array_list_remove(rcutils_array_list_t *array_list, size_t index)
Removes an entry in the list at the provided index.