Files
2023-04-23 21:57:20 +08:00

20 lines
390 B
C++

#include "delegate.h"
#include <mutex>
namespace engine
{
DelegateHandle::HandleType DelegateHandle::getNewID()
{
static HandleType runtimeID = 0;
// Valid state check.
// uint64_t is very large and should never overflow.
if (runtimeID == kInvalidID)
{
runtimeID = 0;
}
// Increment and return.
return runtimeID ++;
}
}