rcutils
master
C API providing common utilities and data structures.
|
Go to the documentation of this file.
17 #ifndef RCUTILS__TYPES__ARRAY_LIST_H_
18 #define RCUTILS__TYPES__ARRAY_LIST_H_
32 struct rcutils_array_list_impl_t;
38 struct rcutils_array_list_impl_t *
impl;
47 #define ARRAY_LIST_VALIDATE_ARRAY_LIST(array_list) \
48 RCUTILS_CHECK_ARGUMENT_FOR_NULL(array_list, RCUTILS_RET_INVALID_ARGUMENT); \
49 if (NULL == array_list->impl) { \
50 RCUTILS_SET_ERROR_MSG("array_list is not initialized"); \
51 return RCUTILS_RET_NOT_INITIALIZED; \
128 size_t initial_capacity,
288 #endif // RCUTILS__TYPES__ARRAY_LIST_H_
struct rcutils_array_list_t rcutils_array_list_t
The structure holding the metadata for an array list.
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.
The structure holding the metadata for an array list.
Definition: array_list.h:35
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
The type that holds a return value for an rcutils operation.
Definition: rcutils_ret.h:26
#define RCUTILS_WARN_UNUSED
A macro to make the compiler warn when the return value of a function is not used.
Definition: macros.h:27
struct rcutils_array_list_impl_t * impl
A pointer to the PIMPL implementation type.
Definition: array_list.h:38
rcutils_array_list_t rcutils_get_zero_initialized_array_list(void)
Return an empty array_list struct.
Encapsulation of an allocator.
Definition: allocator.h:47
#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.