template <const auto& Names, double MaxOverheadRatio = 1.0>

class PerfectSymbolSet

Defined at line 55 of file ../../src/lib/elfldltl/include/lib/elfldltl/perfect-symbol-table.h

This does the heavy lifting at compile time. It computes the necessary size

for a hash table with bucket depth of one for the given set of symbol names.

It produces a permutation of the Names array that assigns a unique table

index to each symbol name. Its static methods provide that computed

computed size, so parallel tables can be indexed by name; and lookups to

translate a name in the set to its index in a table.

Public Methods

auto IndexMap ()

This is a range of (index, name) pairs giving the indices into the

table that are actually in use.

Defined at line 59 of file ../../src/lib/elfldltl/include/lib/elfldltl/perfect-symbol-table.h

uint32_t TableSize ()

This is how many elements a table needs to have a value for each name. In

the ideal case this is exactly Names.size(), so no elements are wasted.

Defined at line 72 of file ../../src/lib/elfldltl/include/lib/elfldltl/perfect-symbol-table.h

uint32_t Overhead ()

This is how many of those elements will go to waste.

Defined at line 75 of file ../../src/lib/elfldltl/include/lib/elfldltl/perfect-symbol-table.h

double OverheadRatio ()

This is the ratio of waste to number of names (the ideal table size).

Defined at line 78 of file ../../src/lib/elfldltl/include/lib/elfldltl/perfect-symbol-table.h

std::optional<uint32_t> Lookup (SymbolName & name)

Find a name in the set. If present, return its table index.

Defined at line 84 of file ../../src/lib/elfldltl/include/lib/elfldltl/perfect-symbol-table.h

std::optional<uint32_t> Lookup (const SymbolName & name)

Defined at line 92 of file ../../src/lib/elfldltl/include/lib/elfldltl/perfect-symbol-table.h

template <random_access_range Range>
std::ranges::iterator_t<Range> Lookup (Range && range, SymbolName & name)

Find a name in the set. If present, return the iterator to its slot in

the range; otherwise, return range.end().

Defined at line 100 of file ../../src/lib/elfldltl/include/lib/elfldltl/perfect-symbol-table.h

template <random_access_range Range>
std::ranges::iterator_t<Range> Lookup (Range && range, const SymbolName & name)

Defined at line 106 of file ../../src/lib/elfldltl/include/lib/elfldltl/perfect-symbol-table.h