Skip to main content

ResourceTypeId Class

Unique type identifier for engine resources. More...

Declaration

class helios::engine::runtime::world::types::ResourceTypeId { ... }

Private Member Typedefs Index

usingResourceType = helios_engine_common_tag_ResourceTypes

Friends Index

booloperator==

Public Constructors Index

ResourceTypeId (const size_t id)

Constructs a ResourceTypeId with a specific value. More...

ResourceTypeId (helios::core::types::no_init_t)

Constructs an uninitialized ResourceTypeId. More...

Public Member Functions Index

size_tvalue () const noexcept

Returns the underlying ID value. More...

Private Member Attributes Index

size_tid_ {0}

The underlying ID value. More...

Public Static Functions Index

template <typename T>
static ResourceTypeIdid ()

Returns the ResourceTypeId for a specific type. More...

Description

Unique type identifier for engine resources.

ResourceTypeId assigns a unique, monotonically increasing integer ID to each resource type at compile time. Used by ResourceRegistry as an index into the `fastAccess_` array for O(1) type-based resource lookup.

All resource categories (Managers, CommandBuffers, CommandHandlers) share a single index space.

See Also

ResourceRegistry

See Also

TypeIndexer

See Also

ComponentTypeId

See Also

CommandTypeId

Definition at line 32 of file ResourceTypeId.ixx.

Private Member Typedefs

ResourceType

using helios::engine::runtime::world::types::ResourceTypeId::ResourceType = helios_engine_common_tag_ResourceTypes

Definition at line 39 of file ResourceTypeId.ixx.

39 using ResourceType = helios_engine_common_tag_ResourceTypes;

Friends

operator==

friend bool ResourceTypeId, ResourceTypeId
constexpr noexcept default

Definition at line 92 of file ResourceTypeId.ixx.

Reference ResourceTypeId.

Public Constructors

ResourceTypeId()

helios::engine::runtime::world::types::ResourceTypeId::ResourceTypeId (const size_t id)
inline explicit

Constructs a ResourceTypeId with a specific value.

Parameters
id

The type ID value.

Definition at line 55 of file ResourceTypeId.ixx.

55 explicit ResourceTypeId(const size_t id) : id_(id) {}

Reference id.

Referenced by id and operator==.

ResourceTypeId()

helios::engine::runtime::world::types::ResourceTypeId::ResourceTypeId (helios::core::types::no_init_t)
inline explicit

Constructs an uninitialized ResourceTypeId.

Parameters
no_init_t

Tag to indicate no initialization.

Definition at line 63 of file ResourceTypeId.ixx.

Public Member Functions

value()

size_t helios::engine::runtime::world::types::ResourceTypeId::value ()
inline nodiscard noexcept

Returns the underlying ID value.

Returns

The numeric type ID, suitable for use as an array index.

Definition at line 71 of file ResourceTypeId.ixx.

71 [[nodiscard]] size_t value() const noexcept {
72 return id_;
73 }

Private Member Attributes

id_

size_t helios::engine::runtime::world::types::ResourceTypeId::id_ {0}

The underlying ID value.

Definition at line 44 of file ResourceTypeId.ixx.

44 size_t id_{0};

Public Static Functions

id()

template <typename T>
ResourceTypeId helios::engine::runtime::world::types::ResourceTypeId::id ()
inline nodiscard static

Returns the ResourceTypeId for a specific type.

Uses TypeIndexer to generate a unique ID per type. The ID is generated once and cached.

Template Parameters
T

The resource type.

Returns

The unique ResourceTypeId for type T.

Definition at line 87 of file ResourceTypeId.ixx.

87 [[nodiscard]] static ResourceTypeId id() {
89 return ResourceTypeId(tid);
90 }

References ResourceTypeId and helios::core::data::TypeIndexer< Group >::typeIndex.

Referenced by ResourceTypeId.


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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.