TypeIndexer Class Template
Utility class to generate unique type indices at runtime. More...
Declaration
Public Static Functions Index
template <typename T> | |
| static size_t | typeIndex () |
|
Generates and returns a unique type index for a specific type. More... | |
Private Static Attributes Index
template <typename Group> | |
| static std::atomic< size_t > | counter_ {0} |
|
A static atomic counter used for generating unique type indices. More... | |
Description
Utility class to generate unique type indices at runtime.
This class provides a mechanism to generate and retrieve unique indices for different types. It ensures that each type gets a distinct index which remains constant throughout the program's execution.
The indices are generated in a thread-safe manner using atomic operations.
- Template Parameters
-
Group A tag type used to create separate index spaces. Different Group types maintain independent counters, allowing the same type T to have different indices in different contexts.
Example usage:
Definition at line 48 of file TypeIndexer.ixx.
Public Static Functions
typeIndex()
| inline static |
Generates and returns a unique type index for a specific type.
This method assigns a unique index to each type within the scope of the associated TypeIndexer.
- Template Parameters
-
T The type for which to retrieve the unique index.
- Returns
A unique index representing the specific type T within this Group.
Definition at line 68 of file TypeIndexer.ixx.
Reference helios::ecs::TypeIndexer< Group >::typeIndex.
Referenced by helios::ecs::TypeIndexer< Group >::typeIndex.
Private Static Attributes
counter_
| static |
A static atomic counter used for generating unique type indices.
Definition at line 53 of file TypeIndexer.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.