LLVM 24.0.0git
llvm::EytzingerTable< T > Class Template Reference

Owning container that stores elements in a complete binary search tree formatted in Eytzinger (breadth-first) order. More...

#include "llvm/ADT/Eytzinger.h"

Public Member Functions

 EytzingerTable ()=default
EytzingerTableSpan< TasSpan () const
template<typename KeyT = T>
std::optional< size_tfindIndex (const KeyT &Target) const
template<typename KeyT = T>
bool contains (const KeyT &Target) const
bool isSorted () const
const Tdata () const
size_t size () const
bool empty () const
const Toperator[] (size_t Idx) const

Static Public Member Functions

template<typename KeyT = T>
static EytzingerTable< Tcreate (std::vector< KeyT > Keys)
 Construct an Eytzinger search tree from a vector of keys by sorting, deduplicating, and reordering elements into breadth-first layout.

Detailed Description

template<typename T>
class llvm::EytzingerTable< T >

Owning container that stores elements in a complete binary search tree formatted in Eytzinger (breadth-first) order.

Definition at line 118 of file Eytzinger.h.

Constructor & Destructor Documentation

◆ EytzingerTable()

template<typename T>
llvm::EytzingerTable< T >::EytzingerTable ( )
default

Referenced by create().

Member Function Documentation

◆ asSpan()

template<typename T>
EytzingerTableSpan< T > llvm::EytzingerTable< T >::asSpan ( ) const
inlinenodiscard

Definition at line 148 of file Eytzinger.h.

Referenced by contains(), findIndex(), and isSorted().

◆ contains()

template<typename T>
template<typename KeyT = T>
bool llvm::EytzingerTable< T >::contains ( const KeyT & Target) const
inlinenodiscard

Definition at line 158 of file Eytzinger.h.

References asSpan().

◆ create()

template<typename T>
template<typename KeyT = T>
EytzingerTable< T > llvm::EytzingerTable< T >::create ( std::vector< KeyT > Keys)
inlinestatic

Construct an Eytzinger search tree from a vector of keys by sorting, deduplicating, and reordering elements into breadth-first layout.

KeyT may differ from T (e.g., creating EytzingerTable<ulittle64_t> from a vector of uint64_t).

Definition at line 131 of file Eytzinger.h.

References EytzingerTable(), llvm::sort(), T, and llvm::unique().

◆ data()

template<typename T>
const T * llvm::EytzingerTable< T >::data ( ) const
inlinenodiscard

Definition at line 164 of file Eytzinger.h.

References T.

◆ empty()

template<typename T>
bool llvm::EytzingerTable< T >::empty ( ) const
inlinenodiscard

Definition at line 166 of file Eytzinger.h.

◆ findIndex()

template<typename T>
template<typename KeyT = T>
std::optional< size_t > llvm::EytzingerTable< T >::findIndex ( const KeyT & Target) const
inlinenodiscard

Definition at line 153 of file Eytzinger.h.

References asSpan().

◆ isSorted()

template<typename T>
bool llvm::EytzingerTable< T >::isSorted ( ) const
inlinenodiscard

Definition at line 162 of file Eytzinger.h.

References asSpan().

◆ operator[]()

template<typename T>
const T & llvm::EytzingerTable< T >::operator[] ( size_t Idx) const
inlinenodiscard

Definition at line 167 of file Eytzinger.h.

References assert(), and T.

◆ size()

template<typename T>
size_t llvm::EytzingerTable< T >::size ( ) const
inlinenodiscard

Definition at line 165 of file Eytzinger.h.


The documentation for this class was generated from the following file: