TachyonUI 0.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
tachyon::ID Struct Reference

A 64-bit element ID whose bit layout depends on its IDMode. More...

#include <gui_core/gui_id.h>

Classes

union  Value
 The packed bits, viewed per mode; internal (use GetMode / Value / IDManager). More...

Public Member Functions

IDMode GetMode () const
 How the ID was made.
uint64_t Value () const
 The raw 64 bits, e.g. as a hash or map key; not stable across runs.
constexpr bool operator== (const ID &other) const noexcept
constexpr bool operator!= (const ID &other) const noexcept
constexpr bool operator< (const ID &other) const noexcept
constexpr bool operator> (const ID &other) const noexcept
constexpr bool operator<= (const ID &other) const noexcept
constexpr bool operator>= (const ID &other) const noexcept

Static Public Member Functions

static constexpr ID Invalid ()
 The "no element" ID (all bits zero); also the default for optional ID parameters.

Public Attributes

union tachyon::ID::Value value

Static Public Attributes

static constexpr uint64_t MODE_BITS = 2
 Bit layout sizes; internal.
static constexpr uint64_t MAX_STATIC_INDEX_BITS = 32
static constexpr uint64_t MAX_STATIC_GEN_BITS = (64 - MODE_BITS - MAX_STATIC_INDEX_BITS)
static constexpr uint64_t MAX_STATIC_INDEX_MASK = (1ull << MAX_STATIC_INDEX_BITS) - 1
static constexpr uint64_t MAX_STATIC_GEN_MASK = (1ull << MAX_STATIC_GEN_BITS) - 1
static constexpr uint64_t MAX_RANGED_SIZE_BITS = 25
static constexpr uint64_t MAX_RANGED_HASH_BITS = (64 - MODE_BITS - MAX_RANGED_SIZE_BITS)
static constexpr uint64_t MAX_RANGED_SIZE_MASK = (1ull << MAX_RANGED_SIZE_BITS) - 1
static constexpr uint64_t MAX_RANGED_HASH_MASK = (1ull << MAX_RANGED_HASH_BITS) - 1

Detailed Description

A 64-bit element ID whose bit layout depends on its IDMode.

Runtime only: not stable across runs, so never serialize it.

Examples
controls/controls.cpp, custom_theme/custom_theme.cpp, docking/docking.cpp, and hello_world/hello_world.cpp.

Member Function Documentation

◆ Invalid()

constexpr ID tachyon::ID::Invalid ( )
inlinestaticconstexpr

The "no element" ID (all bits zero); also the default for optional ID parameters.

Examples
controls/controls.cpp, custom_theme/custom_theme.cpp, docking/docking.cpp, hello_world/hello_world.cpp, and host_device/host_device.cpp.

◆ GetMode()

IDMode tachyon::ID::GetMode ( ) const
inline

How the ID was made.

◆ Value()

uint64_t tachyon::ID::Value ( ) const
inline

The raw 64 bits, e.g. as a hash or map key; not stable across runs.

◆ operator==()

bool tachyon::ID::operator== ( const ID & other) const
inlineconstexprnoexcept

◆ operator!=()

bool tachyon::ID::operator!= ( const ID & other) const
inlineconstexprnoexcept

◆ operator<()

bool tachyon::ID::operator< ( const ID & other) const
inlineconstexprnoexcept

◆ operator>()

bool tachyon::ID::operator> ( const ID & other) const
inlineconstexprnoexcept

◆ operator<=()

bool tachyon::ID::operator<= ( const ID & other) const
inlineconstexprnoexcept

◆ operator>=()

bool tachyon::ID::operator>= ( const ID & other) const
inlineconstexprnoexcept

Member Data Documentation

◆ MODE_BITS

uint64_t tachyon::ID::MODE_BITS = 2
staticconstexpr

Bit layout sizes; internal.

◆ MAX_STATIC_INDEX_BITS

uint64_t tachyon::ID::MAX_STATIC_INDEX_BITS = 32
staticconstexpr

◆ MAX_STATIC_GEN_BITS

uint64_t tachyon::ID::MAX_STATIC_GEN_BITS = (64 - MODE_BITS - MAX_STATIC_INDEX_BITS)
staticconstexpr

◆ MAX_STATIC_INDEX_MASK

uint64_t tachyon::ID::MAX_STATIC_INDEX_MASK = (1ull << MAX_STATIC_INDEX_BITS) - 1
staticconstexpr

◆ MAX_STATIC_GEN_MASK

uint64_t tachyon::ID::MAX_STATIC_GEN_MASK = (1ull << MAX_STATIC_GEN_BITS) - 1
staticconstexpr

◆ MAX_RANGED_SIZE_BITS

uint64_t tachyon::ID::MAX_RANGED_SIZE_BITS = 25
staticconstexpr

◆ MAX_RANGED_HASH_BITS

uint64_t tachyon::ID::MAX_RANGED_HASH_BITS = (64 - MODE_BITS - MAX_RANGED_SIZE_BITS)
staticconstexpr

◆ MAX_RANGED_SIZE_MASK

uint64_t tachyon::ID::MAX_RANGED_SIZE_MASK = (1ull << MAX_RANGED_SIZE_BITS) - 1
staticconstexpr

◆ MAX_RANGED_HASH_MASK

uint64_t tachyon::ID::MAX_RANGED_HASH_MASK = (1ull << MAX_RANGED_HASH_BITS) - 1
staticconstexpr

◆ value

union tachyon::ID::Value tachyon::ID::value

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