package core:container/intrusive/list

⌘K
Ctrl+K
or
/

    Index

    Types (3)
    Constants (0)

    This section is empty.

    Variables (0)

    This section is empty.

    Procedure Groups (0)

    This section is empty.

    Types

    Iterator ¶

    Iterator :: struct($Value: typeid) {}
    Related Procedures With Parameters
    Related Procedures With Returns

    List ¶

    List :: struct {
    	head: ^Node,
    	tail: ^Node,
    }
     

    An intrusive doubly-linked list

    As this is an intrusive container, a Node must be embedded in your own structure which is conventionally called a "link". The use of push_front and push_back take the address of this node. Retrieving the data associated with the node requires finding the relative offset of the node of the parent structure. The parent type and field name are given to iterator_* procedures, or to the built-in container_of procedure.

    This data structure is two-pointers in size:

    8 bytes on 32-bit platforms and 16 bytes on 64-bit platforms
    
    Related Procedures With Parameters

    Node ¶

    Node :: struct {
    	prev: ^Node,
    	next: ^Node,
    }
    Related Procedures With Parameters
    Related Procedures With Returns

    Constants

    This section is empty.

    Variables

    This section is empty.

    Procedures

    is_empty ¶

    is_empty :: proc "contextless" (list: ^List) -> bool {…}

    iterate_next ¶

    iterate_next :: proc "contextless" (it: ^Iterator($T)) -> (ptr: ^$T, ok: bool) {…}

    iterate_prev ¶

    iterate_prev :: proc "contextless" (it: ^Iterator($T)) -> (ptr: ^$T, ok: bool) {…}

    iterator_from_node ¶

    iterator_from_node :: proc "contextless" (node: ^Node, $T: typeid, $field_name: string = ) -> Iterator($T=typeid) {…}

    iterator_head ¶

    iterator_head :: proc "contextless" (list: List, $T: typeid, $field_name: string = ) -> Iterator($T=typeid) {…}

    iterator_tail ¶

    iterator_tail :: proc "contextless" (list: List, $T: typeid, $field_name: string = ) -> Iterator($T=typeid) {…}

    pop_back ¶

    pop_back :: proc "contextless" (list: ^List) -> ^Node {…}

    pop_front ¶

    pop_front :: proc "contextless" (list: ^List) -> ^Node {…}

    push_back ¶

    push_back :: proc "contextless" (list: ^List, node: ^Node) {…}

    push_front ¶

    push_front :: proc "contextless" (list: ^List, node: ^Node) {…}

    remove ¶

    remove :: proc "contextless" (list: ^List, node: ^Node) {…}

    remove_by_proc ¶

    remove_by_proc :: proc(list: ^List, to_erase: proc(_: ^Node) -> bool) {…}

    remove_by_proc_contextless ¶

    remove_by_proc_contextless :: proc(list: ^List, to_erase: proc "contextless" (_: ^Node) -> bool) {…}

    Procedure Groups

    This section is empty.

    Source Files

    Generation Information

    Generated with odin version dev-2024-04 (vendor "odin") Windows_amd64 @ 2024-04-26 21:08:58.343751700 +0000 UTC