A wrapper around an intrusive list with callbacks and non‐intrusive ownership.

Synopsis

Declared in <llvm/ADT/ilist.h>

template<
    class IntrusiveListT,
    class TraitsT>
class iplist_impl
    : public TraitsT

Description

This wraps a purely intrusive list (like simple_ilist) with a configurable traits class. The traits can implement callbacks and customize the ownership semantics.

This is a subset of ilist functionality that can safely be used on nodes of polymorphic types, i.e. a heterogeneous list with a common base class that holds the next/prev pointers. The only state of the list itself is an ilist_sentinel, which holds pointers to the first and last nodes in the list.

Base Classes

Name

Description

TraitsT

Type Aliases

Name

Description

const_iterator

Const bidirectional iterator.

const_pointer

Const pointer to a list element.

const_reference

Const reference to a list element.

const_reverse_iterator

Const reverse bidirectional iterator.

difference_type

Signed distance between iterators.

iterator

Mutable bidirectional iterator.

pointer

Mutable pointer to a list element.

reference

Mutable reference to a list element.

reverse_iterator

Mutable reverse bidirectional iterator.

size_type

Unsigned size type for the list.

value_type

Element type stored in the list.

Member Functions

Name

Description

iplist_impl [constructor]

Construct an empty intrusive list wrapper.

iplist_impl [constructor] [deleted]

Copy construction is deleted; nodes have unique list membership.

iplist_impl [constructor]

Move‐construct by transferring traits and node links from X.

~iplist_impl [destructor]

Destroy the list, erasing and deleting all owned nodes.

operator= [deleted]

Copy assignment is deleted; nodes have unique list membership.

operator=

Move‐assign by transferring traits and node links from X.

clear

Erase and delete every node in the list.

clearAndLeakNodesUnsafely

Remove all nodes from the list like clear(), but do not call removeNodeFromList() or deleteNode().

cloneFrom

Clone another list.

erase

Remove the node at where and delete it via traits.

erase

Erase and delete the node pointed to by IT.

erase

Erase and delete the node referred to by IT.

erase

Erase and delete every node in []`first,` last).

getNextNode

Get the next node, or nullptr for the list tail.

getNextNode

Get the next node, or nullptr for the list tail.

getPrevNode

Get the previous node, or nullptr for the list head.

getPrevNode

Get the previous node, or nullptr for the list head.

insert

Copy‐construct a node from New and insert it before where.

insert

Insert owned node New before where and notify traits.

insert

Insert copies of []`first,` last) before where.

insertAfter

Insert New immediately after where (or at begin if empty).

max_size

Return the theoretical maximum number of elements.

merge

Merge sorted list Right into this list using operator<.

merge

Merge sorted list Right into this list using comparator comp.

pop_back

Erase and delete the last node.

pop_front

Erase and delete the first node.

push_back

Insert val at the back of the list.

push_front

Insert val at the front of the list.

remove

Unlink node pointed to by IT without deleting it.

remove

Unlink node referred to by IT without deleting it.

remove

Unlink the node at IT without deleting it; advance IT past it.

remove

Unlink the node at const iterator IT without deleting it.

splice

Move all nodes from L2 to before where.

splice

Move the single node at first from L2 to before where.

splice

Move the single node N from L2 to before where.

splice

Move the single node N from L2 to before where.

splice

Move []`first,` last) from L2 to before where.

swap

Exchange contents with RHS (currently asserts; traits‐unsafe).

Using Declarations

Name

Description

back

Return a reference to the last element.

begin

Return an iterator to the first element.

empty

Return true if the list contains no elements.

end

Return an iterator to the past‐the‐end sentinel.

front

Return a reference to the first element.

rbegin

Return a reverse iterator to the last element.

rend

Return a reverse iterator to the past‐the‐rend sentinel.

size

Return the number of elements (may be linear time).

sort

Sort the list using operator< or a provided comparator.

Derived Classes

Name

Description

SymbolTableList

List that automatically updates parent links and symbol tables.

iplist

An intrusive list with ownership and callbacks specified/controlled by ilist_traits, only with API safe for polymorphic types.

Created with MrDocs