Packed identifier for a job-pool slot, generation, and priority.
More...
#include <jobhandle.h>
|
|
using | JobSizeType = std::conditional_t<(AllBits > 32), uint64_t, uint32_t > |
| | Integer type large enough to hold all packed fields.
|
| |
|
|
| JobHandle () |
| | Creates the null job handle.
|
| |
| | JobHandle (JobId id, JobGenId gen, JobGenId prio) |
| | Creates a handle from its component fields.
|
| |
| | JobHandle (uint32_t value) |
| | Creates a handle from its packed representation.
|
| |
|
| JobHandle (JobHandle &&) noexcept=default |
| |
|
| JobHandle (const JobHandle &)=default |
| |
|
JobHandle & | operator= (JobHandle &&) noexcept=default |
| |
|
JobHandle & | operator= (const JobHandle &)=default |
| |
| GAIA_NODISCARD constexpr bool | operator== (const JobHandle &other) const noexcept |
| | Compares packed handle values.
|
| |
| GAIA_NODISCARD constexpr bool | operator!= (const JobHandle &other) const noexcept |
| | Compares packed handle values.
|
| |
| GAIA_NODISCARD auto | id () const |
| | Returns the job-pool slot identifier.
|
| |
| GAIA_NODISCARD auto | gen () const |
| | Returns the slot generation.
|
| |
| GAIA_NODISCARD auto | prio () const |
| | Returns the encoded priority bit.
|
| |
| GAIA_NODISCARD auto | value () const |
| | Returns the packed handle representation.
|
| |
|
|
static constexpr JobInternalType | IdBits = 20 |
| | Number of bits reserved for the slot identifier.
|
| |
|
static constexpr JobInternalType | GenBits = 11 |
| | Number of bits reserved for the generation.
|
| |
|
static constexpr JobInternalType | PrioBits = 1 |
| | Number of bits reserved for the priority.
|
| |
|
static constexpr JobInternalType | AllBits = IdBits + GenBits + PrioBits |
| | Total number of bits used by a packed handle.
|
| |
|
static constexpr JobInternalType | IdMask = (uint32_t)(uint64_t(1) << IdBits) - 1 |
| | Mask selecting the slot identifier.
|
| |
|
static constexpr JobInternalType | GenMask = (uint32_t)(uint64_t(1) << GenBits) - 1 |
| | Mask selecting the unshifted generation.
|
| |
|
static constexpr JobInternalType | PrioMask = (uint32_t)(uint64_t(1) << PrioBits) - 1 |
| | Mask selecting the unshifted priority.
|
| |
Packed identifier for a job-pool slot, generation, and priority.
◆ JobHandle() [1/2]
| gaia::mt::JobHandle::JobHandle |
( |
JobId |
id, |
|
|
JobGenId |
gen, |
|
|
JobGenId |
prio |
|
) |
| |
|
inline |
Creates a handle from its component fields.
- Parameters
-
| id | Job-pool slot identifier. |
| gen | Slot generation. |
| prio | Encoded priority bit. |
◆ JobHandle() [2/2]
| gaia::mt::JobHandle::JobHandle |
( |
uint32_t |
value | ) |
|
|
inlineexplicit |
Creates a handle from its packed representation.
- Parameters
-
| value | Packed handle value. |
◆ gen()
| GAIA_NODISCARD auto gaia::mt::JobHandle::gen |
( |
| ) |
const |
|
inline |
Returns the slot generation.
- Returns
- Generation value.
◆ id()
| GAIA_NODISCARD auto gaia::mt::JobHandle::id |
( |
| ) |
const |
|
inline |
Returns the job-pool slot identifier.
- Returns
- Slot identifier.
◆ operator!=()
| GAIA_NODISCARD constexpr bool gaia::mt::JobHandle::operator!= |
( |
const JobHandle & |
other | ) |
const |
|
inlineconstexprnoexcept |
Compares packed handle values.
- Parameters
-
- Returns
- True when the handles differ.
◆ operator==()
| GAIA_NODISCARD constexpr bool gaia::mt::JobHandle::operator== |
( |
const JobHandle & |
other | ) |
const |
|
inlineconstexprnoexcept |
Compares packed handle values.
- Parameters
-
- Returns
- True when both handles are identical.
◆ prio()
| GAIA_NODISCARD auto gaia::mt::JobHandle::prio |
( |
| ) |
const |
|
inline |
Returns the encoded priority bit.
- Returns
- Priority bit.
◆ value()
| GAIA_NODISCARD auto gaia::mt::JobHandle::value |
( |
| ) |
const |
|
inline |
Returns the packed handle representation.
- Returns
- Packed value.
The documentation for this struct was generated from the following file:
- /home/runner/work/gaia-ecs/gaia-ecs/include/gaia/mt/jobhandle.h