ZXFoundation™ 26h2
Loading...
Searching...
No Matches
cap_token Struct Reference

Opaque 64-bit capability token. More...

Public Member Functions

constexpr cap_token (u64 v) noexcept
constexpr auto derive (cap_rights subset) const noexcept -> cap_token
 Derive a new token with a subset of the rights.
constexpr auto generation () const noexcept -> u16
 Extract the generation field.
constexpr auto has_right (cap_rights r) const noexcept -> bool
 Check whether a specific right is present.
constexpr auto object_id () const noexcept -> u16
 Extract the object ID field.
constexpr operator bool () const noexcept
 Check whether the token is valid (non-null).
constexpr auto operator!= (cap_token o) const noexcept -> bool
constexpr auto operator== (cap_token o) const noexcept -> bool
 Compare two tokens for equality.
constexpr auto rights () const noexcept -> cap_rights
 Extract the rights mask.
constexpr auto type () const noexcept -> cap_type
 Extract the type field.

Static Public Member Functions

static constexpr auto make (cap_type type, u16 obj_id, u16 gen, cap_rights rights) noexcept -> cap_token
 Construct a token from its components.

Data Fields

u64 raw {0}
 Raw 64-bit encoding.

Detailed Description

Opaque 64-bit capability token.

Note
Tokens are value types (copyable, movable).

Member Function Documentation

◆ derive()

auto zxfoundation::dgp::cap::cap_token::derive ( cap_rights subset) const->cap_token
inlinenodiscardconstexprexportnoexcept

Derive a new token with a subset of the rights.

Parameters
[in]subsetRights to retain in the derived token.

◆ make()

constexpr auto zxfoundation::dgp::cap::cap_token::make ( cap_type type,
u16 obj_id,
u16 gen,
cap_rights rights )->cap_token
inlinestaticconstexprexportnoexcept

Construct a token from its components.

Parameters
[in]typeResource type discriminator.
[in]obj_idNucleus capability-slot index.
[in]genObject generation counter.
[in]rightsDelegated rights mask.

The documentation for this struct was generated from the following file: