Skip to content

ludus::foundation::NameId

Ludus Wiki · API overview · Browse API

Struct

Process-local, table-qualified identity of one interned spelling.
A NameId holds no pointer and does not keep its table alive. The default value is invalid. Only the issuing table (or the FrozenStringTable it became) resolves it; never persist it.

Declared in modules/foundation/strings/include/ludus/foundation/strings/string_table.hpp

#include <ludus/foundation/strings/string_table.hpp>
struct ludus::foundation::NameId final

Fields

TableToken

uint32 ludus::foundation::NameId::TableToken {}
Token of the issuing table; zero means no table. Tokens are never reused in a process.

Related types: uint32

Declared in modules/foundation/strings/include/ludus/foundation/strings/string_table.hpp

Index

StringIndex ludus::foundation::NameId::Index
Entry index inside the issuing table.

Related types: StringIndex

Declared in modules/foundation/strings/include/ludus/foundation/strings/string_table.hpp

Methods

IsValid

constexpr bool ludus::foundation::NameId::IsValid() const noexcept
Checks the representation only: a nonzero token and a non-sentinel index.
True does not prove that the issuing table is still alive or that the index is in range; TryResolve performs those checks.

Declared in modules/foundation/strings/include/ludus/foundation/strings/string_table.hpp

Members

operator==

constexpr bool operator==(NameId, NameId) noexcept=default
Compares token and index.
IDs from one table are equal exactly when their spellings are equal, because a table stores each spelling once. IDs from different tables never compare equal, even for the same bytes.

Related types: NameId

Declared in modules/foundation/strings/include/ludus/foundation/strings/string_table.hpp