Skip to main content

CommandTypeId Class

Unique type identifier for command types. More...

Declaration

class helios::engine::runtime::messaging::command::types::CommandTypeId { ... }

Private Member Typedefs Index

usingComponentType = helios_engine_common_tag_CommandTypes

Friends Index

booloperator==

Public Constructors Index

CommandTypeId (const size_t id)

Constructs a CommandTypeId with a specific value. More...

CommandTypeId (helios::core::types::no_init_t)

Constructs an uninitialized CommandTypeId. 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 CommandTypeIdid ()

Returns the CommandTypeId for a specific command type. More...

Description

Unique type identifier for command types.

CommandTypeId assigns a unique, monotonically increasing integer ID to each command type at compile time. The ID is generated once per type via TypeIndexer and cached in a function-local static.

Suitable for use as an array index or hash key.

See Also

TypeIndexer

See Also

ResourceTypeId

See Also

ComponentTypeId

Definition at line 29 of file CommandTypeId.ixx.

Private Member Typedefs

ComponentType

using helios::engine::runtime::messaging::command::types::CommandTypeId::ComponentType = helios_engine_common_tag_CommandTypes

Definition at line 36 of file CommandTypeId.ixx.

36 using ComponentType = helios_engine_common_tag_CommandTypes;

Friends

operator==

friend bool CommandTypeId, CommandTypeId
constexpr noexcept default

Definition at line 89 of file CommandTypeId.ixx.

Reference CommandTypeId.

Public Constructors

CommandTypeId()

helios::engine::runtime::messaging::command::types::CommandTypeId::CommandTypeId (const size_t id)
inline explicit

Constructs a CommandTypeId with a specific value.

Parameters
id

The type ID value.

Definition at line 52 of file CommandTypeId.ixx.

52 explicit CommandTypeId(const size_t id) : id_(id) {}

Reference id.

Referenced by id and operator==.

CommandTypeId()

helios::engine::runtime::messaging::command::types::CommandTypeId::CommandTypeId (helios::core::types::no_init_t)
inline explicit

Constructs an uninitialized CommandTypeId.

Parameters
no_init_t

Tag to indicate no initialization.

Definition at line 60 of file CommandTypeId.ixx.

Public Member Functions

value()

size_t helios::engine::runtime::messaging::command::types::CommandTypeId::value ()
inline nodiscard noexcept

Returns the underlying ID value.

Returns

The numeric type ID.

Definition at line 68 of file CommandTypeId.ixx.

68 [[nodiscard]] size_t value() const noexcept {
69 return id_;
70 }

Referenced by helios::engine::runtime::messaging::command::CommandHandlerRegistry::has, helios::engine::runtime::messaging::command::CommandHandlerRegistry::registerHandler and helios::engine::runtime::messaging::command::CommandHandlerRegistry::tryHandler.

Private Member Attributes

id_

size_t helios::engine::runtime::messaging::command::types::CommandTypeId::id_ {0}

The underlying ID value.

Definition at line 41 of file CommandTypeId.ixx.

41 size_t id_{0};

Public Static Functions

id()

template <typename T>
CommandTypeId helios::engine::runtime::messaging::command::types::CommandTypeId::id ()
inline nodiscard static

Returns the CommandTypeId for a specific command type.

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

Template Parameters
T

The command type.

Returns

The unique CommandTypeId for type T.

Definition at line 84 of file CommandTypeId.ixx.

84 [[nodiscard]] static CommandTypeId id() {
86 return CommandTypeId(tid);
87 }

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

Referenced by CommandTypeId, helios::engine::runtime::messaging::command::CommandHandlerRegistry::has, helios::engine::runtime::messaging::command::CommandHandlerRegistry::registerHandler and helios::engine::runtime::messaging::command::CommandHandlerRegistry::tryHandler.


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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.