class simple_ilist

Declaration

template <typename T, class... Options>
class simple_ilist { /* full declaration omitted */ };

Description

A simple intrusive list implementation. This is a simple intrusive list for a \c T that inherits from \c ilist_node<T>. The list never takes ownership of anything inserted in it. Unlike \a iplist<T> and \a ilist<T>, \a simple_ilist<T> never allocates or deletes values, and has no callback traits. The API for adding nodes include \a push_front(), \a push_back(), and \a insert(). These all take values by reference (not by pointer), except for the range version of \a insert(). There are three sets of API for discarding nodes from the list: \a remove(), which takes a reference to the node to remove, \a erase(), which takes an iterator or iterator range and returns the next one, and \a clear(), which empties out the container. All three are constant time operations. None of these deletes any nodes; in particular, if there is a single node in the list, then these have identical semantics: As a convenience for callers, there are parallel APIs that take a \c Disposer (such as \c std::default_delete<T>): \a removeAndDispose(), \a eraseAndDispose(), and \a clearAndDispose(). These have different names because the extra semantic is otherwise non-obvious. They are equivalent to calling \a std::for_each() on the range to be discarded. The currently available \p Options customize the nodes in the list. The same options must be specified in the \a ilist_node instantation for compatibility (although the order is irrelevant). Here are examples of \p Options usage: See \a is_valid_option for steps on adding a new option.

Declared at: llvm/include/llvm/ADT/simple_ilist.h:78

Templates

T
Options

Method Overview

  • public llvm::simple_ilist::const_reference back() const
  • public llvm::simple_ilist::reference back()
  • public llvm::simple_ilist::iterator begin()
  • public llvm::simple_ilist::const_iterator begin() const
  • public void clear()
  • public template <class Disposer>void clearAndDispose(Disposer dispose)
  • public template <class Cloner, class Disposer>void cloneFrom(const simple_ilist<T, Options...> & L2, Cloner clone, Disposer dispose)
  • public bool empty() const
  • public llvm::simple_ilist::const_iterator end() const
  • public llvm::simple_ilist::iterator end()
  • public llvm::simple_ilist::iterator erase(llvm::simple_ilist::iterator First, llvm::simple_ilist::iterator Last)
  • public llvm::simple_ilist::iterator erase(llvm::simple_ilist::iterator I)
  • public template <class Disposer>llvm::simple_ilist::iterator eraseAndDispose(llvm::simple_ilist::iterator I, Disposer dispose)
  • public template <class Disposer>llvm::simple_ilist::iterator eraseAndDispose(llvm::simple_ilist::iterator First, llvm::simple_ilist::iterator Last, Disposer dispose)
  • public llvm::simple_ilist::reference front()
  • public llvm::simple_ilist::const_reference front() const
  • public template <class Iterator>void insert(llvm::simple_ilist::iterator I, Iterator First, Iterator Last)
  • public llvm::simple_ilist::iterator insert(llvm::simple_ilist::iterator I, llvm::simple_ilist::reference Node)
  • public void merge(simple_ilist<T, Options...> & RHS)
  • public template <class Compare>void merge(simple_ilist<T, Options...> & RHS, Compare comp)
  • public void pop_back()
  • public void pop_front()
  • public void push_back(llvm::simple_ilist::reference Node)
  • public void push_front(llvm::simple_ilist::reference Node)
  • public llvm::simple_ilist::reverse_iterator rbegin()
  • public llvm::simple_ilist::const_reverse_iterator rbegin() const
  • public void remove(llvm::simple_ilist::reference N)
  • public template <class Disposer>void removeAndDispose(llvm::simple_ilist::reference N, Disposer dispose)
  • public llvm::simple_ilist::const_reverse_iterator rend() const
  • public llvm::simple_ilist::reverse_iterator rend()
  • public simple_ilist<T, Options...>(simple_ilist<T, Options...> && X)
  • public simple_ilist<T, Options...>(const simple_ilist<T, Options...> &)
  • public simple_ilist<T, Options...>()
  • public llvm::simple_ilist::size_type size() const
  • public template <class Compare>void sort(Compare comp)
  • public void sort()
  • public void splice(llvm::simple_ilist::iterator I, simple_ilist<T, Options...> &, llvm::simple_ilist::iterator First, llvm::simple_ilist::iterator Last)
  • public void splice(llvm::simple_ilist::iterator I, simple_ilist<T, Options...> & L2, llvm::simple_ilist::iterator Node)
  • public void splice(llvm::simple_ilist::iterator I, simple_ilist<T, Options...> & L2)
  • public void swap(simple_ilist<T, Options...> & X)
  • public ~simple_ilist<T, Options...>()

