ludus::foundation::identity¶
Ludus Wiki · API overview · Browse API
Namespace
Declared in modules/foundation/identity/include/ludus/foundation/identity/handle.hpp
Related declarations¶
- ludus::foundation::identity::AssetTag
- ludus::foundation::identity::EntropySource
- ludus::foundation::identity::Handle
- ludus::foundation::identity::InstanceTag
- ludus::foundation::identity::PersistentObjectKey
- ludus::foundation::identity::SourceObjectTag
- ludus::foundation::identity::TypedUuid
- ludus::foundation::identity::Uuid
Enumerations¶
GenerationStatus¶
enum class GenerationStatus : uint8
Related types: uint8
Advanced¶
Advanced
Retired¶
Retired
InvalidGeneration¶
InvalidGeneration
Declared in modules/foundation/identity/include/ludus/foundation/identity/handle.hpp
LifetimeIdStatus¶
enum class LifetimeIdStatus : uint8
Related types: uint8
Success¶
Success
IdentityExhausted¶
IdentityExhausted
Declared in modules/foundation/identity/include/ludus/foundation/identity/lifetime.hpp
UuidPolicy¶
enum class UuidPolicy : uint8
Related types: uint8
RequireVersion4¶
RequireVersion4
AllowNilOrVersion4¶
AllowNilOrVersion4
Declared in modules/foundation/identity/include/ludus/foundation/identity/uuid.hpp
UuidStatus¶
enum class UuidStatus : uint8
Related types: uint8
Success¶
Success
MalformedInput¶
MalformedInput
8-4-4-4-12 hexadecimal, or an input has the wrong size. NilIdentity¶
NilIdentity
UnsupportedVersion¶
UnsupportedVersion
UnsupportedVariant¶
UnsupportedVariant
InsufficientSpace¶
InsufficientSpace
EntropyUnavailable¶
EntropyUnavailable
Declared in modules/foundation/identity/include/ludus/foundation/identity/uuid.hpp
Aliases¶
AssetId¶
using ludus::foundation::identity::AssetId = TypedUuid<AssetTag>
Related types: AssetTag · TypedUuid
Declared in modules/foundation/identity/include/ludus/foundation/identity/uuid.hpp
SourceObjectId¶
using ludus::foundation::identity::SourceObjectId = TypedUuid<SourceObjectTag>
Related types: SourceObjectTag · TypedUuid
Declared in modules/foundation/identity/include/ludus/foundation/identity/uuid.hpp
InstanceId¶
using ludus::foundation::identity::InstanceId = TypedUuid<InstanceTag>
Related types: InstanceTag · TypedUuid
Declared in modules/foundation/identity/include/ludus/foundation/identity/uuid.hpp
Constants and variables¶
FIRST_GENERATION¶
constexpr uint32 ludus::foundation::identity::FIRST_GENERATION = 1
Related types: uint32
Declared in modules/foundation/identity/include/ludus/foundation/identity/handle.hpp
TERMINAL_GENERATION¶
constexpr uint32 ludus::foundation::identity::TERMINAL_GENERATION = ~uint32{0}
Related types: uint32
Declared in modules/foundation/identity/include/ludus/foundation/identity/handle.hpp
LAST_LIFETIME_ID¶
constexpr uint64 ludus::foundation::identity::LAST_LIFETIME_ID = ~uint64{0} - 1
Related types: uint64
Declared in modules/foundation/identity/include/ludus/foundation/identity/lifetime.hpp
UUID_BYTE_COUNT¶
constexpr usize ludus::foundation::identity::UUID_BYTE_COUNT = 16
Related types: usize
Declared in modules/foundation/identity/include/ludus/foundation/identity/uuid.hpp
UUID_TEXT_LENGTH¶
constexpr usize ludus::foundation::identity::UUID_TEXT_LENGTH = 36
8-4-4-4-12 UUID text, without a terminator. Related types: usize
Declared in modules/foundation/identity/include/ludus/foundation/identity/uuid.hpp
UUID_TEXT_BUFFER_BYTES¶
constexpr usize ludus::foundation::identity::UUID_TEXT_BUFFER_BYTES = UUID_TEXT_LENGTH + 1
Related types: usize
Declared in modules/foundation/identity/include/ludus/foundation/identity/uuid.hpp
UUID_VERSION_RANDOM¶
constexpr uint8 ludus::foundation::identity::UUID_VERSION_RANDOM = 4
Related types: uint8
Declared in modules/foundation/identity/include/ludus/foundation/identity/uuid.hpp
UUID_VERSION_BYTE_INDEX¶
constexpr usize ludus::foundation::identity::UUID_VERSION_BYTE_INDEX = 6
Related types: usize
Declared in modules/foundation/identity/include/ludus/foundation/identity/uuid.hpp
UUID_VARIANT_BYTE_INDEX¶
constexpr usize ludus::foundation::identity::UUID_VARIANT_BYTE_INDEX = 8
Related types: usize
Declared in modules/foundation/identity/include/ludus/foundation/identity/uuid.hpp
UUID_VARIANT_MASK¶
constexpr uint8 ludus::foundation::identity::UUID_VARIANT_MASK = 0xC0
Related types: uint8
Declared in modules/foundation/identity/include/ludus/foundation/identity/uuid.hpp
UUID_STANDARD_VARIANT_BITS¶
constexpr uint8 ludus::foundation::identity::UUID_STANDARD_VARIANT_BITS = 0x80
10 of RFC 9562 UUIDs, positioned within UUID_VARIANT_MASK. Related types: uint8
Declared in modules/foundation/identity/include/ludus/foundation/identity/uuid.hpp
Functions¶
AdvanceGeneration¶
LUDUS_INLINE constexpr GenerationStatus ludus::foundation::identity::AdvanceGeneration(uint32 &inoutGeneration) noexcept
| Parameter | Description |
|---|---|
inoutGeneration |
The released incarnation's generation; incremented only when the result is GenerationStatus::Advanced.
|
Returns
Related types: uint32 · GenerationStatus
Declared in modules/foundation/identity/include/ludus/foundation/identity/handle.hpp
TryIssueLifetimeId¶
LifetimeIdStatus ludus::foundation::identity::TryIssueLifetimeId(uint64 &outLifetimeId) noexcept
| Parameter | Description |
|---|---|
outLifetimeId |
Receives the token on success; unchanged on exhaustion.
|
Returns
Warning
Related types: uint64 · LifetimeIdStatus
Declared in modules/foundation/identity/include/ludus/foundation/identity/lifetime.hpp
ValidateUuid¶
UuidStatus ludus::foundation::identity::ValidateUuid(const Uuid &value, UuidPolicy policy) noexcept
Returns
Related types: UuidPolicy · UuidStatus · Uuid
Declared in modules/foundation/identity/include/ludus/foundation/identity/uuid.hpp
TryParseUuid¶
UuidStatus ludus::foundation::identity::TryParseUuid(const char *text, usize size, UuidPolicy policy, Uuid &outValue) noexcept
-. Digits are case-insensitive. Whitespace, braces, urn:uuid: prefixes, missing or extra separators and terminators inside size are rejected. The decoded value is then checked with ValidateUuid(). No allocation; uses no shared state. | Parameter | Description |
|---|---|
text |
Input characters; may be null only when size is zero.
|
size |
Number of characters to parse.
|
policy |
Which decoded values are accepted.
|
outValue |
Receives the value on Success; unchanged on any failure.
|
Returns
Related types: usize · UuidPolicy · UuidStatus · Uuid
Declared in modules/foundation/identity/include/ludus/foundation/identity/uuid.hpp
FormatUuid¶
UuidStatus ludus::foundation::identity::FormatUuid(const Uuid &value, char *text, usize capacity) noexcept
8-4-4-4-12 text. | Parameter | Description |
|---|---|
value |
UUID to format.
|
text |
Destination; may be null only when capacity is zero.
|
capacity |
Size of the destination in bytes.
|
Returns
Related types: usize · UuidStatus · Uuid
Declared in modules/foundation/identity/include/ludus/foundation/identity/uuid.hpp
TryMakeUuidV4¶
UuidStatus ludus::foundation::identity::TryMakeUuidV4(const uint8 *randomBytes, usize size, Uuid &outValue) noexcept
| Parameter | Description |
|---|---|
randomBytes |
Input bytes; may be null only when size is zero.
|
size |
Number of bytes; must equal UUID_BYTE_COUNT.
|
outValue |
Receives the UUID on Success; unchanged on failure.
|
Returns
Related types: uint8 · usize · UuidStatus · Uuid
Declared in modules/foundation/identity/include/ludus/foundation/identity/uuid.hpp
TryGenerateUuidV4¶
UuidStatus ludus::foundation::identity::TryGenerateUuidV4(const EntropySource &source, Uuid &outValue) noexcept
| Parameter | Description |
|---|---|
source |
Entropy provider; a null FillBytesOrNull is reported as unavailable.
|
outValue |
Receives the UUID on Success; unchanged when entropy fails, with no partial output.
|
Returns
Related types: UuidStatus · EntropySource · Uuid
Declared in modules/foundation/identity/include/ludus/foundation/identity/uuid.hpp