Add GetUniqueTypeId
This commit is contained in:
@@ -18,6 +18,8 @@
|
||||
|
||||
namespace OpenVulkano
|
||||
{
|
||||
std::atomic_int Utils::uniqueTypeID = 0;
|
||||
|
||||
void Utils::SetThreadName(const std::string& name)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
|
||||
@@ -12,12 +12,15 @@
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <cinttypes>
|
||||
#include <atomic>
|
||||
#include "Data/Containers/Array.hpp"
|
||||
|
||||
namespace OpenVulkano
|
||||
{
|
||||
class Utils
|
||||
{
|
||||
static std::atomic_int uniqueTypeID;
|
||||
|
||||
public:
|
||||
static void SetThreadName(const std::string& name);
|
||||
static std::string GetThreadName();
|
||||
@@ -138,5 +141,12 @@ namespace OpenVulkano
|
||||
}
|
||||
|
||||
static Array<char> ReadFile(const std::string& filePath, bool emptyOnMissing = false);
|
||||
|
||||
template<class T>
|
||||
int GetUniqueTypeId()
|
||||
{
|
||||
static const int id = uniqueTypeID++;
|
||||
return id;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user