Identifier of a registered component type. Packs the component id, size, alignment, storage mode and SoA layout into one 64-bit value.
More...
#include <id.h>
|
|
| Component (uint32_t id, uint32_t soa, uint32_t size, uint32_t alig, DataStorageType storage) noexcept |
| |
| GAIA_NODISCARD constexpr auto | id () const noexcept |
| | Component id.
|
| |
| GAIA_NODISCARD constexpr auto | soa () const noexcept |
| | Whether the component uses SoA storage.
|
| |
| GAIA_NODISCARD constexpr auto | size () const noexcept |
| | Component size in bytes.
|
| |
| GAIA_NODISCARD constexpr auto | alig () const noexcept |
| | Component alignment in bytes.
|
| |
| GAIA_NODISCARD constexpr DataStorageType | storage_type () const noexcept |
| | Storage mode of the component.
|
| |
| GAIA_NODISCARD constexpr auto | value () const noexcept |
| | Raw identifier value.
|
| |
|
GAIA_NODISCARD constexpr bool | operator== (Component other) const noexcept |
| |
|
GAIA_NODISCARD constexpr bool | operator!= (Component other) const noexcept |
| |
|
GAIA_NODISCARD constexpr bool | operator< (Component other) const noexcept |
| |
| template<typename Serializer > |
| void | save (Serializer &s) const |
| | Serializes the component id.
|
| |
| template<typename Serializer > |
| void | load (Serializer &s) |
| | Deserializes the component id.
|
| |
|
|
union { | |
| |
|
InternalData data | |
| | Structured view of the packed value.
|
| |
|
Identifier val | |
| | Raw 64-bit value.
|
| |
| }; | | |
| |
|
|
static constexpr uint32_t | IdMask = IdentifierIdBad |
| | Bit mask covering all valid component ids.
|
| |
|
static constexpr uint32_t | MaxComponentSize_Bits = 13 |
| | Number of bits used to store the component size.
|
| |
|
static constexpr uint32_t | MaxComponentSizeInBytes = (1 << MaxComponentSize_Bits) - 1 |
| | Largest component size storable, in bytes.
|
| |
|
static constexpr uint32_t | MaxAlignment_Bits = MaxComponentSize_Bits |
| | Number of bits used to store the component alignment.
|
| |
|
static constexpr uint32_t | MaxAlignment = MaxComponentSizeInBytes |
| | Largest component alignment storable.
|
| |
Identifier of a registered component type. Packs the component id, size, alignment, storage mode and SoA layout into one 64-bit value.
◆ alig()
| GAIA_NODISCARD constexpr auto gaia::ecs::Component::alig |
( |
| ) |
const |
|
inlineconstexprnoexcept |
◆ id()
| GAIA_NODISCARD constexpr auto gaia::ecs::Component::id |
( |
| ) |
const |
|
inlineconstexprnoexcept |
◆ load()
template<typename Serializer >
| void gaia::ecs::Component::load |
( |
Serializer & |
s | ) |
|
|
inline |
Deserializes the component id.
- Template Parameters
-
| Serializer | serializer type. |
- Parameters
-
| s | serializer to read from. |
◆ save()
template<typename Serializer >
| void gaia::ecs::Component::save |
( |
Serializer & |
s | ) |
const |
|
inline |
Serializes the component id.
- Template Parameters
-
| Serializer | serializer type. |
- Parameters
-
◆ size()
| GAIA_NODISCARD constexpr auto gaia::ecs::Component::size |
( |
| ) |
const |
|
inlineconstexprnoexcept |
◆ soa()
| GAIA_NODISCARD constexpr auto gaia::ecs::Component::soa |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Whether the component uses SoA storage.
- Returns
- Non-zero when SoA storage is used.
◆ storage_type()
| GAIA_NODISCARD constexpr DataStorageType gaia::ecs::Component::storage_type |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Storage mode of the component.
- Returns
- Storage mode of the component.
◆ value()
| GAIA_NODISCARD constexpr auto gaia::ecs::Component::value |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Raw identifier value.
- Returns
- Raw 64-bit value.
The documentation for this struct was generated from the following file:
- /home/runner/work/gaia-ecs/gaia-ecs/include/gaia/ecs/id.h