Convert IDGenerator uint32 -> size_t

Signed-off-by: Chris Burel <burelc@amazon.com>
This commit is contained in:
Chris Burel
2021-05-24 12:04:00 -07:00
parent ce139d6ae9
commit 387a1faf23
2 changed files with 6 additions and 6 deletions
@@ -15,8 +15,8 @@ namespace MCore
{
// constructor
IDGenerator::IDGenerator()
: mNextID{0}
{
mNextID.SetValue(0);
}
@@ -27,10 +27,10 @@ namespace MCore
// get a unique id
uint32 IDGenerator::GenerateID()
size_t IDGenerator::GenerateID()
{
const uint32 result = mNextID.Increment();
MCORE_ASSERT(result != MCORE_INVALIDINDEX32); // reached the limit
const size_t result = mNextID++;
MCORE_ASSERT(result != InvalidIndex); // reached the limit
return result;
}
} // namespace MCore
@@ -28,10 +28,10 @@ namespace MCore
* This is thread safe.
* @return The unique id.
*/
uint32 GenerateID();
size_t GenerateID();
private:
AtomicUInt32 mNextID; /**< The id used for the next GenerateID() call. */
AZStd::atomic<size_t> mNextID; /**< The id used for the next GenerateID() call. */
/**
* Default constructor.