A strongly-typed string identifier wrapper based on entt::hashed_string. This structure provides a type-safe wrapper around EnTT's hashed_string, designed for efficient compile-time and runtime string hashing. Unlike Id, this is specifically for string-based identifiers and does not provide implicit conversion to the underlying type. String hashing allows for fast comparisons while maintaining human-readable identifiers during development and debugging.
More...
#include <Id.hpp>
|
| using | ValueType = entt::hashed_string |
| | The underlying value type for StringId, which is entt::hashed_string. This type encapsulates the string data and its hash, allowing for efficient comparisons and lookups while maintaining the original string for debugging purposes.
|
|
| constexpr | StringId (ValueType v=NullValue()) |
| | Constructor for StringId.
|
| constexpr bool | IsNull (void) const |
| | Checks if the ID is null/invalid by comparing its value to the null value defined by the derived class.
|
|
| static constexpr ValueType | NullValue () |
| | Get the null value for this StringId type. This returns a default-constructed entt::hashed_string.
|
| static constexpr StringId | Null () |
| | Get a null instance of StringId, which has its value set to the null value defined by NullValue().
|
| static constexpr StringId | Null (void) |
| | Get the null value for this ID type. This should be defined by the derived class to specify what constitutes a null/invalid ID.
|
|
| entt::hashed_string | value |
| | The underlying value of the ID.
|
A strongly-typed string identifier wrapper based on entt::hashed_string. This structure provides a type-safe wrapper around EnTT's hashed_string, designed for efficient compile-time and runtime string hashing. Unlike Id, this is specifically for string-based identifiers and does not provide implicit conversion to the underlying type. String hashing allows for fast comparisons while maintaining human-readable identifiers during development and debugging.
- Note
- Supports implicit construction from entt::hashed_string values
-
Size is guaranteed to match entt::hashed_string through static assertion
-
Useful for named resources, tags, and other string-based identification schemes
◆ ValueType
The underlying value type for StringId, which is entt::hashed_string. This type encapsulates the string data and its hash, allowing for efficient comparisons and lookups while maintaining the original string for debugging purposes.
◆ StringId()
Constructor for StringId.
- Parameters
-
| v | The value to initialize the StringId with. Defaults to the null value defined by the NullValue() method. |
◆ Null()
| StringId Engine::StringId::Null |
( |
void | | ) |
|
|
staticconstexpr |
◆ NullValue()
Get the null value for this StringId type. This returns a default-constructed entt::hashed_string.
- Returns
- The value representing a null/invalid StringId for this type.
The documentation for this struct was generated from the following files: