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