class SetVector

Declaration

template <typename T, typename Vector, typename Set>
class SetVector { /* full declaration omitted */ };

Description

A vector that has set insertion semantics. This adapter class provides a way to keep a set of things that also has the property of a deterministic iteration order. The order of iteration is the order of insertion.

Declared at: llvm/include/llvm/ADT/SetVector.h:40

Templates

T
Vector
Set

Method Overview

  • public SetVector<T, Vector, Set>()
  • public template <typename It> SetVector<T, Vector, Set>(It Start, It End)
  • public const T & back() const
  • public llvm::SetVector::iterator begin()
  • public llvm::SetVector::const_iterator begin() const
  • public void clear()
  • public llvm::SetVector::size_type count(const llvm::SetVector::key_type & key) const
  • public bool empty() const
  • public llvm::SetVector::iterator end()
  • public llvm::SetVector::const_iterator end() const
  • public llvm::SetVector::iterator erase(llvm::SetVector::iterator I)
  • public const T & front() const
  • public ArrayRef<T> getArrayRef() const
  • public bool insert(const llvm::SetVector::value_type & X)
  • public template <typename It>void insert(It Start, It End)
  • public void pop_back()
  • public T pop_back_val()
  • public llvm::SetVector::const_reverse_iterator rbegin() const
  • public llvm::SetVector::reverse_iterator rbegin()
  • public bool remove(const llvm::SetVector::value_type & X)
  • public template <typename UnaryPredicate>bool remove_if(UnaryPredicate P)
  • public llvm::SetVector::const_reverse_iterator rend() const
  • public llvm::SetVector::reverse_iterator rend()
  • public template <class STy>void set_subtract(const STy & S)
  • public template <class STy>bool set_union(const STy & S)
  • public llvm::SetVector::size_type size() const
  • public Vector takeVector()

Methods

SetVector<T, Vector, Set>()

Description

Construct an empty SetVector

Declared at: llvm/include/llvm/ADT/SetVector.h:55

template <typename It>
SetVector<T, Vector, Set>(It Start, It End)

Description

Initialize a SetVector with a range of elements

Declared at: llvm/include/llvm/ADT/SetVector.h:59

Templates

It

Parameters

It Start
It End

const T& back() const

Description

Return the last element of the SetVector.

Declared at: llvm/include/llvm/ADT/SetVector.h:128

llvm::SetVector::iterator begin()

Description

Get an iterator to the beginning of the SetVector.

Declared at: llvm/include/llvm/ADT/SetVector.h:82

llvm::SetVector::const_iterator begin() const

Description

Get a const_iterator to the beginning of the SetVector.

Declared at: llvm/include/llvm/ADT/SetVector.h:87

void clear()

Description

Completely clear the SetVector

Declared at: llvm/include/llvm/ADT/SetVector.h:215

llvm::SetVector::size_type count(
    const llvm::SetVector::key_type& key) const

Description

Count the number of elements of a given key in the SetVector.

Declared at: llvm/include/llvm/ADT/SetVector.h:210

Parameters

const llvm::SetVector::key_type& key

Returns

0 if the element is not in the SetVector, 1 if it is.

bool empty() const

Description

Determine if the SetVector is empty or not.

Declared at: llvm/include/llvm/ADT/SetVector.h:72

llvm::SetVector::iterator end()

Description

Get an iterator to the end of the SetVector.

Declared at: llvm/include/llvm/ADT/SetVector.h:92

llvm::SetVector::const_iterator end() const

Description

Get a const_iterator to the end of the SetVector.

Declared at: llvm/include/llvm/ADT/SetVector.h:97

llvm::SetVector::iterator erase(
    llvm::SetVector::iterator I)

Description

Erase a single element from the set vector.

Declared at: llvm/include/llvm/ADT/SetVector.h:171

Parameters

llvm::SetVector::iterator I

Returns

an iterator pointing to the next element that followed the element erased. This is the end of the SetVector if the last element is erased.

const T& front() const

Description

Return the first element of the SetVector.

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

ArrayRef<T> getArrayRef() const

Declared at: llvm/include/llvm/ADT/SetVector.h:63

bool insert(const llvm::SetVector::value_type& X)

Description

Insert a new element into the SetVector.

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

Parameters

const llvm::SetVector::value_type& X

Returns

true if the element was inserted into the SetVector.

template <typename It>
void insert(It Start, It End)

Description

Insert a range of elements into the SetVector.

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

Templates

It

Parameters

It Start
It End

void pop_back()

Description

Remove the last element of the SetVector.

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

T pop_back_val()

Declared at: llvm/include/llvm/ADT/SetVector.h:227

llvm::SetVector::const_reverse_iterator rbegin()
    const

Description

Get a const_reverse_iterator to the end of the SetVector.

Declared at: llvm/include/llvm/ADT/SetVector.h:107

llvm::SetVector::reverse_iterator rbegin()

Description

Get an reverse_iterator to the end of the SetVector.

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

bool remove(const llvm::SetVector::value_type& X)

Description

Remove an item from the set vector.

Declared at: llvm/include/llvm/ADT/SetVector.h:157

Parameters

const llvm::SetVector::value_type& X

template <typename UnaryPredicate>
bool remove_if(UnaryPredicate P)

Description

Remove items from the set vector based on a predicate function. This is intended to be equivalent to the following code, if we could write it: However, SetVector doesn't expose non-const iterators, making any algorithm like remove_if impossible to use.

Declared at: llvm/include/llvm/ADT/SetVector.h:199

Templates

UnaryPredicate

Parameters

UnaryPredicate P

Returns

true if any element is removed.

llvm::SetVector::const_reverse_iterator rend()
    const

Description

Get a const_reverse_iterator to the beginning of the SetVector.

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

llvm::SetVector::reverse_iterator rend()

Description

Get a reverse_iterator to the beginning of the SetVector.

Declared at: llvm/include/llvm/ADT/SetVector.h:112

template <class STy>
void set_subtract(const STy& S)

Description

Compute This := This - B TODO: We should be able to use set_subtract from SetOperations.h, but SetVector interface is inconsistent with DenseSet.

Declared at: llvm/include/llvm/ADT/SetVector.h:260

Templates

STy

Parameters

const STy& S

template <class STy>
bool set_union(const STy& S)

Description

Compute This := This u S, return whether 'This' changed. TODO: We should be able to use set_union from SetOperations.h, but SetVector interface is inconsistent with DenseSet.

Declared at: llvm/include/llvm/ADT/SetVector.h:245

Templates

STy

Parameters

const STy& S

llvm::SetVector::size_type size() const

Description

Determine the number of elements in the SetVector.

Declared at: llvm/include/llvm/ADT/SetVector.h:77

Vector takeVector()

Description

Clear the SetVector and return the underlying vector.

Declared at: llvm/include/llvm/ADT/SetVector.h:66