Centralizing and unifying the generator of object identifiers.

This commit is contained in:
brunoherbelin
2020-10-03 14:05:28 +02:00
parent 61e5c046c0
commit f32b85a656
12 changed files with 44 additions and 19 deletions

View File

@@ -12,6 +12,7 @@ using namespace std;
#include "Resource.h"
#include "Visitor.h"
#include "SystemToolkit.h"
#include "GlmToolkit.h"
#include "Stream.h"
@@ -25,8 +26,7 @@ using namespace std;
Stream::Stream()
{
// create unique id
auto duration = std::chrono::high_resolution_clock::now().time_since_epoch();
id_ = std::chrono::duration_cast<std::chrono::nanoseconds>(duration).count() % 1000000000;
id_ = GlmToolkit::uniqueId();
description_ = "undefined";
pipeline_ = nullptr;
@@ -92,11 +92,6 @@ std::string Stream::description() const
return description_;
}
int Stream::id() const
{
return id_;
}
void Stream::execute_open()
{
// reset