17 static constexpr uint32 cInvalidCharacterID = 0xffffffff;
21 mID(cInvalidCharacterID)
39 return mID == cInvalidCharacterID;
45 return mID == inRHS.mID;
51 return mID != inRHS.mID;
57 return mID < inRHS.mID;
63 return mID > inRHS.mID;
77 uint32 next = sNextID.fetch_add(1, std::memory_order_relaxed);
78 if (next != cInvalidCharacterID)
86 sNextID.store(inNextValue, std::memory_order_relaxed);
91 inline static atomic<uint32> sNextID = 1;
#define JPH_EXPORT
Definition Core.h:271
std::uint64_t uint64
Definition Core.h:485
#define JPH_NAMESPACE_END
Definition Core.h:414
std::uint32_t uint32
Definition Core.h:484
#define JPH_NAMESPACE_BEGIN
Definition Core.h:408
#define JPH_OVERRIDE_NEW_DELETE
Macro to override the new and delete functions.
Definition Memory.h:31
ID of a character. Used primarily to identify deleted characters and to sort deterministically.
Definition CharacterID.h:13
static void sSetNextCharacterID(uint32 inNextValue=1)
Set the next available character ID, can be used after destroying all character to prepare for a seco...
Definition CharacterID.h:84
CharacterID()
Construct invalid character ID.
Definition CharacterID.h:20
uint64 GetHash() const
Get the hash for this character ID.
Definition CharacterID.h:67
static CharacterID sNextCharacterID()
Generate the next available character ID.
Definition CharacterID.h:73
bool IsInvalid() const
Check if the ID is valid.
Definition CharacterID.h:37
uint32 GetValue() const
Definition CharacterID.h:31
CharacterID(uint32 inID)
Construct from index and sequence number combined in a single uint32 (use with care!...
Definition CharacterID.h:26
Fallback hash function that calls T::GetHash()
Definition HashCombine.h:59