Methods

llvm::simple_ilist::const_reference back() const

Declared at: llvm/include/llvm/ADT/simple_ilist.h:141

llvm::simple_ilist::reference back()

Declared at: llvm/include/llvm/ADT/simple_ilist.h:140

llvm::simple_ilist::iterator begin()

Declared at: llvm/include/llvm/ADT/simple_ilist.h:117

llvm::simple_ilist::const_iterator begin() const

Declared at: llvm/include/llvm/ADT/simple_ilist.h:118

void clear()

Description

Clear the list; never deletes.

Declared at: llvm/include/llvm/ADT/simple_ilist.h:230

template <class Disposer>
void clearAndDispose(Disposer dispose)

Description

Clear the list and dispose of the nodes.

Declared at: llvm/include/llvm/ADT/simple_ilist.h:233

Templates

Disposer

Parameters

Disposer dispose

template <class Cloner, class Disposer>
void cloneFrom(
    const simple_ilist<T, Options...>& L2,
    Cloner clone,
    Disposer dispose)

Description

Clone another list.

Declared at: llvm/include/llvm/ADT/simple_ilist.h:173

Templates

Cloner
Disposer

Parameters

const simple_ilist<T, Options...>& L2
Cloner clone
Disposer dispose

bool empty() const

Description

Check if the list is empty in constant time.

Declared at: llvm/include/llvm/ADT/simple_ilist.h:131

llvm::simple_ilist::const_iterator end() const

Declared at: llvm/include/llvm/ADT/simple_ilist.h:120

llvm::simple_ilist::iterator end()

Declared at: llvm/include/llvm/ADT/simple_ilist.h:119

llvm::simple_ilist::iterator erase(
    llvm::simple_ilist::iterator First,
    llvm::simple_ilist::iterator Last)

Description

Remove a range of nodes; never deletes.

Declared at: llvm/include/llvm/ADT/simple_ilist.h:205

Parameters

llvm::simple_ilist::iterator First
llvm::simple_ilist::iterator Last

llvm::simple_ilist::iterator erase(
    llvm::simple_ilist::iterator I)

Description

Remove a node by iterator; never deletes.

Declared at: llvm/include/llvm/ADT/simple_ilist.h:196

Parameters

llvm::simple_ilist::iterator I

template <class Disposer>
llvm::simple_ilist::iterator eraseAndDispose(
    llvm::simple_ilist::iterator I,
    Disposer dispose)

Description

Remove a node by iterator and dispose of it.

Declared at: llvm/include/llvm/ADT/simple_ilist.h:212

Templates

Disposer

Parameters

llvm::simple_ilist::iterator I
Disposer dispose

template <class Disposer>
llvm::simple_ilist::iterator eraseAndDispose(
    llvm::simple_ilist::iterator First,
    llvm::simple_ilist::iterator Last,
    Disposer dispose)

Description

Remove a range of nodes and dispose of them.

Declared at: llvm/include/llvm/ADT/simple_ilist.h:221

Templates

Disposer

Parameters

llvm::simple_ilist::iterator First
llvm::simple_ilist::iterator Last
Disposer dispose

llvm::simple_ilist::reference front()

Declared at: llvm/include/llvm/ADT/simple_ilist.h:138

llvm::simple_ilist::const_reference front() const

Declared at: llvm/include/llvm/ADT/simple_ilist.h:139

template <class Iterator>
void insert(llvm::simple_ilist::iterator I,
            Iterator First,
            Iterator Last)

Description

Insert a range of nodes; never copies.

Declared at: llvm/include/llvm/ADT/simple_ilist.h:166

Templates

Iterator

Parameters

llvm::simple_ilist::iterator I
Iterator First
Iterator Last

llvm::simple_ilist::iterator insert(
    llvm::simple_ilist::iterator I,
    llvm::simple_ilist::reference Node)

Description

Insert a node by reference; never copies.

Declared at: llvm/include/llvm/ADT/simple_ilist.h:159

Parameters

llvm::simple_ilist::iterator I
llvm::simple_ilist::reference Node

void merge(simple_ilist<T, Options...>& RHS)

Description

Merge in another list.

Declared at: llvm/include/llvm/ADT/simple_ilist.h:257

Parameters

simple_ilist<T, Options...>& RHS

template <class Compare>
void merge(simple_ilist<T, Options...>& RHS,
           Compare comp)

