Skip to main content

SystemTypeId.ixx File

Unique type identifier for system types. More...

Included Headers

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

Namespaces Index

namespacehelios
namespaceengine
namespaceruntime
namespaceworld
namespacetypes

Classes Index

classSystemTypeId

Unique type identifier for system types. More...

structhelios_engine_common_tag_SystemTypes

Tag type for the TypeIndexer domain. More...

structhash<helios::engine::runtime::world::types::SystemTypeId>

Hash specialization for SystemTypeId. More...

Description

Unique type identifier for system 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.world.types.SystemTypeId;
11
12import helios.ecs.TypeIndexer;
13import helios.ecs.types;
14
16
29
33 struct helios_engine_common_tag_SystemTypes{};
34
35 using SystemType = helios_engine_common_tag_SystemTypes;
36
40 size_t id_{0};
41
42
43 public:
44
45
51 explicit SystemTypeId(const size_t id) : id_(id) {}
52
53
59 explicit SystemTypeId(helios::ecs::types::no_init_t) {}
60
61
68 return id_;
69 }
70
71
82 template <typename T>
83 [[nodiscard]] static SystemTypeId id() {
84 static const size_t tid = helios::ecs::TypeIndexer<SystemType>::typeIndex<T>();
85 return SystemTypeId(tid);
86 }
87
88 friend constexpr bool operator==(SystemTypeId, SystemTypeId) noexcept = default;
89 };
90
91
92}
93
94
98template<>
99struct std::hash<helios::engine::runtime::world::types::SystemTypeId> {
101 return id.value();
102 }
103
104};

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.