Skip to content

ludus::foundation::FrozenStringTable

Ludus Wiki · API overview · Browse API

Class

Immutable owner produced by StringTable::TryFreeze; it cannot be thawed.
It keeps the frozen table's token, entries and storage, so earlier IDs and views stay valid. TryFind and TryResolve take no lock, never allocate, and may run concurrently from any thread. Move, move assignment and destruction require the caller to quiesce those readers first. The creation domain must outlive this owner. A default-constructed owner is empty.

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

#include <ludus/foundation/strings/string_table.hpp>
class ludus::foundation::FrozenStringTable final

Methods

FrozenStringTable

ludus::foundation::FrozenStringTable::FrozenStringTable() noexcept=default
Constructs an empty owner; its lookups return InvalidHandle.

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

~FrozenStringTable

ludus::foundation::FrozenStringTable::~FrozenStringTable() noexcept
Releases all storage to the creation domain. Requires quiescence; outstanding views dangle.

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

FrozenStringTable

ludus::foundation::FrozenStringTable::FrozenStringTable(FrozenStringTable &&other) noexcept
Takes ownership of the storage of other, which becomes empty. Requires quiescence.

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

operator=

FrozenStringTable & ludus::foundation::FrozenStringTable::operator=(FrozenStringTable &&other) noexcept
Releases the current storage, then takes over other, which becomes empty.
Views into the previously owned storage dangle. Self-move does nothing. Requires quiescence of both owners.

Related types: FrozenStringTable

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

FrozenStringTable

ludus::foundation::FrozenStringTable::FrozenStringTable(const FrozenStringTable &)=delete
Not copyable: the owner uniquely owns its storage and token.

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

operator=

FrozenStringTable & ludus::foundation::FrozenStringTable::operator=(const FrozenStringTable &)=delete
Not copyable: the owner uniquely owns its storage and token.

Related types: FrozenStringTable

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

IsValid

bool ludus::foundation::FrozenStringTable::IsValid() const noexcept
Returns true when this object owns frozen storage that has not been moved away.

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

TryFind

StringStatus ludus::foundation::FrozenStringTable::TryFind(std::string_view value, NameId &outId) const noexcept
Looks up an exact spelling in the immutable table without locking or allocating.
Concurrent calls are safe while the owner lives and is not moved or destroyed.
ParameterDescription
value
Counted bytes, checked against the configured spelling rules.
outId
Receives the table-qualified ID on success; unchanged on failure.

Returns

Ok; NotFound when the spelling is absent; InvalidHandle for an empty owner; TooLarge, InvalidUtf8 or EmbeddedZero for a rejected spelling; or ProbeExhausted when corrupted lookup metadata has neither the spelling nor a free slot.

Related types: StringStatus · NameId

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

TryResolve

StringStatus ludus::foundation::FrozenStringTable::TryResolve(NameId id, std::string_view &outSpelling) const &noexcept
Borrows the stored spelling of an ID issued before freezing, without locking or allocating.
Concurrent calls are safe while the owner lives and is not moved or destroyed. The view stays valid until this owner is destroyed or assigned over.
ParameterDescription
id
ID to resolve.
outSpelling
Receives the spelling on success; unchanged on failure.

Returns

Ok; InvalidHandle for an empty owner, a representation-invalid ID or an index beyond the frozen entries; or WrongTable when the ID carries another table's token.

Related types: StringStatus · NameId

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

TryResolve

StringStatus ludus::foundation::FrozenStringTable::TryResolve(NameId, std::string_view &) const &&=delete
Deleted so a view cannot borrow from a temporary owner that is about to be destroyed.

Related types: StringStatus · NameId

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