Declared at: llvm/include/llvm/ADT/simple_ilist.h:258

Templates

Compare

Parameters

simple_ilist<T, Options...>& RHS
Compare comp

void pop_back()

Description

Remove the node at the back; never deletes.

Declared at: llvm/include/llvm/ADT/simple_ilist.h:153

void pop_front()

Description

Remove the node at the front; never deletes.

Declared at: llvm/include/llvm/ADT/simple_ilist.h:150

void push_back(llvm::simple_ilist::reference Node)

Description

Insert a node at the back; never copies.

Declared at: llvm/include/llvm/ADT/simple_ilist.h:147

Parameters

llvm::simple_ilist::reference Node

void push_front(
    llvm::simple_ilist::reference Node)

Description

Insert a node at the front; never copies.

Declared at: llvm/include/llvm/ADT/simple_ilist.h:144

Parameters

llvm::simple_ilist::reference Node

llvm::simple_ilist::reverse_iterator rbegin()

Declared at: llvm/include/llvm/ADT/simple_ilist.h:121

llvm::simple_ilist::const_reverse_iterator
rbegin() const

Declared at: llvm/include/llvm/ADT/simple_ilist.h:122

void remove(llvm::simple_ilist::reference N)

Description

Remove a node by reference; never deletes.

Declared at: llvm/include/llvm/ADT/simple_ilist.h:183

Parameters

llvm::simple_ilist::reference N

template <class Disposer>
void removeAndDispose(
    llvm::simple_ilist::reference N,
    Disposer dispose)

Description

Remove a node by reference and dispose of it.

Declared at: llvm/include/llvm/ADT/simple_ilist.h:187

Templates

Disposer

Parameters

llvm::simple_ilist::reference N
Disposer dispose

llvm::simple_ilist::const_reverse_iterator rend()
    const

Declared at: llvm/include/llvm/ADT/simple_ilist.h:126

llvm::simple_ilist::reverse_iterator rend()

Declared at: llvm/include/llvm/ADT/simple_ilist.h:125

simple_ilist<T, Options...>(
    simple_ilist<T, Options...>&& X)

Declared at: llvm/include/llvm/ADT/simple_ilist.h:110

Parameters

simple_ilist<T, Options...>&& X

simple_ilist<T, Options...>(
    const simple_ilist<T, Options...>&)

Declared at: llvm/include/llvm/ADT/simple_ilist.h:106

Parameters

const simple_ilist<T, Options...>&

simple_ilist<T, Options...>()

Declared at: llvm/include/llvm/ADT/simple_ilist.h:102

llvm::simple_ilist::size_type size() const

Description

Calculate the size of the list in linear time.

Declared at: llvm/include/llvm/ADT/simple_ilist.h:134

template <class Compare>
void sort(Compare comp)

Declared at: llvm/include/llvm/ADT/simple_ilist.h:264

Templates

Compare

Parameters

Compare comp

void sort()

Description

Sort the list. @ {

Declared at: llvm/include/llvm/ADT/simple_ilist.h:263

void splice(llvm::simple_ilist::iterator I,
            simple_ilist<T, Options...>&,
            llvm::simple_ilist::iterator First,
            llvm::simple_ilist::iterator Last)

Description

Splice in a range of nodes from another list.

Declared at: llvm/include/llvm/ADT/simple_ilist.h:248

Parameters

llvm::simple_ilist::iterator I
simple_ilist<T, Options...>&
llvm::simple_ilist::iterator First
llvm::simple_ilist::iterator Last

void splice(llvm::simple_ilist::iterator I,
            simple_ilist<T, Options...>& L2,
            llvm::simple_ilist::iterator Node)

Description

Splice in a node from another list.

Declared at: llvm/include/llvm/ADT/simple_ilist.h:243

Parameters

llvm::simple_ilist::iterator I
simple_ilist<T, Options...>& L2
llvm::simple_ilist::iterator Node

void splice(llvm::simple_ilist::iterator I,
            simple_ilist<T, Options...>& L2)

Description

Splice in another list.

Declared at: llvm/include/llvm/ADT/simple_ilist.h:238

Parameters

llvm::simple_ilist::iterator I
simple_ilist<T, Options...>& L2

void swap(simple_ilist<T, Options...>& X)

Description

Swap with another list in place using std::swap.

Declared at: llvm/include/llvm/ADT/simple_ilist.h:156

Parameters

simple_ilist<T, Options...>& X

~simple_ilist<T, Options...>()

Declared at: llvm/include/llvm/ADT/simple_ilist.h:103