Skip to main content

TypeIndexer.ixx File

Utility for generating unique type indices at runtime. More...

Included Headers

#include <atomic> #include <cstddef>

Namespaces Index

namespacehelios
namespaceecs

Classes Index

classTypeIndexer<Group>

Utility class to generate unique type indices at runtime. More...

Description

Utility for generating unique type indices at runtime.

File Listing

The file content with the documentation metadata removed is:

1
5module;
6
7#include <atomic>
8#include <cstddef>
9
10export module helios.ecs.TypeIndexer;
11
12export namespace helios::ecs {
13
47 template<typename Group>
48 class TypeIndexer {
49
53 static inline std::atomic<size_t> counter_{0};
54
55 public:
56
67 template<typename T>
68 static size_t typeIndex() {
69 static const size_t typeIndex = counter_.fetch_add(1, std::memory_order::relaxed);
70 return typeIndex;
71 }
72
73 };
74}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.