Skip to main content

CommandTypeId.ixx File

Unique type identifier for command types. More...

Included Headers

#include <functional> #include <cstddef> #include <helios.ecs.types> #include <helios.ecs.TypeIndexer>

Namespaces Index

namespacehelios
namespaceengine
namespaceruntime
namespacemessaging
namespacecommand
namespacetypes

Classes Index

classCommandTypeId

Unique type identifier for command types. More...

structhelios_engine_common_tag_CommandTypes

Tag type for the TypeIndexer domain. More...

structhash<helios::engine::runtime::messaging::command::types::CommandTypeId>

Hash specialization for CommandTypeId. More...

Description

Unique type identifier for command types.

File Listing

The file content with the documentation metadata removed is:

1
5module;
6
7#include <functional>
8#include <cstddef>
9
10export module helios.engine.runtime.messaging.command.types.CommandTypeId;
11
12import helios.ecs.TypeIndexer;
13import helios.ecs.types;
14
16
31
35 struct helios_engine_common_tag_CommandTypes{};
36
37 using ComponentType = helios_engine_common_tag_CommandTypes;
38
42 size_t id_{0};
43
44
45 public:
46
47
53 explicit CommandTypeId(const size_t id) : id_(id) {}
54
55
61 explicit CommandTypeId(helios::ecs::types::no_init_t) {}
62
63
70 return id_;
71 }
72
73
84 template <typename T>
85 [[nodiscard]] static CommandTypeId id() {
86 static const size_t tid = helios::ecs::TypeIndexer<ComponentType>::typeIndex<T>();
87 return CommandTypeId(tid);
88 }
89
90 friend constexpr bool operator==(CommandTypeId, CommandTypeId) noexcept = default;
91 };
92
93
94}
95
96
100template<>
101struct std::hash<helios::engine::runtime::messaging::command::types::CommandTypeId> {
103 return id.value();
104 }
105
106};

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.