template <typename, typename, SizeOrder, typename>

class SinglyLinkedList

Defined at line 279 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

Public Members

static SizeOrder ListSizeOrder
static const bool SupportsConstantOrderErase
static const bool SupportsConstantOrderSize
static const bool IsAssociative
static const bool IsSequenced

Public Methods

void SinglyLinkedList<PtrType_, TagType_, ListSizeOrder_, NodeTraits_> ()

Default construction gives an empty list.

Defined at line 313 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

void SinglyLinkedList<PtrType_, TagType_, ListSizeOrder_, NodeTraits_> (SinglyLinkedList<PtrType_, TagType_, ListSizeOrder_, NodeTraits_> && other_list)

Rvalue construction is permitted, but will result in the move of the list

contents from one instance of the list to the other (even for unmanaged

pointers).

Make sure to expand our default constructor as well in order to pick up the

static asserts that we put there.

Defined at line 332 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

SinglyLinkedList<PtrType_, TagType_, ListSizeOrder_, NodeTraits_> & operator= (SinglyLinkedList<PtrType_, TagType_, ListSizeOrder_, NodeTraits_> && other_list)

Rvalue assignment is permitted for managed lists, and when the target is

an empty list of unmanaged pointers. Like Rvalue construction, it will

result in the move of the source contents to the destination.

Defined at line 339 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

void ~SinglyLinkedList<PtrType_, TagType_, ListSizeOrder_, NodeTraits_> ()

Defined at line 348 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

iterator begin ()

Standard begin/end, cbegin/cend iterator accessors.

Defined at line 363 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

const_iterator begin ()

Defined at line 364 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

const_iterator cbegin ()

Defined at line 365 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

iterator end ()

Defined at line 367 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

const_iterator end ()

Defined at line 368 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

const_iterator cend ()

Defined at line 369 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

iterator make_iterator (ValueType & obj)

make_iterator : Construct an iterator out of a pointer to an object.

Defined at line 372 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

const_iterator make_iterator (const ValueType & obj)

Defined at line 376 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

iterator materialize_iterator (ValueType & obj)

materialize_iterator : Construct an iterator out of a pointer to an object,

without a reference to the container.

USE WITH CAUTION: The caller is responsible for ensuring it is safe to

access the container when using this iterator. In particular, static lock

analysis will not detect access without holding the required locks guarding

the container.

Defined at line 388 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

const_iterator materialize_iterator (const ValueType & obj)

Defined at line 392 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

bool is_empty ()

is_empty

True if the list has at least one element in it, false otherwise.

Defined at line 400 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

typename PtrTraits::RefType front ()

front

Return a reference to the element at the front of the list without

removing it. It is an error to call front on an empty list.

Defined at line 409 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

typename PtrTraits::ConstRefType front ()

Defined at line 413 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

void push_front (const PtrType & ptr)

push_front

Push an element onto the front of the lists. Lvalue and Rvalue

versions are supplied in order to support move semantics. It

is an error to attempt to push a nullptr instance of PtrType.

Defined at line 423 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

void push_front (PtrType && ptr)

Defined at line 424 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

iterator insert_after (const iterator & iter, const PtrType & ptr)

insert_after

Insert an element after iter in the list, returning an iterator to the

newly-created element. It is an error to attempt to push a nullptr

instance of PtrType, or to attempt to push with iter == end().

Defined at line 440 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

iterator insert_after (const iterator & iter, PtrType && ptr)

Defined at line 443 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

PtrType pop_front ()

pop_front

Removes the head of the list and transfer the pointer to the

caller. If the list is empty, return a nullptr instance of

PtrType.

Defined at line 465 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

void clear ()

clear

Clear out the list, unlinking all of the elements in the process. For

managed pointer types, this will release all references held by the list

to the objects which were in it.

Defined at line 484 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

void clear_unsafe ()

clear_unsafe

A special clear operation which just resets the internal container

structure, but leaves all of the node-state(s) of the current element(s)

alone.

Only usable with containers of unmanaged pointers (Very Bad things can

happen if you try this with containers of managed pointers) whose nodes

have the NodeOptions::AllowClearUnsafe option set.

Note: While this can be useful in special cases (such as resetting a free

list for a pool/slab allocator during destruction), you normally do not

want this behavior. Think carefully before calling this!

Defined at line 508 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

PtrType erase_next (const iterator & iter)

erase_next

Remove the element in the list which follows iter and return a pointer to

the removed element. If there is no element in the list which follows

iter, return a nullptr instance of PtrType. It is an error to attempt to

erase_next an invalid iterator (either an uninitialized iterator, or an

iterator which is equal to end())

Defined at line 526 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

void swap (SinglyLinkedList<PtrType_, TagType_, ListSizeOrder_, NodeTraits_> & other)

swap

swaps the contest of two lists.

Defined at line 545 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

size_t size_slow ()

size_slow

count the elements in the list in O(n) fashion

Defined at line 555 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

size_t size ()

size : Only allowed when the user has selected an SizeOrder::Constant for this list.

Defined at line 571 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

template <typename UnaryFn>
PtrType erase_if (UnaryFn fn)

erase_if

Find the first member of the list which satisfies the predicate given by

'fn' and remove it from the list, returning a referenced pointer to the

removed element. Return nullptr if no member satisfies the predicate.

Defined at line 584 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

template <typename UnaryFn>
const_iterator find_if (UnaryFn fn)

find_if

Find the first member of the list which satisfies the predicate given by

'fn' and return an iterator in the list which refers to it. Return end()

if no member satisfies the predicate.

Defined at line 608 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

template <typename UnaryFn>
iterator find_if (UnaryFn fn)

Defined at line 618 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

template <typename UnaryFn>
PtrType replace_if (UnaryFn fn, const PtrType & ptr)

replace_if (copy)

Find the first member of the list which satisfies the predicate given by

'fn' and replace it in the list, returning a referenced pointer to the

replaced element. If no member satisfies the predicate, simply return

nullptr instead.

Defined at line 630 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

template <typename UnaryFn>
PtrType replace_if (UnaryFn fn, PtrType && ptr)

replace_if (move)

Same as the copy version, except that if no member satisfies the

predicate, the original reference is returned instead of nullptr.

Defined at line 669 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

ContainerType split_after (const iterator & iter)

Split the list immediately after |iter|, returning the remainder of the

list in a new list instance.

|iter| *must* refer to a member of the list being split. Attempt to split

list A with an iterator to an element which is a member of list B will

result in undefined behavior which may not be detectable at runtime.

Defined at line 708 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

ContainerType split_after (ValueType & obj)

Alternate form of split_after which uses an object reference instead of an

iterator to determine the split point. Just like the iterator form of

split_after, |obj| *must* be a member of the list being split.

Defined at line 721 of file ../../zircon/system/ulib/fbl/include/fbl/intrusive_single_list.h

Records

Friends

template <typenametypenameSizeOrdertypename>
class SinglyLinkedListChecker