docs/Writerside/topics/list.h.md

Fri, 14 Feb 2025 16:00:05 +0100

author
Mike Becker <universe@uap-core.de>
date
Fri, 14 Feb 2025 16:00:05 +0100
changeset 1208
6e78f45b17c3
parent 1190
a7b913d5d589
permissions
-rw-r--r--

add link summary text to strings and buffers topic

there should be more text to explain the what and why

relates to #451

# List Interface

<warning>
Outdated Section - will be updated soon!
</warning>

This header defines a common interface for all list implementations.

UCX already comes with two common list implementations (linked list and array list) that should cover most use cases.
But if you feel the need to implement an own list, the only thing you need to do is to define a struct with a
`struct cx_list_s` as first member, and set an appropriate list class that implements the functionality.
It is strongly recommended that this class is shared among all instances of the same list type, because otherwise
the `cxListCompare` function cannot use the optimized implementation of your class and will instead fall back to
using iterators to compare the contents element-wise.

<!--
## Undocumented Symbols (TODO)
### cx_empty_list
### cxEmptyList
### cxListCompare
### cx_list_default_insert_array
### cx_list_default_insert_sorted
### cx_list_default_sort
### cx_list_default_swap
### cxListFree
### cx_list_init
### cxListMutBackwardsIteratorAt
### cxListMutIteratorAt
-->

<seealso>
<category ref="apidoc">
<a href="https://ucx.sourceforge.io/api/list_8h.html">list.h</a>
</category>
</seealso>

mercurial