Toast Engine
Loading...
Searching...
No Matches
toast::UID Struct Reference

Public Member Functions

 UID (uint64_t val)
 operator std::string () const noexcept
 Implicit conversion to std::string.
auto operator<=> (const UID &other) const noexcept -> std::strong_ordering
auto operator== (const UID &other) const noexcept -> bool
auto get () const noexcept -> std::string
 Encodes the 64-bit value as an 11-character base64url string.
auto data () const noexcept -> uint64_t
 Returns the raw 64-bit integer; useful for hashing or serialization that owns the encoding.

Static Public Member Functions

static auto toString (uint64_t uid) -> std::string
 Encodes any 64-bit value as an 11-character base64url string; same encoding as get().
static auto fromString (std::string_view b64) -> uint64_t
 Decodes an 11-character base64url string produced by toString(); inverse of toString().
static auto make () -> UID
 Generates and returns a fresh unique UID using the same algorithm as the node registry.

Friends

class Engine
class INodeOwner
class assets::Prefab

Member Function Documentation

◆ get()

auto toast::UID::get ( ) const -> std::string
nodiscardnoexcept

Encodes the 64-bit value as an 11-character base64url string.

Returns
The canonical text representation, e.g. "aB3xY_k9mZw"
Here is the caller graph for this function:

◆ operator std::string()

toast::UID::operator std::string ( ) const
noexcept

Implicit conversion to std::string.

Note
Allocates; prefer get() when you want to pass the result to std::format

The documentation for this struct was generated from the following files:
  • engine/src/toast/uid.hpp
  • engine/src/toast/uid.cpp