A strongly-typed identifier wrapper based on entt::id_type. This structure provides a type-safe wrapper around EnTT's id_type, offering implicit conversion to the underlying type for seamless integration with EnTT components. It inherits from BasicId to provide null checking and other common ID operations.
More...
#include <Id.hpp>
|
| constexpr | Id (ValueType v=NullValue()) |
| | Constructor for Id.
|
| constexpr | operator ValueType () const |
| | Implicit conversion operator to the underlying entt::id_type, allowing seamless use of Id instances where entt::id_type is expected.
|
|
| static constexpr ValueType | NullValue () |
| | Get the null value for this ID type. This returns the null value defined by EnTT's id_type, which is typically.
|
| static constexpr Id | Null () |
| | Get a null instance of Id, which has its value set to the null value defined by NullValue().
|
|
| entt::id_type | value |
| | The underlying value of the ID.
|
A strongly-typed identifier wrapper based on entt::id_type. This structure provides a type-safe wrapper around EnTT's id_type, offering implicit conversion to the underlying type for seamless integration with EnTT components. It inherits from BasicId to provide null checking and other common ID operations.
- Note
- Supports implicit construction from entt::id_type values
-
Supports implicit conversion back to entt::id_type for compatibility
-
Size is guaranteed to match entt::id_type through static assertion
◆ ValueType
◆ Id()
Constructor for Id.
- Parameters
-
| v | The value to initialize the ID with. Defaults to the null value defined by the NullValue() method. |
- Todo
Put the implementation in the cpp file if possible
rename v to something more descriptive, like idValue or rawValue
◆ Null()
| constexpr Id Engine::Id::Null |
( |
| ) |
|
|
inlinestaticconstexpr |
Get a null instance of Id, which has its value set to the null value defined by NullValue().
- Returns
- A null instance of Id.
- Todo
- Put the implementation in the cpp file if possible
◆ NullValue()
| constexpr ValueType Engine::Id::NullValue |
( |
| ) |
|
|
inlinestaticconstexpr |
Get the null value for this ID type. This returns the null value defined by EnTT's id_type, which is typically.
- Returns
- The value representing a null/invalid ID for this type.
- Todo
- Put the implementation in the cpp file if possible
◆ operator ValueType()
Implicit conversion operator to the underlying entt::id_type, allowing seamless use of Id instances where entt::id_type is expected.
The documentation for this struct was generated from the following file: