5#include <vitrio/export.hpp>
38 static constexpr std::size_t
no_key =
39 std::numeric_limits<std::size_t>::max();
174 std::
vector<std::
string> m_keys;
175 std::
vector<std::
size_t> m_entries;
A list of keys in which equal keys are held once.
Definition interned_key_list.hpp:32
std::size_t get_entry_count() const noexcept
Get how many entries are held.
void reserve(std::size_t keys, std::size_t entries)
Make room without allocating later.
static constexpr std::size_t no_key
Index reported for a key that was never interned.
Definition interned_key_list.hpp:38
interned_key_list() noexcept
Construct a list holding no key and no entry.
std::size_t find(const std::string &key) const noexcept
Get the index a key was interned under.
void clear() noexcept
Drop every key and every entry, keeping both capacities.
std::size_t append(std::size_t key_index)
Append one entry referring to an interned key.
std::size_t get_key_count() const noexcept
Get how many distinct keys are held.
std::size_t intern(std::string key)
Intern a key without appending an entry.
const std::string & get(std::size_t entry_index) const noexcept
Get the key one entry refers to.
std::size_t get_key_index(std::size_t entry_index) const noexcept
Get which interned key one entry refers to.
const std::string & get_key(std::size_t key_index) const noexcept
Get one of the interned keys.
A view of a contiguous sequence of elements.
Definition span.hpp:29