Skip to main content

ManagerTypeId.ixx File

Unique type identifier for engine resources. More...

Included Headers

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

Namespaces Index

namespacehelios
namespaceengine
namespaceruntime
namespaceworld
namespacetypes

Classes Index

classManagerTypeId

Unique type identifier for engine resources. More...

structhelios_engine_common_tag_ResourceTypes

Tag type for the TypeIndexer domain. More...

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

Hash specialization for ManagerTypeId. More...

Description

Unique type identifier for engine resources.

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.ManagerTypeId;
11
12import helios.ecs.TypeIndexer;
13import helios.ecs.types;
14
16
34
38 struct helios_engine_common_tag_ResourceTypes{};
39
40 using ResourceType = helios_engine_common_tag_ResourceTypes;
41
45 size_t id_{0};
46
47
48 public:
49
50
56 explicit ManagerTypeId(const size_t id) : id_(id) {}
57
58
64 explicit ManagerTypeId(helios::ecs::types::no_init_t) {}
65
66
73 return id_;
74 }
75
76
87 template <typename T>
88 [[nodiscard]] static ManagerTypeId id() {
89 static const size_t tid = helios::ecs::TypeIndexer<ResourceType>::typeIndex<T>();
90 return ManagerTypeId(tid);
91 }
92
93 friend constexpr bool operator==(ManagerTypeId, ManagerTypeId) noexcept = default;
94 };
95
96
97}
98
99
103template<>
104struct std::hash<helios::engine::runtime::world::types::ManagerTypeId> {
106 return id.value();
107 }
108
109};

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.