lv_iter_private.h
API reference for lv_iter_private.h
Functions
lv_iter_get_context
Get the context of the iterator. You can use it to store some temporary variables associated with current iterator..
void * lv_iter_get_context(const lv_iter_t *iter)| Name | Type | Description |
|---|---|---|
iter | const lv_iter_t * | lv_iter_t object create before |
Returns: void * — the iter context
lv_iter_create
Create an iterator based on an instance, and then the next element of the iterator can be obtained through lv_iter_next, In order to obtain the next operation in a unified and abstract way.
lv_iter_t * lv_iter_create(void *instance, uint32_t elem_size, uint32_t context_size, lv_iter_next_cb next_cb)| Name | Type | Description |
|---|---|---|
instance | void * | The instance to be iterated |
elem_size | uint32_t | The size of the element to be iterated in bytes |
context_size | uint32_t | The size of the context to be passed to the next_cb in bytes |
next_cb | lv_iter_next_cb | The callback function to get the next element |
Returns: lv_iter_t * — The iterator object
lv_iter_destroy
Destroy the iterator object, and release the context. Other resources allocated by the user are not released. The user needs to release it by itself.
void lv_iter_destroy(lv_iter_t *iter)| Name | Type | Description |
|---|---|---|
iter | lv_iter_t * | lv_iter_t object create before |
lv_iter_next
Get the next element of the iterator.
lv_result_t lv_iter_next(lv_iter_t *iter, void *elem)| Name | Type | Description |
|---|---|---|
iter | lv_iter_t * | lv_iter_t object create before |
elem | void * | The pointer to store the next element |
Returns: lv_result_t — LV_RESULT_OK: Get the next element successfully LV_RESULT_INVALID: The next element is invalid
lv_iter_make_peekable
Make the iterator peekable, which means that the user can peek the next element without advancing the iterator.
void lv_iter_make_peekable(lv_iter_t *iter, uint32_t capacity)| Name | Type | Description |
|---|---|---|
iter | lv_iter_t * | lv_iter_t object create before |
capacity | uint32_t | The capacity of the peek buffer |
lv_iter_peek
Peek the next element of the iterator without advancing the iterator.
lv_result_t lv_iter_peek(lv_iter_t *iter, void *elem)| Name | Type | Description |
|---|---|---|
iter | lv_iter_t * | lv_iter_t object create before |
elem | void * | The pointer to store the next element |
Returns: lv_result_t — LV_RESULT_OK: Peek the next element successfully LV_RESULT_INVALID: The next element is invalid
lv_iter_peek_advance
Only advance the iterator without getting the next element.
lv_result_t lv_iter_peek_advance(lv_iter_t *iter)| Name | Type | Description |
|---|---|---|
iter | lv_iter_t * | lv_iter_t object create before |
Returns: lv_result_t — LV_RESULT_OK: Peek the next element successfully LV_RESULT_INVALID: The next element is invalid
lv_iter_peek_reset
Reset the peek cursor to the next cursor.
lv_result_t lv_iter_peek_reset(lv_iter_t *iter)| Name | Type | Description |
|---|---|---|
iter | lv_iter_t * | lv_iter_t object create before |
Returns: lv_result_t — LV_RESULT_OK: Reset the peek buffer successfully LV_RESULT_INVALID: The peek buffer is invalid
lv_iter_inspect
Inspect the element of the iterator. The callback function will be called for each element of the iterator.
void lv_iter_inspect(lv_iter_t *iter, lv_iter_inspect_cb inspect_cb)| Name | Type | Description |
|---|---|---|
iter | lv_iter_t * | lv_iter_t object create before |
inspect_cb | lv_iter_inspect_cb | The callback function to inspect the element |
Typedefs
lv_iter_t
typedef struct _lv_iter_t lv_iter_tUsed by 8 functions
lv_iter_get_context— paramiterlv_iter_destroy— paramiterlv_iter_next— paramiterlv_iter_make_peekable— paramiterlv_iter_peek— paramiterlv_iter_peek_advance— paramiterlv_iter_peek_reset— paramiterlv_iter_inspect— paramiter
lv_iter_next_cb
typedef lv_result_t(* lv_iter_next_cb) (void *instance, void *context, void *elem)Used by 1 function
lv_iter_create— paramnext_cb
lv_iter_inspect_cb
typedef void(* lv_iter_inspect_cb) (void *elem)Used by 1 function
lv_iter_inspect— paraminspect_cb
Dependencies
lvgl_public.h
Last updated on